NRDS does not report CPU utililzation

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
essrichard
Posts: 24
Joined: Wed Apr 29, 2015 12:10 pm

Re: NRDS does not report CPU utililzation

Post by essrichard »

What can be done to at least get it assigned to somebody?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: NRDS does not report CPU utililzation

Post by tmcdonald »

I can talk to the devs about it, but as I said we don't don't have control over their workflow so all I can do is make the request.
Former Nagios employee
essrichard
Posts: 24
Joined: Wed Apr 29, 2015 12:10 pm

Re: NRDS does not report CPU utililzation

Post by essrichard »

Okay we need this bug fixed. As a paying customer, what can be done to escalate this issue?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: NRDS does not report CPU utililzation

Post by tmcdonald »

I'll be replying to your ticket about the issue shortly.
Former Nagios employee
essrichard
Posts: 24
Joined: Wed Apr 29, 2015 12:10 pm

Re: NRDS does not report CPU utililzation

Post by essrichard »

Okay i wanted to post a workaround to this issue for the benefit of others. It is only a workaround basically because check_pdm.exe simply fails to grab CPU usage, so instead I have found a way to do it with a powershell script. With NRDS, you can put any new .ps1 or .vbs scripts on your Nagios XI server under:
/usr/local/nrdp/plugins/Windows/
Any plugins that are put here will be auto-downloaded by any NRDS agents that passively check in when there is a command/check that requires them in the config. After adding my script file to this directory which was named "cpu_usage.ps1", i just edited my NRDS config and added the command of:

command[CPU_Usage] = $PLUGIN_DIR$\cpu_usage.ps1

Here is the ps1 i created - it even retains historical data in XI due to the "|CPU=$cpu;90;95" portion at the end of each status message":

Code: Select all

$cpu = (Get-WmiObject win32_processor | Measure-Object -property LoadPercentage -Average).Average

if ($cpu -lt 90) {
  Write-Host "OK - CPU usage is at $cpu Percent|CPU=$cpu;90;95"
  exit 0
} elseif ($cpu -ge 90 -and $cpu -lt 95) {
  Write-Host "WARNING - CPU usage is at $cpu Percent|CPU=$cpu;90;95"
  exit 1
} elseif ($cpu -ge 95) {
  Write-Host "CRITICAL - CPU usage is at $cpu Percent|CPU=$cpu;90;95"
  exit 2
} else {
  Write-Host "UNKNOWN - Something has gone wrong with the CPU check"
  exit 3
}
Hope this helps somebody else! NRDS is awesome!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: NRDS does not report CPU utililzation

Post by lmiltchev »

Hope this helps somebody else! NRDS is awesome!
Thanks for sharing, essrichard! I tested the script and it seems to be working fine.
example01.PNG
You do not have the required permissions to view the files attached to this post.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked