version 1.1, 2009/12/01 04:36:47
|
version 1.2, 2010/08/08 17:18:37
|
Line 84 function checkconnection {
|
Line 84 function checkconnection {
|
function rememberstate { |
function rememberstate { |
# Put a simple time stamp in a tmp file, when host gets down |
# Put a simple time stamp in a tmp file, when host gets down |
if [ -z "$UP" ]; then |
if [ -z "$UP" ]; then |
if [ ! -e "$TMPDIR/.canardien-$PINGHOST-$HOST" ]; then |
if [ ! -e "$TMPDIR/.canardien-$PINGHOST-$HOST" ]; then |
# set time stamp |
# set time stamp |
echo -ne "$TIME_STAMP" > "$TMPDIR/.canardien-$PINGHOST-$HOST" |
echo -ne "$TIME_STAMP" > "$TMPDIR/.canardien-$PINGHOST-$HOST" |
# send alert |
# send alert |
Line 98 function rememberstate {
|
Line 98 function rememberstate {
|
if [ -n "$DEBUG" ]; then |
if [ -n "$DEBUG" ]; then |
shout "$HOST is up again." |
shout "$HOST is up again." |
fi |
fi |
# send alert |
# send alert |
ALERT_SUBJECT="$HOST antwortet wieder!" |
ALERT_SUBJECT="$HOST antwortet wieder!" |
ALERT_TEXT='"[$(date +"%a %e.%m.%y %H:%M:%S")]\n\n\n$HOST is up again.\n--------------------------------------\n(downtime began $(cat "$TMPDIR/.canardien-$PINGHOST-$HOST"))\n\n\n Kind regards, $PINGHOST."' |
ALERT_TEXT='"[$(date +"%a %e.%m.%y %H:%M:%S")]\n\n\n$HOST is up again.\n--------------------------------------\n(downtime began $(cat "$TMPDIR/.canardien-$PINGHOST-$HOST"))\n\n\n Kind regards, $PINGHOST."' |
sendalert |
sendalert |