Hi all,
on my setup I've got Zabbix 6.2.2 Server and Zabbix Agent 2 installed on the hosts (zabbix_agent2-6.2.2).
I want to use userparams to catch automatically with Zabbix Agent 2 the current (today) date from the server in yyyy-mm-aa format to let an item I've configured in Zabbix Server to read log files and catch some different expections on Tomcat logs.
At this moment I've configured this item in Zabbix Server using these configurations:
This works pretty well, but the thing here is that those logfiles are with rotation (current date) so I should use logrt instead... and here come the issue... I can't place any wildcard within logrt key, I've already tried with:
But they don't work, Zabbix is telling me that he can't find the proper file/directory.
So the idea here is to use a ps1 script on the server, let the Zabbix Agent 2 execute that script with an userparam and let it resolve the correct log name complete of the date:
For example I've tried in the Zabbig Agent 2 conf file (findCatalina.ps1 is a script that give me the name complete of the date, for example catalina-2024-11-23.log):
And then I've tried to update my key in the item in this manner:
The issue here is that it seems that no userparam works in the agent, I can't make them work in any matter, anything I try it gives me this error:
Restarted countless time the agent, no luck at all...
So, any suggestion to help me fixing this issue?
on my setup I've got Zabbix 6.2.2 Server and Zabbix Agent 2 installed on the hosts (zabbix_agent2-6.2.2).
I want to use userparams to catch automatically with Zabbix Agent 2 the current (today) date from the server in yyyy-mm-aa format to let an item I've configured in Zabbix Server to read log files and catch some different expections on Tomcat logs.
At this moment I've configured this item in Zabbix Server using these configurations:
Code:
Type: Zabbix agent active Key: log[D:/Tomcats/logs/catalina-2024-11-23.log,FATAL|NullPointerException|SQLSyntaxErrorE xception|IndexOutOfBoundsException] Information: Log
Code:
logrt[D:/Tomcats/logs/catalina*.log,FATAL|NullPointerException|SQLSyntax ErrorE xception|IndexOutOfBoundsException]
Code:
logrt[D:/Tomcats/logs/catalina-????-??-??.log,FATAL|NullPointerException|SQLSyntax ErrorE xception|IndexOutOfBoundsException]
So the idea here is to use a ps1 script on the server, let the Zabbix Agent 2 execute that script with an userparam and let it resolve the correct log name complete of the date:
For example I've tried in the Zabbig Agent 2 conf file (findCatalina.ps1 is a script that give me the name complete of the date, for example catalina-2024-11-23.log):
Code:
UserParameter=log.findCatalina,powershell.exe -ExecutionPolicy Bypass -File "C:/scripts/findCatalina.ps1"
And then I've tried to update my key in the item in this manner:
Code:
logrt[{log.findCatalina},FATAL|NullPointerException|SQLSyntaxErrorException|IndexOutOfBoundsException]
Code:
C:\Users\Administrator>zabbix_agent2 -t log.findcatalina log.findcatalina [m|ZBX_NOTSUPPORTED] [Unknown metric log.findcatalina]
So, any suggestion to help me fixing this issue?
Comment