Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
Directory
schymanski
byschymanski, June 15, 2014
we use this script for multiple lines of output:
define command {
command_name notify-service-by-nrdp
command_line /path/send_nrdp.sh "$HOSTNAME$" "$SERVICEDESC$" $SERVICESTATEID$ "$SERVICEOUTPUT$ $LONGSERVICEOUTPUT$" "$SERVICEPERFDATA$"
}
/path/send_nrdp.sh:
#!/bin/bash
TEST=$(echo "$4 | $5" | sed 's/$/\n/' | tr -d "\r\n" )
/usr/local/nrdp/clients/send_nrdp.php --url=http://1.1.1.1/nrdp --token=xyzterw --host="$1" --service="$2" --state="$3" --output="$TEST"
define command {
command_name notify-service-by-nrdp
command_line /path/send_nrdp.sh "$HOSTNAME$" "$SERVICEDESC$" $SERVICESTATEID$ "$SERVICEOUTPUT$ $LONGSERVICEOUTPUT$" "$SERVICEPERFDATA$"
}
/path/send_nrdp.sh:
#!/bin/bash
TEST=$(echo "$4 | $5" | sed 's/$/\n/' | tr -d "\r\n" )
/usr/local/nrdp/clients/send_nrdp.php --url=http://1.1.1.1/nrdp --token=xyzterw --host="$1" --service="$2" --state="$3" --output="$TEST"