1 Service check to monitor in 2 hosts
Posted: Tue Oct 11, 2016 12:38 am
Hi, we need to monitor a particular service in 2 hosts.
If the service ( process check or other checks) is running in either host1 or host2 , then nagios service check should return OK status.
If the service ( process check or other checks) is NOT running on both the hosts, then the service should through a CRITICAL alert.
Is there any way to configure above requirement ?
Do we need to use clustering of service, if yes, can you please share the docs ?
I tried to create a host with common name and added 2 hosts in address field , but it throwed an Invalid hostname/address error.
hosts/ XXXX_YYY_host_check.cfg file :
define host {
host_name XXXX_YYY_host_check
use xiwizard_linuxserver_host
address host1 / host2
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
contact_groups xi_contactgroup_all
notification_interval 60
notification_period xi_timeperiod_24x7
notifications_enabled 1
icon_image redhat.png
statusmap_image redhat.png
_xiwizard sshproxy
register 1
}
Service.cfg file
define service {
host_name XXXX_YYY_host_check
service_description Process - XXX_YYY
use generic-service
check_command check_xi_by_ssh! -C "/usr/local/nagios/libexec/check_services -p abc" -l test -q!!!!!!!
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 10
notification_period xi_timeperiod_24x7
notifications_enabled 1
contact_groups xi_contactgroup_all
_xiwizard sshproxy
register 1
}
If the service ( process check or other checks) is running in either host1 or host2 , then nagios service check should return OK status.
If the service ( process check or other checks) is NOT running on both the hosts, then the service should through a CRITICAL alert.
Is there any way to configure above requirement ?
Do we need to use clustering of service, if yes, can you please share the docs ?
I tried to create a host with common name and added 2 hosts in address field , but it throwed an Invalid hostname/address error.
hosts/ XXXX_YYY_host_check.cfg file :
define host {
host_name XXXX_YYY_host_check
use xiwizard_linuxserver_host
address host1 / host2
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
contact_groups xi_contactgroup_all
notification_interval 60
notification_period xi_timeperiod_24x7
notifications_enabled 1
icon_image redhat.png
statusmap_image redhat.png
_xiwizard sshproxy
register 1
}
Service.cfg file
define service {
host_name XXXX_YYY_host_check
service_description Process - XXX_YYY
use generic-service
check_command check_xi_by_ssh! -C "/usr/local/nagios/libexec/check_services -p abc" -l test -q!!!!!!!
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 10
notification_period xi_timeperiod_24x7
notifications_enabled 1
contact_groups xi_contactgroup_all
_xiwizard sshproxy
register 1
}