看了objects里的文件半天,理解了半天,有些许悟.但本人对英文说明文档不敏感,如有错误希望高手指出.
nagios/etc/nagios.cfg是主配置文件,部分内容如下
- # You can specify individual object config files as shown below:
- cfg_file=/usr/local/nagios/etc/objects/commands.cfg
- cfg_file=/usr/local/nagios/etc/objects/contacts.cfg
- cfg_file=/usr/local/nagios/etc/objects/timeperiods.cfg
- cfg_file=/usr/local/nagios/etc/objects/templates.cfg
- cfg_file=/usr/local/nagios/etc/objects/localhost.cfg
- cfg_file=/usr/local/nagios/etc/objects/mylinux.cfg
- #cfg_file=/usr/local/nagios/etc/objects/windows.cfg
- cfg_file=/usr/local/nagios/etc/objects/switch.cfg
- #cfg_file=/usr/local/nagios/etc/objects/printer.cfg
- # You can also tell Nagios to process all config files (with a .cfg
- # extension) in a particular directory by using the cfg_dir
- # directive as shown below:
- #cfg_dir=/usr/local/nagios/etc/servers
- #cfg_dir=/usr/local/nagios/etc/printers
- #cfg_dir=/usr/local/nagios/etc/switches
- #cfg_dir=/usr/local/nagios/etc/routers
可以看出,引用cfg文件无特别前后顺序.
各cfg文件定义了主体,包括主机名,联系人,服务,命令,时间等
再根据不同的监控对象引用主体,实现监控手段.
画了个简陋的关系图,对理解有帮助.
阅读(2281) | 评论(0) | 转发(0) |