You can run the check successfully from the CLI but only as "root". You should be able to run it as nagios...[root@nagiosxi nagiosxi]# su -l nagios -c '/usr/local/nagios/libexec/check_wmi_plus.pl -H server -u user -p pwd -m checkcpu -w 80 -c 90'
UNKNOWN - Permission denied when trying to store the state data. Sometimes this happens if you have been testing the plugin from the command line as a different user to the Nagio process user. You will need to change the permissions on the file or remove it. The actual error text is: can't create /tmp/cwpss_checkcpu_wsapp29web___.state: Permission denied at /usr/local/nagios/libexec/check_wmi_plus.pl line 1710
But don't forget my problem is only visible in Nagiosxi GUI (running check_wmi_plus.pl works fine)
Code: Select all
[root@testbox nagiosxi]# su -l nagios -c '/usr/local/nagios/libexec/check_wmi_plus.pl -H 192.168.x.x -u username -p password -m checkcpu -w 80 -c 90'
OK (Sample Period 7 sec) - Average CPU Utilisation 9.04%|'Avg CPU Utilisation'=9.04%;80;90;Remove ALL of the files in the "/tmp" directory.
Code: Select all
cd /tmp
rm -rf *Go the web UI, and schedule a forced immediate check a few times.
Let us know if this fixed your problem.