#!/bin/bash
cmdfile=/opt/nagios/var/rw/nagios.cmd

if [ $3 != OK ]
then
# submit comment
echo "["`date +%s`"] ADD_SVC_COMMENT;$2;$1;0;Eventhandler;Service checks disabled because an error state occured. Resolve error, and re-enable manually" >> $cmdfile
# Disable checks
echo "["`date +%s`"] DISABLE_SVC_CHECK;$2;$1" >> $cmdfile
fi
