Windows Performance Counters - Best Practices for Nagios?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
mocjack
Posts: 31
Joined: Fri Dec 17, 2010 10:06 am

Windows Performance Counters - Best Practices for Nagios?

Post by mocjack »

Is there a special document or helpfile on gathering Windows server performance counters? I notice there are few templates, and when I try to use the ones in the Windows Server Wizard as templates, I always fail. Right now I have a specific need to monitor the transaction log of a database on a MSSQL server?

I am running Nagios XI version 1.3G under CentOS. My remote Windows Servers all have NSCLient++ - 0.3.8.75 2010-05-27. It seems to do the job for most other things.

This is the specific performance counter I want to gather and alert on:

Image


Here is the configuration screen for the service:

Image

The command line I use above is cut off, so here is the full thing:

-l "\\SQLServer:Databases(BPM_Engine_PRD)\\Log File(s) Size (KB) %.f","BPM Production Transaction Log Size in KB is %.f" -w 1000 -c 3000

I notice in my NSCLIENT logs on the Windows server the following errors:

--
2011-01-27 11:23:47: error:modules\CheckSystem\CheckSystem.cpp:1084: ERROR: Counter not found: \SQLServer:Databases\BPM_Engine_PRD\Log File(s) Size (KB): The specified instance is not present. (800007D1)
2011-01-27 11:23:47: error:modules\CheckSystem\CheckSystem.cpp:1113: ERROR: \SQLServer:Databases\BPM_Engine_PRD\Log File(s) Size (KB): PdhAddCounter failed: Unable to parse the counter path. Check the format and syntax of the specified path. (C0000BC0) (\SQLServer:Databases\BPM_Engine_PRD\Log File(s) Size (KB)|\SQLServer:Databases\BPM_Engine_PRD\Log File(s) Size (KB))
2011-01-27 11:33:07: error:modules\CheckSystem\CheckSystem.cpp:1082: ERROR: Counter not found: \SQLServer:Databases\BPM_Engine_PRD\Log File(s) Size (KB): The specified instance is not present.
--


Can someone walk me step by step what I am doing wrong? This would clear up alot of issues for us and allow me to move forward with alot of other performance counters.

I have tried posting this on the general forum but I was not able to get it working.

Thanks in advance!

-Jack
rdedon
Posts: 578
Joined: Sat Nov 20, 2010 4:51 pm

Re: Windows Performance Counters - Best Practices for Nagios

Post by rdedon »

Lets try a few things here.

Code: Select all

-l '\\SQLServer:Databases(BPM_Engine_PRD)\\Log File(s) Size (KB) %.f","BPM Production Transaction Log Size in KB is %.f' -w 1000 -c 3000
I see that \\Log File may have an extra "\" unless this intentional and is the directory structure.



because of spaces as a single argument it could be causing a problem the whole thing may need to be wrapped in 'single-quotes' as in:

Code: Select all

-l '\\SQLServer:Databases(BPM_Engine_PRD)\Log File(s) Size (KB) %.f","BPM Production Transaction Log Size in KB is %.f' -w 1000 -c 3000
otherwise go to plugins directory /usr/local/nagios/libexec
and run

Code: Select all

./check_nt -H
and see what we can come up with
Rene deDon
Technical Team
___
Nagios Enterprises, LLC
Web: http://www.nagios.com
tonyyarusso
Posts: 1128
Joined: Wed Mar 03, 2010 12:38 pm
Location: St. Paul, MN, USA
Contact:

Re: Windows Performance Counters - Best Practices for Nagios

Post by tonyyarusso »

Some other possibilities:

Try removing the %.f on the first part, making it

Code: Select all

-l "\\SQLServer:Databases(BPM_Engine_PRD)\\Log File(s) Size (KB)","BPM Production Transaction Log Size in KB is %.f" -w 1000 -c 3000
Try escaping the colon, making it

Code: Select all

-l "\\SQLServer\:Databases(BPM_Engine_PRD)\\Log File(s) Size (KB) %.f","BPM Production Transaction Log Size in KB is %.f" -w 1000 -c 3000
Then try doing both of the above together, for

Code: Select all

-l "\\SQLServer\:Databases(BPM_Engine_PRD)\\Log File(s) Size (KB)","BPM Production Transaction Log Size in KB is %.f" -w 1000 -c 3000
Tony Yarusso
Technical Services
___
TIES
Web: http://ties.k12.mn.us/
mocjack
Posts: 31
Joined: Fri Dec 17, 2010 10:06 am

Re: Windows Performance Counters - Best Practices for Nagios

Post by mocjack »

Tony,

Your third suggestion did the trick. Everything is running perfectly now. Much appreciated guys!

-Jack
tonyyarusso
Posts: 1128
Joined: Wed Mar 03, 2010 12:38 pm
Location: St. Paul, MN, USA
Contact:

Re: Windows Performance Counters - Best Practices for Nagios

Post by tonyyarusso »

Excellent!
Tony Yarusso
Technical Services
___
TIES
Web: http://ties.k12.mn.us/
mocjack
Posts: 31
Joined: Fri Dec 17, 2010 10:06 am

Re: Windows Performance Counters - Best Practices for Nagios

Post by mocjack »

Well I am back in the same boat...seems very confusing to set up various normal performance counters offered by applications. I have one for Lotus Notes that I need to monitor. The counter reports a value of 252+ in windows performance monitor, but in Nagios I always get a "0".

Here is the counter:

Image

Here is what I have typed in Nagios for the check...

-l "\\Lotus Notes\\:Notes Statistics\\Replica.Cluster.Failed","Replica.Cluster.Failed is %.f" -w 3 -c 6000000

Can anyone assist? Or, does someone have a PDF somewhere that makes recommendations on how to set up W200X performance counters more easily?

-Jack
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Windows Performance Counters - Best Practices for Nagios

Post by Box293 »

Hi mocjack,
I think your command should be formatted like this:

-l "\\Lotus Notes(Replica.Cluster.Failed)\\Notes Statistics","Replica.Cluster.Failed is %.f" -w 3 -c 6000000
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
mocjack
Posts: 31
Joined: Fri Dec 17, 2010 10:06 am

Re: Windows Performance Counters - Best Practices for Nagios

Post by mocjack »

Well that didn't work :cry:

I still get returned a 0 from Nagios even though performance monitor now shows the value over 400.
rdedon
Posts: 578
Joined: Sat Nov 20, 2010 4:51 pm

Re: Windows Performance Counters - Best Practices for Nagios

Post by rdedon »

I have downgraded this from "completed" to "ongoing problem" and will do some research on this.
Rene deDon
Technical Team
___
Nagios Enterprises, LLC
Web: http://www.nagios.com
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Windows Performance Counters - Best Practices for Nagios

Post by Box293 »

I do have access to a Lotus Notes server however it is not in a network with a Nagios monitoring server that I can test.

I might be going over something twice but I want to use pictures to show what I am seeing.

Using Perfmon, add the counter, right click it down the bottom and select properties.
01.png
Here you can see that this is the correct format that the counter needs to be typed, you just need to make sure all the backslash's are double.
02.png
The strange thing is when I was adding the counter to perfmon, it did not show each instance in the instances list, I had to add <All Instances>.
03.png
One last suggestion, double check that the spelling is correct.
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked