Nagios not able to monitor service monitoring

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
lgaddam
Posts: 116
Joined: Wed Aug 28, 2019 1:01 am

Nagios not able to monitor service monitoring

Post by lgaddam »

Hi Team,

Our Nagios system not able to monitor service monitoring but performance monitoring able to monitor.
Please check screenshot attached. Please help me to resolve the issue.


Remote windows OS version: WIndows 2003 STandard Edition

Below is the command outputs:

[root@01]# /usr/local/nagios/libexec/check_wmi_plus.pl -H 192.168.173.134 -u 'xxxxx' -p 'xxxxxx' -m checkcpu -w '90' -c '95'
OK (Sample Period 279 sec) - Average CPU Utilisation 7.40%|'Avg CPU Utilisation'=7.40%;90;95;

[root@01]# /usr/local/nagios/libexec/check_wmi_plus.pl -H 192.168.173.134 -u 'xxxxx' -p 'xxxxxx' -m checkservice -a "CaptorSchedulerService"
UNKNOWN - The WMI query had problems. The error text from wmic is: [wmi/wmic.c:212:main()] ERROR: Retrieve result data.
NTSTATUS: NT code 0xc002001b - NT code 0xc002001b
[root@01]#


[root@01]#/usr/local/nagios/libexec/check_wmi_plus.pl -H 192.168.173.134 -u 'xxxxx' -p 'xxxxxx' -m checkservice -a "CaptorSchedulerService" -t 120 -d
Command Line (v1.6): /usr/local/nagios/libexec/check_wmi_plus.pl -H 192.168.173.134 -u USER -p PASS -m checkservice -a CaptorSchedulerService -t 120 -d
Base Dir: /usr/local/nagios/libexec
Conf File Dir: /usr/local/nagios/libexec
Loaded Conf File /usr/local/nagios/libexec/check_wmi_plus.conf
Extra Wmic Arguments specified:--option=client ntlmv2 auth=Yes
Round #1 of 1
QUERY: /usr/bin/wmic '--option=client ntlmv2 auth=Yes' '-U' 'USER%PASS' '--namespace' 'root/cimv2' '//192.168.173.134' 'select name, displayname, Started, StartMode, State, Status FROM Win32_Service '

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

Could not find the CLASS: line - an error occurred
WMI DATA:$VAR1 = [];
UNKNOWN - The WMI query had problems. The error text from wmic is: [wmi/wmic.c:212:main()] ERROR: Retrieve result data.
NTSTATUS: NT code 0xc002001b - NT code 0xc002001b
[root@01]#
You do not have the required permissions to view the files attached to this post.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Nagios not able to monitor service monitoring

Post by ssax »

Try running this command in a admin prompt on the Windows system:

Code: Select all

sc sdset SCMANAGER D:(A;;CCLCRPRC;;;AU)(A;;CCLCRPWPRC;;;SY)(A;;KA;;;BA)S:(AU;FA;KA;;;WD)(AU;OIIOFA;GA;;;WD)
Taken from here:

https://support.nagios.com/forum/viewto ... 35&t=31641

Let us know the results.
lgaddam
Posts: 116
Joined: Wed Aug 28, 2019 1:01 am

Re: Nagios not able to monitor service monitoring

Post by lgaddam »

Hi Sean,

Welcome back.

We executed the assisted comamnd in Admin prompt but still its not working. Attached for reference.
When i use the "-d" option at the end 0f the command, its giving "Could not find the CLASS: line - an error occurred", please check.


[root@01]#/usr/local/nagios/libexec/check_wmi_plus.pl -H 192.168.173.134 -u 'xxxxxx' -p 'xxxxxxxx' -m checkservice -a "CaptorSchedulerService" -d
Command Line (v1.6): /usr/local/nagios/libexec/check_wmi_plus.pl -H 192.168.173.134 -u USER -p PASS -m checkservice -a CaptorSchedulerService -t 500 -d
Base Dir: /usr/local/nagios/libexec
Conf File Dir: /usr/local/nagios/libexec
Loaded Conf File /usr/local/nagios/libexec/check_wmi_plus.conf
Extra Wmic Arguments specified:--option=client ntlmv2 auth=Yes
Round #1 of 1
QUERY: /usr/bin/wmic '--option=client ntlmv2 auth=Yes' '-U' 'USER%PASS' '--namespace' 'root/cimv2' '//192.168.173.134' 'select name, displayname, Started, StartMode, State, Status FROM Win32_Service '
OUTPUT: [wmi/wmic.c:212:main()] ERROR: Retrieve result data.
NTSTATUS: NT code 0xc002001b - NT code 0xc002001b

