Answer the question
In order to leave comments, you need to log in
How does Zabbix calculate the time between two events in the log?
Good afternoon. I ran into a problem that I couldn't solve.
Installed Zabbix 3.2.
I have an item: log["/var/log/script_log",started|finished]
Is it possible to calculate the time between the started and finished events?
UPD:
Log example:
[2016-12-27 16:18:01] update_apache_instance_configs.php started
[2016-12-27 16:18:01] update_apache_instance_configs.php finished
Answer the question
In order to leave comments, you need to log in
Oh ... I had to face such a task. It was necessary to monitor the time of working out the service method (long) by the log... First, a script was written on the machine where the log is stored, which took the last line with the finish pattern - isolated the time, then took the last term with the start pattern from the same log (I isolated the time ), then made calculations and gave the result. I tied it to zabbix through the agent's user parameters.
Then, we decided that the method itself would count the processing time, and write a line with the execution finish pattern + time to the log. Further, according to the same scheme (through UserParams, a one-line command pulled out the time and gave it to the agent).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question