[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)
This is whenever the nagios user runs the command, the su command above displays that it is a permissions issue in /tmp or with the specific file in /tmp. Please run:
ls -lartd /tmp >> /tmp/tmpfileperms.txt
ls -lart /tmp >> /tmp/tmpfileperms.txt
and send us the resulting file /tmp/tmpfileperms.txt please.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
What performance data does the service have in the web interface? Click the service name then go to the Advanced tab a post a screenshot. I am interested to see what it thinks the CPU is.