[Openswan Users] How to know when a tunnel is down

samuel_formulaires samuel_formulaires at numlog.fr
Fri May 29 04:07:16 EDT 2009


richard witt a écrit :

>I posted yesterday on what everyone was using to know when a tunnel is
>down. Other than pinging a host on the other end of the tunnel, what
>usually indicates that a tunnel is down? Some of you said you were
>using scripts and such to look at the logs and then perform an
>action/send an alert/etc. Can some of you give some of those examples?
>I am sorry if this all sounds so noobish. 
>  
>
Google : syslog-ng alert...

Example:
# cat /root/scripts/syslog-ng_mail.sh
#!/bin/bash

ADMIN=x at dom.com
SUBJ="Alert ipsec"

while read line; do
echo -e "$HOSTNAME :\n$line" | mail -s $SUBJ $ADMIN
#echo -e "$HOSTNAME :\n$line" | do_what_you_want_with_line()
done

Extracts of syslog-ng.conf :
destination mail_alert { program("/root/scripts/syslog-ng_mail.sh"); };
filter f_ipsec { match ("tunnel down") or match ("tunnel up"); };
log { source(s_all); filter(f_ipsec); destination(mail_alert ); };




More information about the Users mailing list