Page 1 of 2
Windows Performance Monitor Syntax
Posted: Thu Apr 11, 2013 3:22 am
by Pilly170
Hi,
I am trying to get a windows performance monitor
Using:
$USER1$/check_nt -H $HOSTADDRESS$ -s "$ARG1$" -p 12489 -v $ARG2$ $ARG3$ $ARG4$
Arg1 = NSClient Password
Arg2 = COUNTER
Arg3 = -l "\\MSSQL$LIVE:Databases(MPS3)\\Data File(s) Size (KB)","Size is %.2f %%" -w 90 -c 100
I keep getting 0, then I know from the performance monitor is around 79gb.
Ive tried command line variations on this
/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)"
/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\)"
Any ideas why this returns nothing?
Re: Windows Performance Monitor Syntax
Posted: Thu Apr 11, 2013 9:37 am
by slansing
In addition to the added "\'s" you may need to double the dollar signs like so:
Then run the command from the command line first to ensure it works, rather than making configuration changes which take longer. Let us know the results!
Re: Windows Performance Monitor Syntax
Posted: Thu Apr 11, 2013 9:48 am
by Pilly170
Tried
/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)"
/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\)"
both returned 0
Re: Windows Performance Monitor Syntax
Posted: Thu Apr 11, 2013 1:34 pm
by lmiltchev
What about this one?
Code: Select all
/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\)"
Re: Windows Performance Monitor Syntax
Posted: Fri Apr 12, 2013 7:27 am
by Pilly170
I tried exactly what you wrote
/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\)"
result : 0
Re: Windows Performance Monitor Syntax
Posted: Fri Apr 12, 2013 3:32 pm
by lmiltchev
The "\\$$" worked for many users. I am not sure why it's not working in your case but I am pretty sure it's an escaping issue. You will have to play around and try different options. We can't test this in house, but you may try:
Code: Select all
/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)"
or
Code: Select all
/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\)"
Re: Windows Performance Monitor Syntax
Posted: Mon Apr 15, 2013 4:43 am
by Pilly170
The first example worked in the command line
Code: Select all
[root@nagios ~]# /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)"
71163900
but when I copied
-l "\MSSQL\$LIVE:Databases(MPS3)\Data File(s) Size (KB)","Size is %.2f %%" -w 80 -c 100
into the service ($ARG3$)
I get
NSClient - ERROR: Failed to get counter value: MSSQL:Databases(MPS3)Data File(s) Size (KB)
Re: Windows Performance Monitor Syntax
Posted: Mon Apr 15, 2013 10:26 am
by scottwilkerson
Try making your $ARG3$
Code: Select all
-l "\\MSSQL\\$$LIVE:Databases(MPS3)\\Data File(s) Size (KB)","Size is %.2f %%" -w 80 -c 100
Re: Windows Performance Monitor Syntax
Posted: Mon Apr 15, 2013 10:27 am
by slansing
Can you show us what you now have in your service definition?
Re: Windows Performance Monitor Syntax
Posted: Mon Apr 15, 2013 11:26 am
by Pilly170
Not sure how I get the definition from the XI version.
I can get /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\)"
but I think you are looking for the actual declaration within the core