I have wavefront alerts set up with the following alert condition:
ts(mytimeseries)<20000
Recently the datasource stopped sending data to wavefront but I did not receive an alert. I cannot figure out why this did not alert. Do I need to set up a separate alert for when data is not sent. Thanks
Yes in scenarios where there is no data sent you explicitly need to define the condition for that. Well the best approach is to create a new availability alert but still if you want to manipulate the same condition you can do something like below
default( 20001 ,ts(mytimeseries))<20000
In case there is no data found it will exceed your limit and will raise the alert
Related
My goal is very simple and I would guess it is a very common goal among web developers.
I am creating a Rails (5.1) application, and I simply want to use AJAX to get the value of a specific cell in a specific row of a specific table in my database (later I am going to use that value to highlight some text on the current page in the user's browser).
I have not been able to find any documentation online explaining how to do this. As I said, it seems like a basic task to ask of jquery and ajax, so I'm confused as to why I'm having so much trouble figuring it out.
For concreteness, say I have a table called 'animals', and I want to get the value of the column 'species' for the animal with 'id' = 99.
How can I construct an AJAX call to query the database for the value of 'species' for the 'animal' with 'id' = 99 .
Though some DBs provide a REST API, what we commonly do is define a route in the app to pull and return data from the DB.
So:
Add a route
Add a controller/action for that route
In that action, fetch the data from the DB and render it in your preferred format
On the client-side, make the AJAX call to that controller/action and do something with the response.
I send to my telegram bot a few photos as group. How I can get the file_id all of my uploaded photos?
I use webhooks, but response is not contain any data about all photos, just some data about last uploaded photo and media_group_id. How I can get all file_id's of my uploaded group photos
response:
The Telegram Bot API does not give to your web-hook any reliable information about the order of each item in a media group. https://core.telegram.org/bots/api#message
Suggestions:
If bot is in a private chat, save the incoming file_id against their media_group_id. Whenever media_group_id changes you would have all you need to use. Engage the user in some other way so that you can quickly determine the media_group_id change and respond quickly from that processing.
If bot is in a group chat, save incoming file_id against the users id as well as media_group_id and similarly monitor changes to media_group_id and user id to take action.
When a solution starts getting too complex for my liking, I prefer to go back to the basic reason for my need and perhaps find out that I do not need to do something an API doesn't afford like "Get all uploaded photos by media_group_id". Maybe I can just process them individually as the updates stream in.
Tip: If the media group has a caption and you only care about the first media item in the group, then monitoring the media_group_id and caption of an incoming message should be sufficient.
if(message.caption != null && message.media_group_id != null){
// first item in new group received
}
Okay, this way is not simple and not elegant but it's working.
We need to see in webhook response media_group_id element - this means that this is a group of media.
If the first point is true - save the data about this media on own server (data must be contain media_group_id)
example: ["media_group_id" => [[some data about photo]]]
When next webhook is come, we need to see his media_group_id, if it's the same - ok, add him to array...
example: ["media_group_id" => [[some data about photo],[some data about photo]]]
if not - ok, make a new element of array:
example: ["media_group_id" => [[some data about photo]], "media_group_id2" =>
[[some data about photo]]]
So we got an array that contains all data about the photos of the one(or more) group.
hmmm... I don't like this way, but how make better?
In Pyrogram, we can use the get_media_group function, https://docs.pyrogram.org/api/methods/get_media_group.html#pyrogram.Client.get_media_group. in my opinion, it is much better than using BOT API.
The Nelmio is working perfectly in my project but I get an error 400 Bad Request
when I want to insert a date in my Nelmio !!
The type used is Date.
you send something like
transaction[dateP]=value
but form required something like this
transaction[dateP][year]=value&transaction[dateP][month]=value&transaction[dateP][data]=value
So split your value into 3 parameters or you can change widget option of dateP field to single_text to solve the problem.
I guess that all the transaction details are not needed as parameters which have to be defined in the URL of you request.
In case of being data, you will have to specify it like this {"transaction":{}} in the content box on you right.
I have an item of type float, but sometimes a string is received in case of error instead of a number. How can I make a trigger regexp to fire in this case?
I have no idea now to check for "wrong data type".
Actually this is by design and what I'm trying to do is this: if the data gathering fails, I send an error message in order to see it on zabbix end.
I tried with nodata(0), but this doesn't seem to work.
In you case zabbix will not store the "wrong" value for the item. And if you don't care what the string is then you can just setup a trigger for "nodata" for the period of your interval. Look in the triggers manual and search for the "nodata".
Edit: scratch that, didn't read the whole question ....
Edit2: if you are certain that this is not working by design and not because your trigger interval misses the data interval, then you can try to catch the unsupported status. There is an open request for the functionality, but you can setup a side script similar to this. Or you can wrap the monitored item on the node into a UserParameter script that reads the value and prints -1 or something if it is not a number. Then proceed with a normal numeric trigger.
Using the Box 1.0 REST API, I am trying to work with the functions in SOAP UI.
The API doc for get_managed_users with user_id=12345 (internal id retrieved with get_user_id call correctly) is returning all the users. The docs say that would be the case if you do not specify a user_id value. But my full command is: (Token and API key changed to protect the clueless)
https://www.box.com/api/1.0/rest?user_id=27360&auth_token=blahbalhblah1234&action=get_managed_users&api_key=someKeyYouShouldNotSee
Now I could work with the complete result list, but that won't scale as we get thousands of users into the system.
I can make a call with edit_managed_user, using the same user_id value and the change is reflected in the UI, and in the next get_managed_users call. Thus I do have the correct user_id value, I would so assume.
I tried testuser#gmail.com as the user_id value as well, and get the entire list back. This leads me to believe that somehow I am sending user_id wrong, but I just do not see it.
Any hints? Why, with what seems like a valid user_id value is it acting like it is absent or incorrect?
Most likely you have either called this method with an invalid user_id, or one that is not in your set of managed users. Can you double check that the user comes back in your list of already managed users?