#!/bin/sh case "$1" in OK) printf "%b" "** $SERVICESTATE$ $SERVICESTATETYPE$ $SERVICEATTEMPT$ **" | mail -s "WARNING State" host1@fake.com ;; WARNING) printf "%b" "** $SERVICESTATE$ $SERVICESTATETYPE$ $SERVICEATTEMPT$ **" | mail -s "WARNING State" host1@fake.com ;; UNKNOWN) printf "%b" "** $SERVICESTATE$ $SERVICESTATETYPE$ $SERVICEATTEMPT$ **" | mail -s "UNKNOWN State" host1@fake.com ;; CRITICAL) case "$2" in SOFT) case "$3" in 1) printf "%b" "** $SERVICESTATE$ $SERVICESTATETYPE$ $SERVICEATTEMPT$ **" | mail -s "CRITICAL - SOFT 1 State" host1@fake.com ;; 2) printf "%b" "** $SERVICESTATE$ $SERVICESTATETYPE$ $SERVICEATTEMPT$ **" | mail -s "CRITICAL - SOFT 2 State" host1@fake.com ;; 3) printf "%b" "** $SERVICESTATE$ $SERVICESTATETYPE$ $SERVICEATTEMPT$ **" | mail -s "CRITICAL - SOFT 3 State" host1@fake.com ;; esac ;; HARD) printf "%b" "** $SERVICESTATE$ $SERVICESTATETYPE$ $SERVICEATTEMPT$ **" | mail -s "CRITICAL - HARD State" host1@fake.com ;; esac ;; esac exit 0