Output content from log file into zabbix dashboard, regexp example

On the client side create item that looks for specific condition in log file
UserParameter=custom_item,if exist c:\pat\to\output.log cat c:\pat\to\output.log | grep -e "content.*found" | tail -1
To use the last value use tail -1.
To use first value use head -1.

Into zabbix server create item custom_item with text value:
Create trigger name
Details from log file {ITEM.LASTVALUE}
Formula
{servername:custom_item.regexp(content)}=1
Do not use quotes inside regex()!
If the log file meets defined condition it will be reported into Zabbix dashboard :)

No comments: