Windows Performance Monitor Syntax

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Windows Performance Monitor Syntax

Post by slansing »

Did you follow scott's suggestion? I was referring to the service definition located at CCM > Services > "service name" > Service Definition page.

Or from the server's terminal at:

Code: Select all

 /usr/local/nagios/etc/services/<hostname.cfg>
And the service's section within that configuration file.
Pilly170
Posts: 75
Joined: Thu Mar 28, 2013 6:03 am

Re: Windows Performance Monitor Syntax

Post by Pilly170 »

Result from Scotts Test

Code: Select all

COMMAND: /usr/local/nagios/libexec/check_nt -H 10.4.2.63 -s "password" -p 12489 -v COUNTER -l "\\\\MSSQL\\\\\$\$LIVE:Databases\(MPS3\)\\\\Data File\(s\) Size \(KB\)","Size is %.2f %%" -w 80 -c 100 
OUTPUT: Size is 0.00 % | 'Size is %.2f %%'=0.000000%;80.000000;100.000000;
Current Service Definition

Code: Select all

define service {
        host_name                       SQL1
        service_description             MPS Database Size
        use                             xiwizard_windowsserver_nsclient_service
        servicegroups                   Services
        check_command                   check_xi_service_nsclient!password!COUNTER!-l "\MSSQL\$LIVE:Databases(MPS3)\Data File(s) Size (KB)"!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        notifications_enabled           0
        contacts                        myusername
        _xiwizard                       windowsserver
        register                        1
        }
Pilly170
Posts: 75
Joined: Thu Mar 28, 2013 6:03 am

Re: Windows Performance Monitor Syntax

Post by Pilly170 »

I just checked and although it doesn't work in the service gui test option. If I saved and applied config.

It does start graphing.

Code: Select all

-l "\\MSSQL\\$$LIVE:Databases(MPS3)\\Data File(s) Size (KB)","Size is %.2f" -w 75000000-c 80000000
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Windows Performance Monitor Syntax

Post by slansing »

Have you been running it from the Test option in the Web UI? This will not work properly as there are characters which must be escaped and extra "\'s" added. You must run these commands from the command line so that we can get a valid return, then you can add them to the service's definition.
Pilly170
Posts: 75
Joined: Thu Mar 28, 2013 6:03 am

Re: Windows Performance Monitor Syntax

Post by Pilly170 »

Yes, I had.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Windows Performance Monitor Syntax

Post by slansing »

So what is the result of Scott's command when you run it from the command line? Alternatively, are you receiving the correct information from the web ui now that you added it there? "Though this may be incorrect due to what I noted in the last reply."
Pilly170
Posts: 75
Joined: Thu Mar 28, 2013 6:03 am

SOLVED: Windows Performance Monitor Syntax

Post by Pilly170 »

Although it fails in the Test Option in the Web Gui.
That said it does work and outputs data.

So I think this is Solved
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Windows Performance Monitor Syntax

Post by abrist »

Great. Do note the the "test command" function in the XI UI is not nearly as robust as the actual checks or the cli. There are some things that it does not have permission to do and it requires extra escaping.
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.
Locked