Windows Perf Counters with WMI or NCPA

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Windows Perf Counters with WMI or NCPA

Post by Box293 »

Follow this KB article, it shows you how to update check_wmi_plus.pl

https://support.nagios.com/kb/article.php?id=123
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

Re: Windows Perf Counters with WMI or NCPA

Post by vAJ »

NCPA can be done, but the spaces and such in PerfCounter names can be a challenge.

Here's an example of my XI arg for check_xi_ncpa_agent:

Code: Select all

-t 'toketoketoke' -P 5693 -M 'windowscounters/PhysicalDisk(0%20C:)/Avg.%20Disk%20Queue%20Length'
Andrew J. - Do you even grok?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Windows Perf Counters with WMI or NCPA

Post by lmiltchev »

Thank you, vAJ!

@krobertson71, let us know if you have any more questions.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Windows Perf Counters with WMI or NCPA

Post by Box293 »

Thanks for that @vAJ, I've created a KB article that shows how to monitor performance counters with NCPA:

https://support.nagios.com/kb/article.php?id=491

Also updated this one:

https://support.nagios.com/kb/article.php?id=126
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
krobertson71
Posts: 444
Joined: Tue Feb 11, 2014 10:16 pm

Re: Windows Perf Counters with WMI or NCPA

Post by krobertson71 »

Sorry for the very late reply.

This works great. I am hitting a wall with getting back a particular process % of Processor time. How do you specify an Instance in NCPA?

-t 'tokelokeytoker' -P 5693 -M 'windowscounters/Processes(mtxagent.exe)/%2520of%Processor%20time ?? What makes this difficult is if you screw up the syntax you do not get an error back, just an 0c.

Getting closer to the finish line though!

Also /Memory/Pages%2Fsec only returns 0c as well even though there is low paging activity on the remote host.
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

Re: Windows Perf Counters with WMI or NCPA

Post by vAJ »

Best way I've found is to add the counter you need to PerfMon, then copy the counter config out to a text editor of your choice.

Here's a line from said config:

Code: Select all

	<PARAM NAME="Counter00003.Path" VALUE="\Process(chrome)\% User Time"/>
I take the counter path and add it into the api/windowscounters url for the host to test:

Take what the browser rewrites that as and place that in your service check.

Code: Select all

https://host.domain:5693/api/windowscounters/Process(chrome)/%%20User%20Time
Clear as mud, right?
Andrew J. - Do you even grok?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Windows Perf Counters with WMI or NCPA

Post by rkennedy »

Thanks @vAJ!

That's a great way to do it, as the formatting can be a pain at times.

@krobertson71 - let us know if that helps.
Former Nagios Employee
krobertson71
Posts: 444
Joined: Tue Feb 11, 2014 10:16 pm

Re: Windows Perf Counters with WMI or NCPA

Post by krobertson71 »

It's returning a 0 result. I have this perfmon running on the server and it's always above 5% at a min.

Code: Select all

https://vmassetcore01.dcri.int:5693/api/windowscounters/Process(mtxagent)/%%20User%20Time
I get this in the api return:

Code: Select all

{
  "value": {
    "windowscounters": [
      [
        0.0
      ], 
      "% User Time"
    ]
  }
}
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

Re: Windows Perf Counters with WMI or NCPA

Post by vAJ »

Are there multiple mtxagent processes? I've not tried monitoring a process CPU util via NCPA yet. I will test it though.
Andrew J. - Do you even grok?
krobertson71
Posts: 444
Joined: Tue Feb 11, 2014 10:16 pm

Re: Windows Perf Counters with WMI or NCPA

Post by krobertson71 »

No it's just the one process. No multiples.
Locked