I need help on resolving the following task:
I want to monitor a log file. A rotating log file. so filename-date.log, new file generated every day.
The log file is generated by a server application, that is making connections to clients.
If it cannot connect to one or more clients, this it is added to the log as an error.
It will after 5 minutes, try to connect again to the client(s) again, if it cannot connect, an error will be added to the log again.
by using the logrt key (zabbix 6.4.20) and preprocessing, i have succeeded in generating a problem, for the latest client that was represented in the log. But there were multiple.
Ex log file:
2025-01-24 00:01:43.012 [EROR] No such host is known. | Client: TEST123
2025-01-24 00:01:43.012 [INFO] Will look for TEST123 again in 300 seconds...
2025-01-24 00:01:43.512 [EROR] No such host is known. | Client: TEST999
2025-01-24 00:01:43.512 [INFO] Will look for TEST999 again in 300 seconds...
2025-01-24 00:01:44.112 [EROR] No such host is known. | Client: 555TEST
2025-01-24 00:01:44.112 [INFO] Will look for 555TEST again in 300 seconds...
2025-01-24 00:06:43.051 [EROR] No such host is known. | Host: TEST123
2025-01-24 00:06:43.051 [INFO] Will look for TEST123 again in 300 seconds...
2025-01-24 00:06:43.551 [EROR] No such host is known. | Host: TEST999
2025-01-24 00:06:43.551 [INFO] Will look for TEST999 again in 300 seconds.
2025-01-24 00:06:44.151 [EROR] No such host is known. | Host: 555TEST
2025-01-24 00:06:44.151 [INFO] Connection OK to 555TEST
etc...
So initially (at 00:01) i would like for 3 problems to be created:
- Unable to connect to client TEST123
- Unable to connect to client TEST999
- Unable to connect to client 555TEST
So the log example goes back many days, so there are lots of "[EROR] No such host" in the files.
I have succeed in doing the preprocessing. only looking for the last 10 minutes of the log files.
Also i have been getting problems created, but only 1 problem. Unless i allow for multiple problems to be created, then i get many problems, and many duplicate problems.
Without going to much what i have tried so far. Then how would you resolved such a monitoring task? are there different approaches?
Thanks for helping out!
Br
Michael

Comment