Hello, everyone!
I'm trying to make discovery rule to add file size monitor.
But I when add my Template to Host, zabbix says me Value should be a JSON object.
Zabbix Agent (daemon) v2.2.10 (revision 54806) (10 August 2015)
Zabbix server v2.2.9 (revision 52686) (12 March 2015)
I've written the python-script:
It works fine and gets follows:
I've checked it by http://jsonlint.com/ - valid JSON.
UserParameter in conf.d:
There are attachments show my discovery configuration:


User zabbix has permission to directory with script and logs.
Please, help me to sort out.
I'm trying to make discovery rule to add file size monitor.
But I when add my Template to Host, zabbix says me Value should be a JSON object.
Zabbix Agent (daemon) v2.2.10 (revision 54806) (10 August 2015)
Zabbix server v2.2.9 (revision 52686) (12 March 2015)
I've written the python-script:
Code:
import os
import sys
import json
logdir = sys.argv[1]
data = []
for (logdir, _, files) in os.walk(logdir):
for f in files:
if f.endswith(".log"):
path = os.path.join(logdir, f)
data.append({'#LOGFILEPATH':path})
jsondata = json.dumps(data)
print jsondata
HTML Code:
[{"#LOGFILEPATH": "/opt/logs/projects/cms/cms.log"}, {"#LOGFILEPATH": "/opt/logs/projects/books/nginx.log"}]
UserParameter in conf.d:
HTML Code:
UserParameter = discovery.logfile.path, python /opt/scripts/zabbix/find.logfile.path.and.size.py /opt/logs/
User zabbix has permission to directory with script and logs.
Please, help me to sort out.
Comment