Page 1 of 1

Check_Nrpe Powershell Monitor

Posted: Wed May 17, 2017 4:16 pm
by FrontlineIT
Currently having trouble getting the results to show up in performance monitor.
This is my powershell script. How can I get the result data to post in perf mon in Nagios XI

$ok = 0
$warning = 1
$critical = 2

$files = (Get-ChildItem $directory | Measure-Object).count;
if ($files -ge $c){
write-host Critical - $files files exists
exit $critical
}
else{
write-host OK - $files files exists
}

Re: Check_Nrpe Powershell Monitor

Posted: Thu May 18, 2017 11:03 am
by tgriep
To get performance data to populate in Nagios, the plugin has to output the data in this format
Status output | Performance data.
The way it works, everything to the left of the pipe "|" is considered status and everything to the right is considered performance data.
Take a look at this link for more details about the output of a plugin.
https://assets.nagios.com/downloads/nag ... fdata.html

You would have to edit your powershell script to output performance data and the link below are the details on the format needed for the performance data output.
https://nagios-plugins.org/doc/guidelines.html#AEN200

Re: Check_Nrpe Powershell Monitor

Posted: Wed Jun 21, 2017 5:20 am
by FrontlineIT
Thank you so much! That did it!

Re: Check_Nrpe Powershell Monitor

Posted: Wed Jun 21, 2017 11:03 am
by tgriep
Your very welcome. I will close the post and lock it up for you. If you have any questions in the future, feel free to open a new post.