Monitoring client, 22, [root @ svr4 ~] # Vimusrlocalnagiosetcobjectshosts. Define definehost {host_namesvr1.labexam.comaliassvr1address10.1.1.10contact_groupssagroupcheck_commandcheck-host-alivecheck_commandnrpe! Check_us
Monitoring client, 22,
[Root @ svr4 ~] # Vim/usr/local/nagios/etc/objects/hosts. cfg
Define host {
Host_name svr1.labExAm.com
AliasSvr1
ADdRess 10.1.1.10
Contact_groups sagroup
Check_command check-host-alive
Check_command nrpe! Check_users
Check_command nrpe! Check_total_procs
Check_command nrpe! Check_load
Max_check_attempts 4
NotifiCatIon_interval 5
Icationication_period 24x7
Notification_options d, u, r
}
[Root @ svr4 objects] # vim svr1_services.cfg
Define service {
Host_name svr1.labexam.com
Service_description ALIVE
Check_period 24x7
Max_check_attempts 2
NoRmAl_check_interval 2
ReTrY_check_interval 1
Contact_groups sagroup
Icationication_interval 5
Icationication_period 24x7
Notification_options w, u, c, r
Check_command check-host-alive
}
Define service {
Host_name svr1.labexam.com
Service_description SSH
Check_period 24x7
Max_check_attempts 2
Normal_check_interval 1
Retry_check_interval 2
Contact_groups sagroup
Icationication_interval 5
Icationication_period 24x7
Notification_options w, u, c, r
Check_command check_tCp! 22
}
Define service {
Host_name svr1.labexam.com
Service_description HTTP_81
Check_period 24x7
Max_check_attempts 2
Normal_check_interval 1
Retry_check_interval 1
Contact_groups sagroup
Icationication_interval 5
Icationication_period 24x7
Notification_options w, u, c, r
Check_command check_tcp! 81
}
Define service {
Host_name svr1.labexam.com
Service_description HTTP_82
Check_period 24x7
Max_check_attempts 2
Normal_check_interval 1
Retry_check_interval 1
Contact_groups sagroup
Icationication_interval 5
Icationication_period 24x7
Notification_options w, u, c, r
Check_command check_tcp! 82
}
Define service {
Host_name svr1.labexam.com
Service_description FASTCGI
Check_period 24x7
Max_check_attempts 2
Normal_check_interval 1
Retry_check_interval 1
Contact_groups sagroup
Icationication_interval 5
Icationication_period 24x7
Notification_options w, u, c, r
Check_command check_tcp! 9000
}
Define service {
Host_name svr1.labexam.com
Service_description DISK
Check_period 24x7
Max_check_attempts 3
Normal_check_interval 2
Retry_check_interval 2
Contact_groups sagroup
Icationication_interval 2
Icationication_period 24x7
Notification_options w, u, c, r
Check_command nrpe! Check _Df
}
Define service {
Host_name svr1.labexam.com
Service_description LOAD
Check_period 24x7
Max_check_attempts 3
Normal_check_interval 2
Retry_check_interval 2
Contact_groups sagroup
Icationication_interval 2
Icationication_period 24x7
Notification_options w, u, c, r
Check_command nrpe! Check_load
}
Define service {
Host_name svr1.labexam.com
Service_description LOGOIN
Check_period 24x7
Max_check_attempts 2
Normal_check_interval 1
Retry_check_interval 1
Contact_groups sagroup
Icationication_interval 5
Icationication_period 24x7
Notification_options w, u, c, r
Check_command nrpe! Check_users
}
[Root @ svr4 objects] # vim/usr/local/nagios/etc/nagios. cfg
Add one:
Cfg _File=/Usr/local/nagios/etc/objects/svr#services.cfg
[Root @ svr4 objects] #/etc/init. d/nagios reload
Running configuration check... done.
Reloading nagios configuration... done