Zabbix and logrt.count doesn’t get data

zabbixzabbix-agent

I'm running Debian and Zabbix 3.4.

I've created a custom item with the following syntax:

logrt.count["/var/log/^req_log.*.txt$","TIMEOUT"]

I'm trying to detect any log file in the format req_log2018-06-26.txt with the word TIMEOUT and return the number of occurenses.

But no data is gathered with this item, even though there are some files in the directoty which does contain the word.

Is there a way to manually run and test item on server with Zabbix agent running?

Best Answer

From Zabbix version 3.4+, Perl compatible regular expressions (PCRE) are implemented in the Zabbix frontend/backend. Your regexp doesn't look right:

$ touch req_log2018-06-26.txt
$ ls -lah | grep -P '^req_log.*.txt$'
<empty result>
$ ls -lah | grep -P 'req_log.*.txt'
-rw-r--r--.  1 root root     0 Jul 12 20:37 req_log2018-06-26.txt

Try:

logrt.count["/var/log/req_log.*.txt","TIMEOUT"]