MogiePete / zabbix-systemd-service-monitoring

Simple Zabbix Template to discover, monitor, and alert on systemd services.
GNU General Public License v2.0
91 stars 41 forks source link

Value should be a JSON object #11

Closed dcbell closed 5 years ago

dcbell commented 5 years ago

I am getting an error about "Value should be a JSON object" similar to #1 and #10.

1 references a sudoers file that doesn't appear to be in the instructions anymore, so I'm assuming that is no longer necessary?

10 he used a workaround with bash.

When looking in Host > Discovery Rules the SystemD shows Not Supported and the info box shows Value should be a JSON object. Right now I have all the scripts owned by zabbix:zabbix and file permissions are set to -rwxr-xr-x on the scripts. When I run zabbix_agentd -t "systemd.service.discovery" it returns:

systemd.service.discovery [t|]

Which doesn't appear to be correct at all. If I manually run the discover script, I get:

{"data":[{"{#SERVICE}": "apache2"},{"{#SERVICE}": "chrony"},{"{#SERVICE}": "chronyd"},{"{#SERVICE}": "mariadb"},{"{#SERVICE}": "smbd"},{"{#SERVICE}": "ssh"},{"{#SERVICE}": "sshd"},{"{#SERVICE}": "sssd"},{"{#SERVICE}": "zabbix-agent"}]}

Which is the services I put in the whitelist file. Any suggestions?

MogiePete commented 5 years ago

This issue was fixed in #8 but I must have duplicated it when I split it into Whitelist/Blacklist.

I have updated the Whitelist userparameter file to resolve the problem.

As for the services to put in the whitelist you would put the ones you want to monitor, e.g. zabbix-agent, ssh/sshd, httpd/apache, mariadb/mysql, etc.

dcbell commented 5 years ago

Worked like a charm. Thank you.