Nagwin is capable of processing external commands issued by other applications, allowing to monitor systems via passive checks rather than issuing active checks.
- Create the bash script below in the bin directory (send_extcmd as example):
#!/bin/sh # A shell script to submit an external command to Nagwin. # # Parameters: # external command and its parameters. Example: # PROCESS_HOST_CHECK_RESULT;host1;0;Host appears to be UP now=`date +%s` /bin/printf " $1\n" $now > $commandfile |
A full listing of external commands that can be used can be found here.
Examples:
- Host A is UP:
send_extcmd "PROCESS_HOST_CHECK_RESULT;hosta;0;Host A is UP"
- Service A on Host B is working properly:
send_extcmd "PROCESS_SERVICE_CHECK_RESULT;hosta;servicea;0;OK - Service A is working properly."
- Send a set of of external commands in a file:
send_extcmd "PROCESS_FILE;/tmp/morecommands.cmd;0"