Activate the zabbix trigger at a certain time - zabbix

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

Related

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.

how can i allow aws IAM permission only specific time

I am trying to make IAM polish to only work from 9AM to 10AM.
Since I am not corder, so I am struggle with this...
help me plz....
I tried to add conditions:
"Condition": {
"DateGreaterThan": {"aws:CurrentTime": "2021-04-20T09:00:00Z"},
"DateLessThan": {"aws:CurrentTime": "2021-04-20T10:00:00Z"}
but.. in this way, i have to update manually every day..
So i tried ...
"Condition": {
"DateGreaterThan": {"aws:CurrentTime": "****-**-**T09:00:00Z"},
"DateLessThan": {"aws:CurrentTime": "****-**-**T10:00:00Z"}
but this is not working.
How can i accomplish working depends on time not depends on date..?
Thank you
You can't use wildcards in datetime operations in IAM. From docs
Wildcards are not permitted for date condition operators.
So you either have to use full date/time or timestamp. To automate this, you can create a lambda function that is triggered on a schedule. The lambda would use AWS sdk to update your policy everyday.

mysql event scheduler displays error: 'database not selected'

I apologize if this question seems mundane, but I couldn't find a suitable answer on the web. It's my first time working with event scheduler in phpmyadmin and I think I've got the syntax down:
CREATE EVENT `zero_my_column`
ON SCHEDULE EVERY
1 MINUTE STARTS '2017-07-21 19:02:00'
DO BEGIN
UPDATE
`runners`.`run`
SET
`weekly_total` = 0
WHERE
`weekly_total` <> 0
END;
However, when I run this query in my localhost/phpmyadmin page I get the following error: #1046 - No database selected. runners is my database and run is my table. I am trying to reset the weekly_total column to zero. I'm wondering if the error arises because I need to enter validation to access the database, but I'm unsure. Any tips/hints are much appreciated.
I finally figured it out:
To create an event
Go into phpmyadmin
go to the database you will schedule the event for
click on Events tab
Then enter the script to schedule the event

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).

zabbix regex to trigger for wrong data type

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.