zabbix regex to trigger for wrong data type - zabbix

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.

Related

Activate the zabbix trigger at a certain time

I want to make the zabbix trigger work strictly at a certain time.
I read in the zabbix documentation that the time() function can help with this.
{test.domain:web.test.fail[trigger].last()}=0 and time()>000000 and time()<060000
But when i save the trigger, I get an error:
Invalid parameter "/1/expression": incorrect trigger expression starting from " time()>000000 and time()<060000".
Zabbix 5.0.18
I will be grateful for your help.
Zabbix triggers are evaluated each time a new values is received.
You can check an item at cetain times using Custom Intervals.
See: https://www.zabbix.com/documentation/current/en/manual/config/items/item/custom_intervals

Zabbix - Problem with count function and external item data

Trying to setup Zabbix to show incomming login failures by syslog log files. I try to create an trigger which triggers when the last value occurs in the last 5 minutes of x amount of items.
The following expression is created:
Code:
count(/Syslog server/log[/var/log/failedlogin.log],5m,"like","last(/Syslog server/log[/var/log/failedlogin.log],#0)")>3
Also the following does not work:
Code:
count(/Syslog server/log[/var/log/failedlogin.log],5m,"like","{ITEM.LASTVALUE}")>3
I'm sure the count function works like it should be, when i fill in de variable manually the item does trigger.
But when i try to get a value out of an other items which is containing the data is seems to not work.
Could someone tell me if this is even possible? Thanks and greetings.

osisoft updating values ​with python

I want to get the data from Excel and update the values ​​of the data between certain dates in the osisoft system. But I don't know how to code AfTimeRange.
I get the error "value cannot be converted to OSIsoft.AF.Time.AFTime".
enter image description here
Good news: You've constructed your [AFTimeRange] correctly!
Notice that the error being thrown is not by the [AFTimeRange] constructor, but from something else.
The issue is that you are trying to set the 'Timestamp' attribute [OSIsoft.AF.Time.AFTime] to a value of type [OSIsoft.AF.Time.AFTimeRange], and so it's failing. A PI event has a single timestamp, not a time range.
I'm not familiar with Python, but it should work if you input the value as an AFTime object using its string constructor, assuming you're intending to use yesterday midnight as your timestamp:
val.timestamp = AFTime("y")
See the documentation on AFTime for more detail.

Query Google Admin User directory comparing parameters

I'm trying to filter my users list by comparing two parameters
query="EmployeeData.EmployeeID=externalId"
EmployeeData.EmployeeID is a custom schema that is populated, with a cron job, with the same value as externalId.
Of course I let the cron do the field copy only if necessary, this is the reason I'm trying to filtering the users list.
In the way i wrote seems that the query trying to looking for a value "externalId" into the EmployeeData.EmployeeID ignoring that "externalId" is a even a field
any suggestion?
The way your code is written, the query sent to Google's servers is as you correctly guessed the following:
EmployeeData.EmployeeID=externalId where your actual externalId is not sent but rather the string "externalId".
To replace this string for the actual value of your variable, you can use what is called "string concatenation" 1. To do it, you just need to modify your code as shown below:
query="EmployeeData.EmployeeID=" + externalId;
This way, the query will be sent as you need to Google's servers.

Zabbix Triggers iregex expression validation

I am a beginner in zabbix agent.I would like to know if the below trigger is syntactically correct? If yes then how do I know if the trigger is fired ?
I am not able to receive email notifications.Kindly help me .
{MDMCenter:eventlog[761848].iregexp("Job.Execute() failed. (ex.Message = System.Exception: Exception: Failed in Batch: [1] of \[[0-9]*\] ---> System.Exception: Exception: Failed in Batch: [1] of \[[0-9]*\]] ---> System.IO.IOException: The network name cannot be found.")}
The expression as you have it here seems to be invalid - looks like you have accidentally added some example value inside the function parameters.
You can look for the trigger firing on the dashboard or in the Monitoring -> Triggers page.
In general, before even looking at triggers, verify that data is coming in and that the values match your expectations. If some trigger still does not seem to work, always provide exact trigger expression and a few example values, as well as all the things you have checked (server being running, item values being recent and so on).