Page 3 of 9

Re: Problem with monitoring Windows 2012 R2 servers

Posted: Fri Aug 08, 2014 10:26 am
by lmiltchev
Hm-m, the permissions look right. It's very strange that you are getting this error:

Code: Select all

su: warning: cannot change directory to /home/nagios: Permission denied
-bash: /home/nagios/.bash_profile: Permission denied
Can you post the output of the following command?

Code: Select all

grep nagios /etc/passwd

Re: Problem with monitoring Windows 2012 R2 servers

Posted: Mon Aug 11, 2014 1:46 am
by Frédéric GRANAT
[root@nagiosxi nagiosxi]# grep nagios /etc/passwd
nagios:x:20739:500::/home/nagios:/bin/bash

Re: Problem with monitoring Windows 2012 R2 servers

Posted: Mon Aug 11, 2014 10:07 am
by scottwilkerson
Actually the permissions in the /home/nagios directory are not correct...

Run

Code: Select all

chown -R nagios /home/nagios
Then lets try this again

Code: Select all

su -l nagios -c '/usr/local/nagios/libexec/check_wmi_plus.pl -H server -u user -p pwd -m checkcpu -w 80 -c 90'

Re: Problem with monitoring Windows 2012 R2 servers

Posted: Tue Aug 12, 2014 4:18 am
by Frédéric GRANAT
Hi
chown -R nagios /home/nagios is done.

[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)

Re: Problem with monitoring Windows 2012 R2 servers

Posted: Tue Aug 12, 2014 4:44 pm
by sreinhardt
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:

Code: Select all

ls -lartd /tmp >> /tmp/tmpfileperms.txt
ls -lart /tmp >>  /tmp/tmpfileperms.txt
and send us the resulting file /tmp/tmpfileperms.txt please.

Re: Problem with monitoring Windows 2012 R2 servers

Posted: Wed Aug 13, 2014 4:31 am
by Frédéric GRANAT
Here it is

Re: Problem with monitoring Windows 2012 R2 servers

Posted: Wed Aug 13, 2014 5:12 pm
by tmcdonald
Could be because the file it is trying to write already exists? Try removing

Code: Select all

cwpss_checkcpu_wsapp29web___.state
cwpss_checkcpu_WSAPP29WEB___.state
from /tmp. This makes sense due to their being owned by root and the permissions.

Re: Problem with monitoring Windows 2012 R2 servers

Posted: Thu Aug 14, 2014 3:47 am
by Frédéric GRANAT
Hi,
I did it and I still have my alert on CPU in nagiosxi (whereas running check_wmi_plus returns no alert).

Regards,

Frederic

Re: Problem with monitoring Windows 2012 R2 servers

Posted: Thu Aug 14, 2014 5:00 pm
by tmcdonald
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.

Re: Problem with monitoring Windows 2012 R2 servers

Posted: Mon Dec 29, 2014 6:03 am
by Frédéric GRANAT
Hi,
Here is the screenshot.
Still have the problem on 3 servers (always the same).
I add this is not specific to 2012 servers.

Rgds,

Frederic