--boundary-line
Content-Type: text/plain
$NAGIOS_NOTIFICATIONTYPE $NAGIOS_SERVICEDESC $NAGIOS_SERVICESTATE
$NAGIOS_LONGDATETIME
--- Service information --------------------------
Service desccription $NAGIOS_SERVICEDESC
Service state $NAGIOS_SERVICESTATE
State type $NAGIOS_SERVICESTATETYPE
Service output $NAGIOS_SERVICEOUTPUT
Check command $NAGIOS_SERVICECHECKCOMMAND
Execution time $NAGIOS_SERVICEEXECUTIONTIME
--- Service URLs ---------------------------------
Service details $NAGIOS_URL/cgi-bin/extinfo.cgi?type=2&host=$NAGIOS_HOSTNAME&service=$NAGIOS_SERVICEDESC
Service alert history $NAGIOS_URL/cgi-bin/history.cgi?host=$NAGIOS_HOSTNAME&service=$NAGIOS_SERVICEDESC
Service availability $NAGIOS_URL/cgi-bin/avail.cgi?host=$NAGIOS_HOSTNAME&&service=$NAGIOS_SERVICEDESC&show_log_entries
--- Host information -----------------------------
Hostname $NAGIOS_HOSTNAME
Hostalias $NAGIOS_HOSTALIAS
IP address $NAGIOS_HOSTADDRESS
--- Host URLs ------------------------------------
Host details $NAGIOS_URL/cgi-bin/extinfo.cgi?type=1&host=$NAGIOS_HOSTNAME
Host services $NAGIOS_URL/cgi-bin/status.cgi?host=$NAGIOS_HOSTNAME
Host alert history $NAGIOS_URL/cgi-bin/history.cgi?host=$NAGIOS_HOSTNAME
Host availability $NAGIOS_URL/cgi-bin/avail.cgi?host=$NAGIOS_HOSTNAME&show_log_entries
--- Contact information --------------------------
Contact name $NAGIOS_CONTACTNAME
Contact alias $NAGIOS_CONTACTALIAS
Mail address $NAGIOS_CONTACTEMAIL
Notification type $NAGIOS_NOTIFICATIONTYPE
--boundary-line
EOF2
f
#--- 2. LONGSERVICEOUTPUT available? put it into HTML MIME attachment and send it
#cat "$MAIL_ATTACHMENT_TXT" | $MAILBIN
RC=$? # catch RC
#
#--- 4. cleanup if everything ok, in case of error files will remain for debugging
if [ $RC -eq 0 ]; then
#rm -f "$MAIL_ATTACHMENT_TXT"
rm -f /tmp/check_multi/${MYSELF}-*$$
fi
echo "`date` $NAGIOS_HOSTNAME.$NAGIOS_SERVICEDESC $NAGIOS_NOTIFICATIONTYPE: Service $NAGIOS_HOSTNAME/$NAGIOS_SERVICEDESC is $NAGIOS_SERVICESTATE to $NAGIOS_CONTACTEMAIL: RC $RC" >> /$NAGIOSDIR/var/$MYSELF.log