Nagios - Set up the first Host




Step 1

vi /etc/nagios/nagios.cfg

cfg_file=/etc/nagios/hosts.cfg

Enable your customize host cfg file

vi /etc/nagios/hosts.cfg

degine host{ use linux-server host_name joe alias joe address 192.168.1.145 } define host{ use linux-server host_name alan alias alan address 192.168.1.8 } ############################################################ define hostgroup{ hostgroup_name Servers alias Servers members joe,alan } ############################################################ define service{ use generic-service host_name joe service_description PING check_command check_ping!100.0,20%!500.0,60% } define service{ use generic-service host_name joe service_description HTTP check_command check_http } define service{ use generic-service host_name alan service_description PING check_command check_ping!100.0,20%!500.0,60% } define service{ use generic-service host_name alan service_description SMTP check_command check_smtp }

Create the simple cfg file which contain 2 host you want to monitoring.

P.S. for other services, you can refer the variable "check_command" in localhost.cfg and "use" in templates.cfg

nagios -v /etc/nagios/nagios.cfg

To check the configuration is pass or error

/etc/init.d/nagios restart

Apply the new setting



Server is hosted by Alanstudio
Linux Operating System

Recommend screen resolution 1024 x 768 / IE / FireFox
Alan Studio © 2007 by Alan Cheung Hin Lun. All rights reserved.