cd /usr/local/nagios/libexec
if [ $# -ne 5 ];then
phone=”$1″
passwd=”$2″
sendto=”$3″
msg=”$4″
/usr/local/bin/python /usr/local/fetion/fetion.py “$phone” “$passwd” “$sendto” ”
fi
define command{
command_name notify-service-by-SMS
command_line /usr/local/nagios/libexec/SMS mobile no. password mobile no. “** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **”
}
#’notify-host-by-sms’ command definition
define command{
command_name notify-host-by-SMS
command_line /usr/local/nagios/libexec/SMS mobile no. password mobile no. “** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **”
}
——————————————————–
name generic-contact
service_notification_period 24×7
host_notification_period 24×7
service_notification_options w,u,c,r,f,s
host_notification_options d,u,r,f,s
service_notification_commands notify-service-by-email,notify-service-by-SMS
host_notification_commands notify-host-by-email,notify-host-by-SMS
register 0
}
————————————————————
转载于:https://blog.51cto.com/gnnjw/410731
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/110703.html原文链接:https://javaforall.net