Problem with monitoring Windows 2012 R2 servers

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Problem with monitoring Windows 2012 R2 servers

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
Frédéric GRANAT
Posts: 445
Joined: Mon Nov 19, 2012 11:36 am

Re: Problem with monitoring Windows 2012 R2 servers

Post by Frédéric GRANAT »

[root@nagiosxi nagiosxi]# grep nagios /etc/passwd
nagios:x:20739:500::/home/nagios:/bin/bash
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Problem with monitoring Windows 2012 R2 servers

Post 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'
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Frédéric GRANAT
Posts: 445
Joined: Mon Nov 19, 2012 11:36 am

Re: Problem with monitoring Windows 2012 R2 servers

Post 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)
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Problem with monitoring Windows 2012 R2 servers

Post 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.
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.
Frédéric GRANAT
Posts: 445
Joined: Mon Nov 19, 2012 11:36 am

Re: Problem with monitoring Windows 2012 R2 servers

Post by Frédéric GRANAT »

Here it is
You do not have the required permissions to view the files attached to this post.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Problem with monitoring Windows 2012 R2 servers

Post 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.
Former Nagios employee
Frédéric GRANAT
Posts: 445
Joined: Mon Nov 19, 2012 11:36 am

Re: Problem with monitoring Windows 2012 R2 servers

Post 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
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Problem with monitoring Windows 2012 R2 servers

Post 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.
Former Nagios employee
Frédéric GRANAT
Posts: 445
Joined: Mon Nov 19, 2012 11:36 am

Re: Problem with monitoring Windows 2012 R2 servers

Post 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
You do not have the required permissions to view the files attached to this post.
Locked