Nagios是一个允许用户监视远程系统可用性的软件。用户可从http://www.nagios.org/下载这个程序,此程序也可由Linux厂商提供。
Nagios这个程序广泛使用配置文件,这些文件主要位于/etc/nagios.中。主要配置文件是/etc/nagios/nagios.cfg,在其它配置选项中,并通过使用cfg_file命令指向了其它配置文件:
cfg_file=/etc/nagios/contacts.cfg
cfg_file=/etc/hosts.cfg
cfg_file=/etc/services.cfg |
以上的文件进一步配置并改善了Nagios的工作方式。例如,contacts.cfg可包含:
define contact{
contact_name admin
alias admin
service_notification_period 24x7
host_notification_period 24x7
service_notification_options c,r
host_notification_options d,r
service_notification_commands notify-by-email
host_notification_commands host-notify-by-email
email admin@mysite.com
} |
这些会定义什么人会接收警告、接收什么警告、在什么时间接收警告。这样你就会看出远程管理在每周七天、每天24小时可用,接受主机的警告信息,还可以接收主机服务的“失效”/“恢复”通知。
hosts.cfg文件包含着对被监视系统的主机定义, 一般来说,这个定义会是如下这个样子:
define host{
name linux-server
use generic-host
check_period 24x7
max_check_attempts 10
check_command check-host-alive
notification_period workhours
notification_interval 120
notification_options d,u,r
contact_groups admins
register 0
}
define host{
use linux-server
host_name surtr
alias surtr.mysite.com
address 127.0.0.1
} |