Learning Academy

The Cure of Ignorance is to Question. MUHAMMAD (PBUH)

Monitoring

How to install Nagios on CentOS?

Services CFG

[root@yourmachine  nagios] vim services.cfg

# Generic service definition template
define service{
name                            generic-service ; Generic service name
active_checks_enabled           1               ; Active service checks are enabled
passive_checks_enabled          1               ; Passive service checks are enabled/accepted
parallelize_check               1               ; Active service checks should be parallelized (Don’t disable)
obsess_over_service             1               ; We should obsess over this service (if necessary)
check_freshness                 0               ; Default is to NOT check service ‘freshness’
notifications_enabled           1               ; Service notifications are enabled
event_handler_enabled           1               ; Service event handler is enabled
flap_detection_enabled          1               ; Flap detection is enabled
process_perf_data               1               ; Process performance data
retain_status_information       1               ; Retain status information across program restarts
retain_nonstatus_information    1               ; Retain non-status information across program restarts
register                        0               ; DONT REGISTER THIS DEFINITION – NOT A REAL SERVICE, JUST A TEMPLATE!
}

# Generic for all services
define service{
use                             generic-service
name                            basic-service
is_volatile                     0
check_period                    24×7
max_check_attempts              15
normal_check_interval           10
retry_check_interval            2
notification_interval           0
notification_period             none
register                        0
}

define service{
use                             basic-service
name                            ping-service
notification_options            n
check_command                   check_ping!1000.0,20%!2000.0,60%
register                        0
}

define service{
use                             ping-service
service_description             PING
contact_groups                  einsteins
hostgroup_name                  basic-clients,your-routers
#       host_name                       one_client
}

# SMTP – ensure SMTP services are available.
define service{
use                             basic-service
name                            smtp-service
service_description             SMTP
notification_interval           15
contact_groups                  einsteins
notification_options            c,r
notification_period             24×7
check_command                   check_smtp
register                        0
}

define service{
use                             smtp-service
hostgroup_name                  smtp-servers
#       host_name                       one_client
}

Muhammad Shaukat

Content Developer at LearnAcad.com

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Pin It on Pinterest