Page 2 of 2

Re: Windows Performance Monitor Syntax

Posted: Mon Apr 15, 2013 11:44 am
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.

Re: Windows Performance Monitor Syntax

Posted: Tue Apr 16, 2013 3:04 am
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
        }

Re: Windows Performance Monitor Syntax

Posted: Tue Apr 16, 2013 5:29 am
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

Re: Windows Performance Monitor Syntax

Posted: Tue Apr 16, 2013 10:11 am
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.

Re: Windows Performance Monitor Syntax

Posted: Tue Apr 16, 2013 10:18 am
by Pilly170
Yes, I had.

Re: Windows Performance Monitor Syntax

Posted: Tue Apr 16, 2013 10:44 am
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."

SOLVED: Windows Performance Monitor Syntax

Posted: Wed Apr 17, 2013 3:42 am
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

Re: Windows Performance Monitor Syntax

Posted: Wed Apr 17, 2013 10:53 am
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.