Combining Powershell script with NRPE and returning results

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
dlukinski
Posts: 1130
Joined: Tue Oct 06, 2015 9:42 am

Combining Powershell script with NRPE and returning results

Post by dlukinski »

Hello XI support

I see similar (but not same) question in Forum from April.

General idea: Checking Web-portals with powershell script(s) launched from NRPE and returning results to XI.
(specifically MsOffice online portals, where re-directs is a disaster while powershell modules for their verification already exist)

Question1: say i have my Office365.ps1 script to run (how to configure it with NRPE)

Question2: say it has to produce result similar to this one:
Name Status Authentication
---- ------ --------------
litwareinc.onmicrosoft.com Verified Managed
- how to interpret one as "Verified" at XI end?


Thank you
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Combining Powershell script with NRPE and returning resu

Post by rkennedy »

You would need to create a powershell wrapper script, that checks if 'verify' exists in the output data (from Office365.ps1), and if it does then 'exit 0' (OK status), if it doesn't, then have the powershell script 'exit 2' (CRITICAL status).

Nagios decides what the status of a service is based off of the exit codes. The text that gets echoed could say anything.
Former Nagios Employee
dlukinski
Posts: 1130
Joined: Tue Oct 06, 2015 9:42 am

Re: Combining Powershell script with NRPE and returning resu

Post by dlukinski »

rkennedy wrote:You would need to create a powershell wrapper script, that checks if 'verify' exists in the output data (from Office365.ps1), and if it does then 'exit 0' (OK status), if it doesn't, then have the powershell script 'exit 2' (CRITICAL status).

Nagios decides what the status of a service is based off of the exit codes. The text that gets echoed could say anything.
Please close this one. Did not go this route.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Combining Powershell script with NRPE and returning resu

Post by rkennedy »

Will do.

/closed
Former Nagios Employee
Locked