CentOS under Nagios alarm fetion deployment Four steps away
Today help a group of brothers with the next Nagios on the fetion, this thing I personally feel is very practical, but for a long time did not match, today configured again, by the way the process recorded down, for everyone to learn!!!
First, install the Fetion
Cd/root/tools
wget http://ebook.elain.org/tools/fetion20101205.tar.gz
The installation step is slightly, the package has
Add the phone number to receive the alarm SMS as Fetion friend
/usr/local/fetion/fetion--mobile=137xxxxxxxx--pwd=1111111--to=138xxxxxxxx--msg-type=1--msg-utf8= "the Fetion test is OK "
Note: The first time to enter a verification code, generate a verification code, another terminal to download the picture, open the view, pay attention to case-sensitive!!!
Second, vi commands.cfg add
Define Command{
Command_name notify-host-by-fetion
Command_line/usr/local/fetion/fetion--mobile=137xxxxxxxx--pwd=1111111--to=138xxxxxxxx--msg-type=1--msg-utf8= "* * $NOTIFICATIONTYPE $ Host Alert: $HOSTNAME $ is $HOSTSTATE $ * * "
}
Define Command{
Command_name notify-service-by-fetion
Command_line/usr/local/fetion/fetion--mobile=137xxxxxxxx--pwd=1111111--to=138xxxxxxxx--msg-type=1--msg-utf8= "* * $NOTIFICATIONTYPE $\n\nservice: $SERVICEDESC $\nhost: $HOSTALIAS $\naddress: $HOSTADDRESS $\nstate: $SERVICESTATE $\n\ Ndate/time: $LONGDATETIME $\n\nadditional info:\n\n$serviceoutput$ * * "
}
Third, VI templates.cfg
Define Contact{
............
Service_notification_commands notify-service-by-fetion
Host_notification_commands notify-host-by-fetion
............
}
Iv. VI contacts.cfg
Define Contact {
Contact_Name Elain
Alias SA
Service_notification_period 24x7
Host_notification_period 24x7
Service_notification_options W,u,c,r
Host_notification_options D,u,r
Service_notification_commands notify-service-by-email,service-notify-by-fetion
Host_notification_commands notify-host-by-email,host-notify-by-fetion
email [email protected]
Pager 138xxxxxxxx
}/etc/init.d/nagios Checkconfig #检查配置文件 Correctness
/etc/nit.d/nagios Reload #重新加载配置文件
Stop the service to do the test!!!
CentOS under Nagios alarm fetion deployment Four steps away