Could not find the CLASS: line - an error occurred
WMI DATA:$VAR1 = [];
UNKNOWN - The WMI query had problems. The error text from wmic is: [wmi/wmic.c:212:main()] ERROR: Retrieve result data.
NTSTATUS: NT code 0xc002001b - NT code 0xc002001b
[root@01]#
You do not have the required permissions to view the files attached to this post.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Nagios not able to monitor service monitoring

Post by ssax »

Thanks!

Are you able to reboot the system? I know the poster said a reboot wasn't required but it might be worth a try.

Try this as well:

First we need to determent the SID of the user wmiagent (substitute your username and SID in each command), from the command prompt enter:

Code: Select all

wmic useraccount where name='wmiagent' get sid
In my output the SID is: S-1-5-21-3412302875-2573218200-1610287713-1007

Now we have the SID, we will use it in the next command to grant the rights to the service control manager. In the following example you will need to replace the SID with the one you obtained from the previous step. From the command prompt enter:

Code: Select all

sc sdset SCMANAGER D:(A;;CCLCRPRC;;;S-1-5-21-3412302875-2573218200-1610287713-1007)(A;;CCLCRPWPRC;;;SY)(A;;KA;;;BA)S:(AU;FA;KA;;;WD)(AU;OIIOFA;GA;;;WD)
Then test, if still failing, try rebooting and see if that picks it up.

If all that doesn't work, please create a ticket for this and include a link back to this forum thread so we can get a remote session setup:

https://support.nagios.com/tickets/
lgaddam
Posts: 116
Joined: Wed Aug 28, 2019 1:01 am

Re: Nagios not able to monitor service monitoring

Post by lgaddam »

Hi Sean,

Windows team got approval for rebooting after performing the steps provided by you.
After reboot, RDP was not working and Apllication services didn't come up normally.
Somehow with lot of troubleshooting, windows team made the application processes up.

Now, I see that all performance monitoring and service monitoring is working fine. They are all OK.

But windows team said to go this procedure will may lead to problems as they don't have microssoft support for 2003 servers.

We are looking to install Nagios agent. Nsclient.
Could you please help me which nsclient version we have to install on 2003 and 2008 servers.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Nagios not able to monitor service monitoring

Post by ssax »

Are you are trying to install the 64 bit version of the NSClient++ on 32 bit Windows Server? If so, try installing the 32 bit version of NSClient++ instead.

Have you tried installing the latest? What errors are you getting?

Based on the info here it looks like you should be able to use the latest version:

Code: Select all

https://www.nsclient.org/nsclient/
lgaddam
Posts: 116
Joined: Wed Aug 28, 2019 1:01 am

Re: Nagios not able to monitor service monitoring

Post by lgaddam »

Okay.I have 32 bit and 64 bit machines aswell.

So, for 2003 ad 2008 servers , latest veriosn of nsclient will work ?
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Nagios not able to monitor service monitoring

Post by ssax »

It looks that way from their supported OS list. Just use the 32 bit if you need it.
lgaddam
Posts: 116
Joined: Wed Aug 28, 2019 1:01 am

Re: Nagios not able to monitor service monitoring

Post by lgaddam »

Hi Sean,

Thanks for the update.
Have a question, how nsclient works in background.
Is nsclient agent is dependent on WMI in collecting OS performance data ?
Or nsclient uses some other way to collect OS performance data.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Nagios not able to monitor service monitoring

Post by ssax »

That I'm not sure of, I don't think it does by default, you can configure it to check WMI:

https://www.claudiokuenzler.com/blog/90 ... pe-windows

Really only the NSClient++ devs would know how their code grabs the info, as we did not write that agent (or maintain the code) you will need to reach out to the nsclient developers for that.

Code: Select all

https://www.nsclient.org/support/
We help with configuration of the client if you use it but we don't control the code. Our agent (NCPA) uses the python psutils module to get that information (which should not use WMI).
Locked