Page 1 of 1

Update unit for Windows PerfMon counters

Posted: Thu Nov 28, 2019 2:49 am
by mouch
Hi Nagios Community,

I've been struggling for few days already trying to fix a non critical but annoying issue I'm facing with services that are checking windows PerfMon counters.

I started to use them following the example that is included in the Windows Server Monitoring Wizard.
In this wizard, we can pick for example the Server Work Queue - right after its creation, the service is returning data (aligned with the server counter, good) but I cannot find a way to update the unit of the result.

It is always displayed as a % where I would like to change it to whatever I need (time, B, count, whatever). Do you know how to achieve this?


Please find below few pictures of the test service I created from the Windows Server Configuration Wizard

Performance Chart - not showing data as this is a new service but still trying to display % only
Image

Run test service command
Image


Thanks for your time and support on this!

Re: Update unit for Windows PerfMon counters

Posted: Mon Dec 02, 2019 3:42 pm
by cdienger
The images didn't make it through. Please try attaching them again.

Re: Update unit for Windows PerfMon counters

Posted: Mon Dec 16, 2019 5:03 am
by mouch
Hello cdienger,


Here is the output when running the test command

Code: Select all

Current work queue (an indication of processing load) is 0  | 'Current work queue (an indication of processing load) is %.f '=0.000000%;4.000000;7.000000;
We can already see here the % (whereas it should have no unit)

And here is the graph outputted (hopefully that time you will see the picture)
https://imgur.com/4DqRKCK


Thanks for your support


Edit: I removed the img balise, it seems like the link is working but I cannot get it rendered with the balise. You will have to copy the URL if you want to view the picture

Re: Update unit for Windows PerfMon counters

Posted: Mon Dec 16, 2019 5:32 pm
by ssax
Change the command from:

Code: Select all

-l "\\Server Work Queues(0)\\Queue Length","Current work queue (an indication of processing load) is %.f "
To:

Code: Select all

-l "\\Server Work Queues(0)\\Queue Length","Current work queue (an indication of processing load) is","YOURUNIT"
Does that work for you?

Re: Update unit for Windows PerfMon counters

Posted: Tue Dec 17, 2019 6:48 am
by mouch
Hi ssax and thanks for your reply.
Unfortunatly, adding the unit with your propose formatting is not changing anything (whatever unit I choose (tried X,s,ms))

See below my service testing output

Code: Select all

[XXX]$ /usr/local/nagios/libexec/check_nt -H YYY -s ZZZ -p 12489 -v COUNTER -l "\\Server Work Queues(0)\\Queue Length","Current work queue (an indication of processing load) is %.f ","ms" -w 4 -c 7 
Current work queue (an indication of processing load) is 0  | 'Current work queue (an indication of processing load) is %.f '=0.000000%;4.000000;7.000000;

Update:

I removed the %.f as you suggested - did not notice this change at first sight
The output is now OK with unit update!

Code: Select all

Current work queue (an indication of processing load) is  = 0.00 COUNT | 'Current work queue (an indication of processing load) is '=0.000000COUNT;4.000000;7.000000;
The graph also is updated. Thanks for your support on this one

Re: Update unit for Windows PerfMon counters

Posted: Tue Dec 17, 2019 7:37 am
by scottwilkerson
mouch wrote:Hi ssax and thanks for your reply.
Unfortunatly, adding the unit with your propose formatting is not changing anything (whatever unit I choose (tried X,s,ms))

See below my service testing output

Code: Select all

[XXX]$ /usr/local/nagios/libexec/check_nt -H YYY -s ZZZ -p 12489 -v COUNTER -l "\\Server Work Queues(0)\\Queue Length","Current work queue (an indication of processing load) is %.f ","ms" -w 4 -c 7 
Current work queue (an indication of processing load) is 0  | 'Current work queue (an indication of processing load) is %.f '=0.000000%;4.000000;7.000000;

Update:

I removed the %.f as you suggested - did not notice this change at first sight
The output is now OK with unit update!

Code: Select all

Current work queue (an indication of processing load) is  = 0.00 COUNT | 'Current work queue (an indication of processing load) is '=0.000000COUNT;4.000000;7.000000;
The graph also is updated. Thanks for your support on this one
Great!

Locking thread