So, I converted all my Windows servers over to NCPA, YAY!! I wrote a new plugin using powershell and this is the bottom of the code:
Code: Select all
if ( ( $days -ge $threshold ) ) {
$returnString = "CRITICAL: " + $days + " since last update"
$returnState = $returnStateCritical
} else {
$returnString = "OK: " + $days + " since last update"
$returnState = $returnStateOK
}
Write-Host $returnString
exit $returnState
No matter what happens though, NCPA is saying it is OK. Example here:
Screenshot 2021-09-21 130624.jpg
I even went on this host, modified the .ps1 to "exit 2" and NCPA still shows the above screenshot.
My Config for ps1 files in NCPA is the default settings. Any idea why this isn't returning the exit code as desired?
You do not have the required permissions to view the files attached to this post.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at
BanditBBS - Also check out my Nagios stuff on my personal page at
Bandit's Home and at
github