Page 1 of 1
how to modify sanity/pre-check rule ?
Posted: Mon Mar 09, 2015 10:45 am
by nagmoto
Hi There
I am using nagios 3.5.1 on CentOS 6.6.
I want to configure many hosts without service check at all, just default host ping check.
Code: Select all
<snipped>
Warning: Host 'abc26esxi02' has no services associated with it!
<snipped>
Checked 6 time periods.
Checking for circular paths between hosts...
Checking for circular host and service dependencies...
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 25
Total Errors: 0
How can I disable "no services associated" warning message ?
Re: how to modify sanity/pre-check rule ?
Posted: Mon Mar 09, 2015 11:36 am
by nagmoto
After reading R1, looks like nagios command,host,service need be defined for a machine.
Following is an attempt to define a service but not actually running it.
Will following really works to my goal of ping only monitoring upon a machine ?
Code: Select all
define host{
use linux-server
host_name lmcentos65t0.test.com
alias lmcentos65t0.test.com
address 10.64.111.35
hostgroups l32,core-test
max_check_attempts 15
check_period 24x7
notification_interval 30
notification_period 24x7
contact_groups admins,sysadmin
}
define service {
use generic-service
host_name lmcentos65t0.test.com
service_description PING
check_command check_ping!100.0,20%!500.0,60%
notifications_enabled 0
active_checks_enabled 0
passive_checks_enabled 0
event_handler_enabled 0
flap_detection_enabled 0
obsess_over_service 0
}
R1:
http://beginlinux.com/server/nagios/net ... os-plugins
Re: how to modify sanity/pre-check rule ?
Posted: Mon Mar 09, 2015 12:25 pm
by tgriep
The message
no services associated with it
is just a warning telling you that there are no service checks setup for that host and can be ignored.
If all you want to check is is the host is up, you can edit your host and add the check-host-alive or check_icmp to it and that should give you the results you are looking for.
Re: how to modify sanity/pre-check rule ?
Posted: Mon Mar 09, 2015 12:39 pm
by nagmoto
tgriep wrote:The message
no services associated with it
is just a warning telling you that there are no service checks setup for that host and can be ignored.
If all you want to check is is the host is up, you can edit your host and add the check-host-alive or check_icmp to it and that should give you the results you are looking for.
So no way to silent that warning message regarding "no services associated with a host" ?
Can we use a dummy service like following to declare service but not doing the service check ?
Code: Select all
define service {
use generic-service
host_name lmcentos65t0.test.com
service_description PING
check_command check_ping!100.0,20%!500.0,60%
notifications_enabled 0
active_checks_enabled 0
passive_checks_enabled 0
event_handler_enabled 0
flap_detection_enabled 0
obsess_over_service 0
}
Re: how to modify sanity/pre-check rule ?
Posted: Mon Mar 09, 2015 1:33 pm
by abrist
nagmoto wrote:
So no way to silent that warning message regarding "no services associated with a host" ?
Not without editing the source.
nagmoto wrote:Can we use a dummy service like following to declare service but not doing the service check ?
That would work. You could also just set the check command to use check_dummy. But as active and passive checks are disabled, it will never schedule the check anyways.