Powershell - 发送被动nagios检查

时间:2015-12-14 13:58:56

标签: powershell nagios

如何在powershell脚本中发送被动nagios检查?在批处理中我做:

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

1 个答案:

答案 0 :(得分:0)

我的解决方案:

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"'