[BACK]Return to alert CVS log [TXT][DIR] Up to [local] / nagios / alert

Diff for /nagios/alert/alert between version 1.3 and 1.4

version 1.3, 2010/02/16 17:18:31 version 1.4, 2010/02/16 17:58:35
Line 1 
Line 1 
 #!/bin/sh  #!/bin/sh
 # $AFresh1: alert,v 1.1 2010/02/16 16:48:01 andrew Exp $  # $AFresh1: alert,v 1.3 2010/02/16 17:18:31 andrew Exp $
 local _type=$1  local _type=$1
 local _method=$2  local _method=$2
 local _contact=$3  local _contact=$3
Line 13 
Line 13 
 fi  fi
   
   
   local _notification=$NAGIOS_NOTIFICATIONTYPE
   if [ X"" != X"$NAGIOS_NOTIFICATIONCOMMENT" ]; then
       _notification="$_notification $NAGIOS_NOTIFICATIONCOMMENT"
   fi
   if [ X"" != X"$NAGIOS_NOTIFICATIONAUTHOR" ]; then
       _notification="$_notification ($NAGIOS_NOTIFICATIONAUTHOR)"
   fi
   
 ### HOST Descriptions ###  ### HOST Descriptions ###
   
 local _short_host="$NAGIOS_HOSTNAME"  local _short_host="$NAGIOS_HOSTNAME"
 local _long_host="Date/Time: $NAGIOS_LONGDATETIME  local _long_host="Date/Time: $NAGIOS_LONGDATETIME
 $NAGIOS_NOTIFICATIONTYPE $NAGIOS_NOTIFICATIONCOMMENT  $_notification
   
 Host: $NAGIOS_HOSTALIAS [$NAGIOS_HOSTADDRESS] ($NAGIOS_HOSTOUTPUT)  Host: $NAGIOS_HOSTALIAS [$NAGIOS_HOSTADDRESS]
 State: $NAGIOS_HOSTSTATE (for $NAGIOS_HOSTDURATION)  State: $NAGIOS_HOSTSTATE (for $NAGIOS_HOSTDURATION)
   $NAGIOS_HOSTOUTPUT
   
 https://stats.redrivernet.com/CGi-bin/nagios/extinfo.cgi?type=1&host=$NAGIOS_HOSTNAME  https://stats.redrivernet.com/CGi-bin/nagios/extinfo.cgi?type=1&host=$NAGIOS_HOSTNAME
 "  "
Line 29 
Line 38 
   
 local _short_svc="$NAGIOS_HOSTNAME $NAGIOS_SERVICEDESC"  local _short_svc="$NAGIOS_HOSTNAME $NAGIOS_SERVICEDESC"
 local _long_svc="Date/Time: $NAGIOS_LONGDATETIME  local _long_svc="Date/Time: $NAGIOS_LONGDATETIME
 $NAGIOS_NOTIFICATIONTYPE $NAGIOS_NOTIFICATIONCOMMENT  $_notification
   
 Service: $NAGIOS_SERVICEDESC ($NAGIOS_SERVICEOUTPUT)  Service: $NAGIOS_SERVICEDESC
 Host: $NAGIOS_HOSTALIAS ($NAGIOS_HOSTADDRESS)  Host: $NAGIOS_HOSTALIAS ($NAGIOS_HOSTADDRESS)
 State: $NAGIOS_HOSTSTATE (for $NAGIOS_HOSTDURATION)  State: $NAGIOS_SERVICESTATE (for $NAGIOS_SERVICEDURATION)
   $NAGIOS_SERVICEOUTPUT
   
 https://stats.redrivernet.com/cgi-bin/nagios/extinfo.cgi?type=2&host=$NAGIOS_HOSTNAME&service=`echo $NAGIOS_SERVICEDESC | sed -e 's/ /+/g'`  https://stats.redrivernet.com/cgi-bin/nagios/extinfo.cgi?type=2&host=$NAGIOS_HOSTNAME&service=`echo $NAGIOS_SERVICEDESC | sed -e 's/ /+/g'`
 "  "
Line 43 
Line 53 
 local _state  local _state
 local _short  local _short
 local _long  local _long
   
 case $_type in  case $_type in
         HOST)          HOST)
         _state=$NAGIOS_HOSTSTATE          _state=$NAGIOS_HOSTSTATE
Line 64 
Line 75 
     _state=$NAGIOS_NOTIFICATIONTYPE      _state=$NAGIOS_NOTIFICATIONTYPE
 fi  fi
   
 _short=$_state: $_short  _short="$_state: $_short"
   _long=`echo "$_long" | awk '{ gsub(/<br *\/?>/,"\n") }1'`
   
 case $_method in  case $_method in
         mail)          mail)

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>