Windows Performance Monitor Syntax

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Pilly170
Posts: 75
Joined: Thu Mar 28, 2013 6:03 am

Windows Performance Monitor Syntax

Post by Pilly170 »

Hi,

I am trying to get a windows performance monitor
Image

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?
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 »

In addition to the added "\'s" you may need to double the dollar signs like so:

Code: Select all

$$
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!
Pilly170
Posts: 75
Joined: Thu Mar 28, 2013 6:03 am

Re: Windows Performance Monitor Syntax

Post 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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Windows Performance Monitor Syntax

Post 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\)"
Be sure to check out our Knowledgebase for helpful articles and solutions!
Pilly170
Posts: 75
Joined: Thu Mar 28, 2013 6:03 am

Re: Windows Performance Monitor Syntax

Post 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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Windows Performance Monitor Syntax

Post 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\)"
Be sure to check out our Knowledgebase for helpful articles and solutions!
Pilly170
Posts: 75
Joined: Thu Mar 28, 2013 6:03 am

Re: Windows Performance Monitor Syntax

Post 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)
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Windows Performance Monitor Syntax

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
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 »

Can you show us what you now have in your service definition?
Pilly170
Posts: 75
Joined: Thu Mar 28, 2013 6:03 am

Re: Windows Performance Monitor Syntax

Post 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
Locked