Strona 1 z 1

nagios - wysyłanie sms korzystając z bramki

: 24 czerwca 2009, 15:24
autor: speedyexe
Witam, potrzebuję pomocy.
Posiadam Cetreona razem z Nagiosem, mam bramkę sms za którą płace. Chciałbym ją użyć tak by nagios wysyłał sms gdy serwer nie działa.
Poniżej przedstawiam polecenia, które wklejałem do nagiosa w commands ale po tych zabiegach nie mogłem zrestartować nagiosa.
Czy ktoś ma działające skrypty typu nagios i bramka sms.
Proszę o pomoc.

Kod: Zaznacz cały

define command{
command_name notify-host-by-sms
command_line /usr/bin/printf “%.120s” “Nagios – $NOTIFICATIONTYPE$ : Host $HOSTALIAS$ is $HOSTSTATE$ ($OUTPUT$)” |/usr/bin/python /home/mezgani/script/sms.py $CONTACTPAGER$
}

define command{
command_name notify-service-by-sms
command_line /usr/bin/printf “%.120s” “Nagios – $NOTIFICATIONTYPE$ : $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ ($OUTPUT$)” |/usr/bin/python /home/mezgani/script/sms.py $CONTACTPAGER$
}


define command{

command_name service_notify_with_sms
command_line /usr/lib/nagios/plugins/notify_sms -a 1012345 -u myusername_for_gw -p mypassword_for_gw -m \'$NOTIFICATIONTYPE$: $HOSTNAME$ is $SERVICESTATE$ ($SERVICEOUTPUT$)\' -t $CONTACTPAGER$

}

define command{

command_name host_notify_with_sms
command_line /usr/lib/nagios/plugins/notify_sms -a 1012345 -u myusername_for_gw -p mypassword_for_gw -m \'$NOTIFICATIONTYPE$: $HOSTNAME$ is $HOSTSTATE$ ($HOSTOUTPUT$)\' -t $CONTACTPAGER$

}



define command{
command_name notify-host-by-sms
command_line /usr/bin/printf “%.120s” “Nagios – $NOTIFICATIONTYPE$ : Host $HOSTALIAS$ is $HOSTSTATE$ ($OUTPUT$)” |/usr/bin/python /home/mezgani/script/sms.py $CONTACTPAGER$
}

define command{
command_name notify-service-by-sms
command_line /usr/bin/printf “%.120s” “Nagios – $NOTIFICATIONTYPE$ : $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ ($OUTPUT$)” |/usr/bin/python /home/mezgani/script/sms.py $CONTACTPAGER$
}


define command {
command_name notify-service-by-sms
command_line /usr/bin/printf “%.120s” “Nagios – $NOTIFICATIONTYPE$ : $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ ($OUTPUT$)” | /usr/local/bin/gnokii –sendsms $CONTACTPAGER$ -r
}

define command {
command_name notify-host-by-sms
command_line /usr/bin/printf “%.120s” “Nagios – $NOTIFICATIONTYPE$ : Host $HOSTALIAS$ is $HOSTSTATE$ ($OUTPUT$)” | /usr/local/bin/gnokii –sendsms $CONTACTPAGER$ -r
}



#Nagios command obj
# 'host-notify-by-gnokii' command definition
define command{
command_name host-notify-by-gnokii
command_line /opt/nagios/bin/sms_notification_by_gnokki $CONTACTPAGER$ "Nagios Host Alert \n\n $HOSTALIAS$ is $HOSTSTATE$; $OUTPUT$; $DATETIME$"
}