Check_Nrpe Powershell Monitor

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
FrontlineIT
Posts: 94
Joined: Tue Jul 26, 2016 8:46 am

Check_Nrpe Powershell Monitor

Post 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
}
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Check_Nrpe Powershell Monitor

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
FrontlineIT
Posts: 94
Joined: Tue Jul 26, 2016 8:46 am

Re: Check_Nrpe Powershell Monitor

Post by FrontlineIT »

Thank you so much! That did it!
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Check_Nrpe Powershell Monitor

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked