Hi all! I use zabbix to monitor MegaCli raid state. It worked fine, but once it failed for some reasons.
Here is the zabbix_agentd.conf:
If I try to check the value of megacli.raid.state locally, it returns 2:
But when I try to check it from zabbix server, it returns 0:
My /etc/suders.conf:
All other parameters work fine.
Well, the question is: why? And what should I check to find a reason?
Here is the zabbix_agentd.conf:
Code:
oradb-01:~ # cat /usr/local/etc/zabbix_agentd.conf PidFile=/var/run/zabbix/zabbix_agentd.pid LogFile=/var/log/zabbix_agentd.log EnableRemoteCommands=1 Server=77.**.**.** ServerActive=77.**.**.** Hostname=oradb-1 UserParameter=megacli.raid.state,/usr/bin/sudo /opt/MegaRAID/MegaCli/MegaCli -LDInfo -Lall -Aall | grep Optimal | wc -l
Code:
oradb-01:~ # sudo -u zabbix zabbix_agentd -t megacli.raid.state megacli.raid.state [t|2]
Code:
23:00:29 terra # zabbix_get -s 192.168.168.10 -p 10050 -I 77.**.**.** -k megacli.raid.state 0
Code:
Defaults targetpw # ask for the password of the target user i.e. root %users ALL=(ALL) ALL # WARNING! Only use this together with 'Defaults targetpw'! root ALL=(ALL) ALL zabbix ALL=NOPASSWD: /opt/MegaRAID/MegaCli/MegaCli
Well, the question is: why? And what should I check to find a reason?