Search code examples
powershellnagios

Powershell - Send passive nagios check


How can I send a passive nagios check in a powershell script? In Batch I do:

<host>\t<svc_description>\t<return_code>\t<plugin_output> | "C:\MyPrograms\send_nsca.exe" -H HOST -C "CONFIG-FILE"


Solution

  • My solution:

    cmd /c 'echo nagios.host nagios.service <STATUS-ID> ' $sNagiosTest ' | "C:\Program Files\nsca\send_nsca.exe" -H host_address -c "C:\Program Files\nsca\send_nsca.cfg"'