Page 1 of 1

Setting up my first Nagios Server.

Posted: Mon Jul 21, 2014 12:44 pm
by JoseLopez
Good Afternoon All,

I am new to Nagios and I have been trying to setup a check proof of concepts so that I can then apply it throughout my organization. Currently I have an issue with a Windows 2003 box when trying to pull the IIS Web Server Service info and the SQL Server info via WMI.

This box does have IIS on and publishing a few sites and it does have SQL Express on and working. However I am given the following error for both service checks:

"UNKNOWN - The WMI query had problems. The target host (xxx.xxx.xxx.xxx) might not have the required WMI classes installed. This can happen, for example, if you are trying to checkiis but IIS is not installed. It can also happen if your version of Windows d"

More deatils give the following:

"
[wmi/wmic.c:212:main()] ERROR: Retrieve result data.
NTSTATUS: NT code 0x80041001 - NT code 0x80041001
"

I have multiple different items reporting back with no problems. I followed the setup guide to set this up and I am using an AD Service account that doesn't not have Admin Rights on the box, but does have the appropriate (DCOM, Perfomance Log and Performance Monitor) rights as per the setup guide.

Re: Setting up my first Nagios Server.

Posted: Mon Jul 21, 2014 5:09 pm
by abrist
It could be an issue with the counter, or you may have further restrictions on the IIS services. Could you post the full commands that are failing, and one that works fine?

Re: Setting up my first Nagios Server.

Posted: Mon Jul 21, 2014 5:15 pm
by JoseLopez
I'm new to this, so if you could give me a location of what you want me to be provide I will do it. Just not sure I know what you are asking for, it's the default check done when you run the wizard.

Re: Setting up my first Nagios Server.

Posted: Mon Jul 21, 2014 10:44 pm
by Box293
I've seen this problem, it occurs when you are using a non administrative user. I found the following steps from http://edcint.co.nz/checkwmiplus/?q=con ... owsfromop5 fixed the problem:
Service Control Manager

For op5 Monitor to query a windows server for service information we need to give non-admin users access to the SCM.

First we need to determent the SID of the WMI-user, do this by opening a Command prompt in Windows and enter:

wmic useraccount where name='wmiuser' get sid

You will get the user SID, it will look something like: S-1-5-21-831218587-1591663529-496921927-1002

Now we have to give rights for the wmi-user to access scmanger remotely, run the following command and replace <SID> with the SID you got from the command above.

sc sdset SCMANAGER D:(A;;CCLCRPRC;;;<SID>)(A;;CCLCRPWPRC;;;SY)(A;;KA;;;BA)S:(AU;FA;KA;;;WD)(AU;OIIOFA;GA;;;WD)

Alternativly you can replace <SID> with AU (Authenticated Users) if you don’t want to limit access only to one user.
NOTE: You will need to change wmiuser to wmiagent (or whatever username you chose to create).

Re: Setting up my first Nagios Server.

Posted: Tue Jul 22, 2014 6:39 am
by JoseLopez
You are awesome! It worked right after putting that is. Just a note you do not have to put in the <domain> / <username> just the <username> worked to get the SID (incase anyone sees this in the future).

Issue Resolved!

Thanks!