配置文件放在nagios/etc下面
cgi.cfg ,,,,,,,,,,,,,,,,,控制CGI访问的配置文件
nagios.cfg ,,,,,,,,,,,,nagios主配置文件
resource.cfg ,,,,,,,,,变量定义文件,这个一般不做修改。
/etc/对象/,,,,,,,,,,,,这是存放配置文件模板的目录,定义要监控的对象和相关信息的配置文件
对象/commands.cfg ,,,,定义监控某个功能所使用的命令的配置文件。
对象/contacts.cfg ,,,,,,,,定义常用联系人和联系组的配置文件
对象/localhost.cfg ,,,,,,,,定义本地主机的配置文件
对象/templates.cfg ,,,,,,,,定义主机和服务的一个模板
对象/timeperiods.cfg ,,,,,定义监控时间段的配置文件
还有printer.cfg ,,switch.cfg ,,windows.cfg ,这几个默认不启动的配置文件,不做介绍了。
等了解了naigos 的配置文件之间的关系,自己就可以随意添加项要监控的内容了。
,
retain_status_information 1
retain_nonstatus_information 1
notification_period 24
register 0
}
.
normal_check_interval , 10,retry_check_interval , 2,,,,admins contact_groups ,还以为;notification_options , w, u c r
notification_interval 60,
notification_period , 24
register ,, 0
,,,,,,,,,,,,,,,,,
USER1美元=/usr/地方/nagios/libexec
不用解释相信大家也明白这句意思了只,,,,,,,,
.
.
.
.
.
,定义服务{
use ,本地服务
mysqlhost_name
service_description 平
check_command , check_ping ! 100.0, 20% !
500.0, 60%} {
定义服务
use ,本地服务
mysqlhost_name
service_description SSH
check_command , check_ssh
}
定义服务{
use ,本地服务
mysqlhost_name ftp
service_description
check_command , check_ftp
} {
定义服务
use ,本地服务
mysqlhost_name
service_description mysqlport
check_command , check_tcp ! 3306
}
.
定义接触{
contact_name sasystem ,
use , generic-contact ,,,,,,
alias , sa-system ,,,,,,,,,,,,
email , 13406351516 @139.com ,,
}
定义contactgroup {
contactgroup_name admins ,,,,,,,,,,,
alias ,,系统管理员group ,,
members ,, sasystem ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,。
}
.
定义timeperiod {
,,,,,,timeperiod_name 24
,,,,,,alias ,,,,,,,,,一天24小时,一周7天
,,,,,,sunday ,,,,,,,,00:00-24:00
,,,,,,monday ,,,,,,,,00:00-24:00
,,,,,,tuesday ,,,,,,,00:00-24:00