飞信官方网站:http://www.it-adv.net/
下载:fetion20080910048-linux.tar.gz 和 library32.rar(版本不断更新)
tar xvfz fetion_linux_20080402.tar.gz
cd install
sudo cp fetion /usr/bin
fetion -h
如果出现如下错误:
error while loading shared libraries: libACE.so.5.4.7: cannot open shared object file: No such file or directory
说明缺少运行的库文件。
解决方法:
a.sudo apt-get install libACE.so.5.4.7 libACE_SSL.so.5.4.7
(可能你的ubuntu已经不提供安装这两个库文件,采用下面的方案)
b.unrar e library32.rar
cd library32
sudo cp *.* /lib/
sudo cp *.* /usr/lib/
重新执行 fetion -h.应该能看到所要的结果。
如果你有飞信号,可以执行一下。
fetion -u 飞信号 -p pwd 来登录。
/usr/local/nagios/etc/objects/commands.cfg:
# 'notify-service-by-fetion' command definition
define command{
command_name notify-service-by-fetion
command_line /usr/bin/feiton -u 13888888888 -p 123456 -t $CONTACTPAGER$ -m "$HOSTNAME$ $SERVICEDESC$ is $SERVICESTATE$ on $TIME$ result is $SERVICEOUTPUT$" $CONTACTPAGER$
}
/usr/local/nagios/etcobjects/contacts.cfg :
define contact{
contact_name fetion
alias nagios admin
host_notification_period 24x7
service_notification_period 24x7
host_notification_options d,r,
service_notification_options c,w,r
service_notification_commands notify-service-by-email,notify-service-by-fetion
# service_notification_commands notify-service-by-email
host_notification_commands notify-host-by-email
pager 158010775111
}
最后将定义的contact添加到contactgroup中:
define contactgroup{
contactgroup_name admins
alias Nagios Administrators
members nagiosadmin,nagios,fetion
}
当你定义一个主机的时候:
/usr/local/nagios/etc/objects/templates:
# Linux host definition template - This is NOT a real host, just a template!
define host{
name linux-server ; The name of this host template
use generic-host ; This template inherits other values from the generic-host template
check_period 24x7 ; By default, Linux hosts are checked round the clock
check_interval 5 ; Actively check the host every 5 minutes
retry_interval 1 ; Schedule host check retries at 1 minute intervals
max_check_attempts 10 ; Check each Linux host 10 times (max)
check_command check-host-alive ; Default command to check Linux hosts
notification_period workhours ; Linux admins hate to be woken up, so we only notify during the day
; Note that the notification_period variable is being overridden from
; the value that is inherited from the generic-host template!
notification_interval 120 ; Resend notifications every 2 hours
notification_options d,u,r ; Only send notifications for specific host states
contact_groups admins ;使用的联系组为admins
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
}