how to modify sanity/pre-check rule ?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
nagmoto
Posts: 195
Joined: Fri Jan 09, 2015 8:05 am

how to modify sanity/pre-check rule ?

Post 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 ?
nagmoto
Posts: 195
Joined: Fri Jan 09, 2015 8:05 am

Re: how to modify sanity/pre-check rule ?

Post 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
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: how to modify sanity/pre-check rule ?

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
nagmoto
Posts: 195
Joined: Fri Jan 09, 2015 8:05 am

Re: how to modify sanity/pre-check rule ?

Post 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
        }
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: how to modify sanity/pre-check rule ?

Post 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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked