#!/bin/bash hostname=$1 state=$2 type=$3 retry=$(echo $4 | sed 's/\$//') minretry=1 debug=0 if [ $debug -eq 1 ]; then echo $hostname >> /tmp/$1 echo $state >> /tmp/$1 echo $type >> /tmp/$1 echo $retry >> /tmp/$1 fi if [[ "$state" == "CRITICAL" && "$type" == "SOFT" ]] then if [[ "$retry" -gt "$minretry" ]] then /usr/local/nagios/libexec/check_nrpe -t 30 -H $1 -c evt_postfix else echo "less or equal 1" >> /tmp/$1 fi else echo "not critical or not soft" >> /tmp/$1 fi