"All Services" by default when downtiming a host?


(Taylor) #1

In our setup we don’t immediately see any reason why we would downtime a host and not also downtime all services under it. Is there a configuration option to automatically downtime all the services when downtiming the host?

I would like to avoid someone forgetting to click the checkbox in the UI and having an alert storm go off as service go into UNKOWN state.


(Michael Friedrich) #2

Tip from my side - when I’m not sure whether this is possible, I’ll always look into the source code and grep for the specific label.

michi@mbmif ~/coding/icinga/icingaweb2 (master=) $ grep -r 'All Services' .

We may find something here, or keep it open to maybe write a patch. In this case, there’s a setting hidden in the form element.

        $this->addElement(
            'checkbox',
            'all_services',
            array(
                'description'   => $this->translate(
                    'Schedule downtime for all services on the hosts and the hosts themselves.'
                ),
                'label'         => $this->translate('All Services'),
                'value'         => (bool) $config->get('settings', 'hostdowntime_all_services', false)
            )
        );

You might want to try just that in your config.ini in the global seetings.


(Taylor) #3

Michael thank you for the awesome tip. I am actually running an older version of icingaweb2 and it does not have that configuration option for All Services.

I will be updating to the latest and will add the value to the config.ini.

Truly appreciate your response!

Taylor


#4

I tried to put the setting hostdowntime_all_services = "1" into /etc/icingaweb2/modules/monitoring/config.ini in the [global] section. But unfortunately nothing changed on the downtime page for hosts (the checkbox for “all services” remains unchecked). Am I using it wrong?


#5

You need to put it in the [settings] section :slight_smile:


#6

Thanks a lot. Sometimes it is so obvious…


(tnova) #7

For some reason, this doesn’t work for me. Maybe I am missing something obvious?

I have added this to /etc/icingaweb2/config.ini:

[settings]
hostdowntime_all_services = "1"

I have logged out of and back into Icingaweb, restarted Apache, the PHP FPM service, and just about everything else, but I still do not get the “All services” checkbox preselected.

So I patched the source file modules/monitoring/application/forms/Command/Object/ScheduleHostDowntimeCommandForm.php and substituted the default value false with true.


#8

The setting needs to be in
/etc/icingaweb2/modules/monitoring/config.ini
since it is a setting for the “monitoring” module.