Status information is different than command output

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
vendor-support
Posts: 9
Joined: Thu Feb 13, 2014 6:00 pm
Location: Los Angeles
Contact:

Status information is different than command output

Post by vendor-support »

I am trying to check a Windows service using WMI with Nagios XI 2014R1.1.

I added a service check for "Sophos Agent" and the status information under "service details" reads:

OK - Found 0 Services(s), 0 OK and 0 with problems (0 excluded).

However, when I run the command in CCM or via command line it returns what's expected:

COMMAND: /usr/local/nagios/libexec/check_wmi_plus.pl -H x.x.x.x -u 'xxx' -p 'xxx' -m checkservice -a ''\\''Sophos Agent'\\'''
OUTPUT: OK - Found 9 Services(s), 8 OK and 1 with problems (0 excluded). 'Sophos Anti-Virus status reporter' (SAVAdminService) is Running, 'Sophos Anti-Virus' (SAVService) is Running, 'Sophos Agent' (Sophos Agent) is Running, 'Sophos AutoUpdate Service' (Sophos AutoUpdate Service) is Running, 'Sophos Device Control Service' (Sophos Device Control Service) is Running, 'Sophos Message Router' (Sophos Message Router) is Running, 'Sophos Web Control Service' (Sophos Web Control Service) is Running, 'Sophos Web Intelligence Service' (swi_service) is Running, 'Sophos Web Intelligence Update' (swi_update_64) is Stopped.|'Total Service Count'=9; 'Service Count OK State'=8; 'Service Count Problem State'=1; 'Excluded Service Count'=0;


I am not sure what else to check, any help would be greatly appreciated!

Cheers
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Status information is different than command output

Post by tmcdonald »

This could be a problem with escaping the backslashes in the web UI. Can you run the Test Check Command button from the CCM for that service? Also please post a screenshot of the service's page in the CCM.
Former Nagios employee
vendor-support
Posts: 9
Joined: Thu Feb 13, 2014 6:00 pm
Location: Los Angeles
Contact:

Re: Status information is different than command output

Post by vendor-support »

Hi, thanks for the response!

Here is the output to the test check command:
OUTPUT: OK - Found 9 Services(s), 8 OK and 1 with problems (0 excluded). 'Sophos Anti-Virus status reporter' (SAVAdminService) is Running, 'Sophos Anti-Virus' (SAVService) is Running, 'Sophos Agent' (Sophos Agent) is Running, 'Sophos AutoUpdate Service' (Sophos AutoUpdate Service) is Running, 'Sophos Device Control Service' (Sophos Device Control Service) is Running, 'Sophos Message Router' (Sophos Message Router) is Running, 'Sophos Web Control Service' (Sophos Web Control Service) is Running, 'Sophos Web Intelligence Service' (swi_service) is Running, 'Sophos Web Intelligence Update' (swi_update_64) is Stopped.|'Total Service Count'=9; 'Service Count OK State'=8; 'Service Count Problem State'=1; 'Excluded Service Count'=0;

And attached is a screenshot of the service. Could it be an issue that I am using a domain user instead of a local one?
You do not have the required permissions to view the files attached to this post.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Status information is different than command output

Post by abrist »

Could you try running the command from the shell? We need to check if the escaping is correct:

Code: Select all

su - nagios -c "/usr/local/nagios/libexec/check_wmi_plus.pl -H x.x.x.x -u 'xxx' -p 'xxx' -m checkservice -a 'Sophos Agent'"
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
vendor-support
Posts: 9
Joined: Thu Feb 13, 2014 6:00 pm
Location: Los Angeles
Contact:

Re: Status information is different than command output

Post by vendor-support »

Here is the output:

OK - Found 1 Services(s), 1 OK and 0 with problems (0 excluded). 'Sophos Agent' (Sophos Agent) is Running.|'Total Service Count'=1; 'Service Count OK State'=1; 'Service Count Problem State'=0; 'Excluded Service Count'=0;

Please let me know if you need anything else.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Status information is different than command output

Post by lmiltchev »

On the Windows box, what is the actual "Service name" and "Display name" in "Services" (right-click on the service->Properties)? Have you tried using this:

Code: Select all

-a 'Sophos Agent'
instead of this:

Code: Select all

-a ''\\''Sophos Agent'\\'''
Be sure to check out our Knowledgebase for helpful articles and solutions!
vendor-support
Posts: 9
Joined: Thu Feb 13, 2014 6:00 pm
Location: Los Angeles
Contact:

Re: Status information is different than command output

Post by vendor-support »

changing to -a 'Sophos Agent'

OK - Found 1 Services(s), 1 OK and 0 with problems (0 excluded). 'Sophos Agent' (Sophos Agent) is Running.

That's much better thank you! I used the WMI Wizard and added the service that way, I think because I added the ' in the wizard ('Sophos Agent'), it turned out funky like that.

Just curious as to how the initial command got a more detailed summary with all the components of Sophos and this way it just finds the agent?

Again thanks for the help!
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Status information is different than command output

Post by slansing »

I believe with what you were running in the original command, it was matching anything that deals with 'Sophos Agent' now you are checking for only matches of "Sophos Agent" literally. I'll double check and see what the stipulations are for this.
Locked