四:linux客户端文件,host调用linux-server模板,service调用linux-service
- [root@localhost ~]# grep -v '^#' /usr/local/nagios/etc/objects/client/10.0.1.11.cfg
- define host{
- use linux-server ; Name of host template to use
- ; This host definition will inherit all variables that are defined
- ; in (or inherited by) the linux-server host template definition.
- host_name 10.0.1.11
- alias 10.0.1.11
- address 10.0.1.11
- }
- define service{
- use linux-service ; Name of service template to use
- host_name 10.0.1.11
- service_description CPU Load
- check_command check_nrpe!check_load
- }
五:windows客户端文件,host调用windows-server模板,service调用windows-service
- [root@localhost ~]# grep -v '^#' /usr/local/nagios/etc/objects/client/10.0.1.13.cfg
- define host{
- use windows-server ; Inherit default values from a template
- host_name 10.0.1.13 ; The name we're giving to this host
- alias 10.0.1.13 ; A longer name associated with the host
- address 10.0.1.13 ; IP address of the host
- }
- define service{
- use windows-service
- host_name 10.0.1.13
- service_description NSClient++ Version
- check_command check_nt!CLIENTVERSION
- notifications_enabled 1
- }
六:重启nagios服务,并验证结果
- [root@localhost ~]# service nagios reload
- Running configuration check...done.
- Reloading nagios configuration...done
后记:服务器报警信息固然重要,但如果报警信息泛滥,从应用或者资源上无法及时调整到位,运维人员难免会对报警短信产生厌烦情绪,进而可能会忽略重要的报警信息,对服务器运维造成负面的影响,也会让领导认为监控系统可有可无,其实还是可以从技术角度上解决一些问题的,例如工作时间短信发送到QQ邮箱,MSN上,非工作时间短信发送到运维人员手机或者值班手机上,就是一种不错的办法,但监控只是一种手段,服务器问题还是早预见早解决为妙!


