Page 1 of 2
Getting Windows Performance counters "just right"
Posted: Thu Jan 27, 2011 12:52 pm
by mocjack
I am running Nagios XI on CentOS 64bit and using NSCLIENT++ to monitor my windows servers.
I have one SQL server in which I need to monitor the transaction log size for a database, so I wanted to use the simple performance counter Windows has for this.
My command line in my service check is as follows:
-l "\\SQLServer:Databases\\BPM_Engine_PRD\\Log File(s) Size (KB)","Current BPM Transaction Log File is %.f" -w 2000000 -c 3000000
I check manually in explorer and the transaction log is currently 512MB.
When I run the check the rule in Nagios all I ever git is "Current BPM Transaction Log File is 0"
Can anyone look at this particular check and see what I am doing wrong?
Thanks to anyone in advance!
-Jack
Re: Getting Windows Performance counters "just right"
Posted: Fri Jan 28, 2011 10:16 am
by mocjack
I have tried a couple new options... changing the %.f options but still no luck. Can anyone pls help with this one?
Thanks in advance!
Re: Getting Windows Performance counters "just right"
Posted: Fri Jan 28, 2011 3:10 pm
by rdedon
Hello,
What version of NSClient++ are you running and also is it running the systray? (the latter can cause problems and some of the older version can be somewhat problematic)
Re: Getting Windows Performance counters "just right"
Posted: Mon Jan 31, 2011 8:13 am
by mocjack
Hi thanks for the reply!
I am running NSCLient++ - 0.3.8.75. It is NOT running in the systray on this machine.
Hope this helps. Frustrating issue.
Re: Getting Windows Performance counters "just right"
Posted: Wed Feb 02, 2011 5:16 pm
by rdedon
Hmm, that "should" be working from what you had posted previously. You may have to check with the guys over at NSCLient++ as they will likely have some better insight or know of such an issue from previous people.
http://nsclient.org/nscp/discussion/forum/1
I will do some digging around as well.
Re: Getting Windows Performance counters "just right"
Posted: Wed Feb 02, 2011 6:32 pm
by Box293
Try the version 0.3.9.
I had a similar issue. I was already using 0.3.7 and I tried 0.3.8 on a couple of machines. The output wasn't the same and when I updated to 0.3.9 it seemed to fix my problem.
For example you can see how the same check on two different hosts produced different output.
0.3.7
./check_nrpe -H 172.30.249.6 -t 30 -c CheckCounter -a "Counter=\\Terminal Services\\Active Sessions" Averages=false ShowAll
OK: \Terminal Services\Active Sessions: 1|'\Terminal Services\Active Sessions'=1;0;0;
0.3.9
./check_nrpe -H 172.30.249.7 -t 30 -c CheckCounter -a "Counter=\\Terminal Services\\Active Sessions" Averages=false ShowAll
OK: \Terminal Services\Active Sessions: 2
Re: Getting Windows Performance counters "just right"
Posted: Wed Feb 16, 2011 1:13 am
by sandyspatil
Edit your NSC.ini file in NSClient++ dir. and enable the following parameter ->
allow_nasty_meta_chars=1
And restart the NSClient++ service.
Re: Getting Windows Performance counters "just right"
Posted: Wed Feb 16, 2011 11:20 am
by rdedon
Thank you both for the suggestions!

Re: Getting Windows Performance counters "just right"
Posted: Tue Feb 22, 2011 9:21 am
by mocjack
Still cannot get it to work. For reference, the counter I am trying to get is SQL Server:Databases - [database name] Log File(s) Size (KB)
I used the Windows Server Monitoring Wizard to create the service check. No matter what I do, it still returns a "0" as the result, even though the logfile is many gigabytes in size.
Here is the actual counter from perfmon:
Here is a screenshot of my configuration screen for the service:
My actual $ARG3$ which is cut off in the image is -l "\\SQLServer:Databases(BPM_Engine_PRD)\\Log File(s) Size (KB) %.f","BPM Production Transaction Log Size in KB is %.f" -w 10 -c 30
Does anyone have any clues as to what I should do?
Thanks in advance.
Re: Getting Windows Performance counters "just right"
Posted: Wed Feb 23, 2011 2:34 am
by sandyspatil
I used this ->
./check_nrpe -H mssqlserver -t 30 -c CheckCounter -a "Counter=\SQLServer:Databases(dbase_name)\Log File(s) Used Size (KB)" ShowAll
-> OK: \SQLServer:Databases(dbase_name)\Log File(s) Used Size (KB): 990
and it work's for me displaying the actual log file size.