Timeperiod xi_timeperiod_24x7 forced in wizard

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
sigmainformatique
Posts: 74
Joined: Mon Apr 23, 2018 8:11 am

Timeperiod xi_timeperiod_24x7 forced in wizard

Post by sigmainformatique »

Hi Nagiosmen,

I have made two wizards for our enterprise : one for linux, one for windows.
These two wizards are dereivated from XI standards linux/windows wizards.

My issue is that timeperiod xi_timeperiod_24x7 is forced in hosts/services generated wherereas nothing in the wizard code mention it :

Code: Select all

# pwd
/usr/local/nagiosxi/html/includes/configwizards/linux-server-sigma
# grep -r timeperiod *
#
In my company, timeperiod are inherited in host templates.

- How can I modifiy my wizard in order to leave timeperiod blank in the hosts/services created.
- How can I massively delete timeperiods when they have been previously set to xi_timerperiod_24x7?

Regards
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Timeperiod xi_timeperiod_24x7 forced in wizard

Post by benjaminsmith »

Hello @sigmainformatique,
In my company, timeperiod are inherited in host templates.
- How can I modifiy my wizard in order to leave timeperiod blank in the hosts/services created.
Have you tried including the template in the wizard itself? You'll have to place the template in the template directory and then specify it in config.xml.

See: Guidelines for Writing Custom Wizards
How can I massively delete timeperiods when they have been previously set to xi_timerperiod_24x7?
If you have the Enterprise Edition, you can use the Bulk Mods Tool. Go to Configure > CCM > Tools > Bulk Modifications Tool > Change Single Config Option and choose Check Period.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
sigmainformatique
Posts: 74
Joined: Mon Apr 23, 2018 8:11 am

Re: Timeperiod xi_timeperiod_24x7 forced in wizard

Post by sigmainformatique »

Hi,

Thank you for your response.

Putting a templates/linux-server.cfg with an empty xiwizard_linuxserver_host template did not solve the problem.

Code: Select all

#########################################
## TEMPLATES
#########################################

define host {
        name                    xiwizard_linuxserver_host
        register                0

}
It's logical, as hosts parameters have precedence over the host's templates parameters.
In this case, that is WIZARD that directly force notification period directly on host.

I think this is set in later stages of the wizard (with check frequency, retry...).

Any way to remove that from the wizard?

Perhaps I could unset this from $objs object in the wizard?

Code: Select all

$obj = array(
                    "type"            => OBJECTTYPE_HOST,
                    "use"             => "$host_template, graphexplorer", //"xiwizard_linuxserver_host",
                    "host_name"       => $hostname,
                    "address"         => $hostaddress,
                    "icon_image"      => $icon,
                    "statusmap_image" => $icon,
                    "_xiwizard"       => $wizard_name,
                    "contact_groups"  => $contact_group,
                    "max_check_attempts" => 3,

                );
Note that in our wizard code, template inheritance is managed by choices made in the wizard by user. Work like a charm, except for this notification perdiod and parameters "forced" in later stages.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Timeperiod xi_timeperiod_24x7 forced in wizard

Post by benjaminsmith »

Hello,

Well, after some digging, this is by design. You cannot set the notification period and check period using the templates as they will be overwritten by default values xi_timeperiod_24x7. You can however set those directly in your wizard. For examples, please check out some of the wizards on the Nagios Exchange.

https://exchange.nagios.org/directory/A ... on-Wizards

Let me know if you have any other questions.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
sigmainformatique
Posts: 74
Joined: Mon Apr 23, 2018 8:11 am

Re: Timeperiod xi_timeperiod_24x7 forced in wizard

Post by sigmainformatique »

Hi,

We will modify it direclty with SQL queries in Nagiosql database, and a scheduled procedure.
You can close this thread.

Regards
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Timeperiod xi_timeperiod_24x7 forced in wizard

Post by benjaminsmith »

Hello,
We will modify it direclty with SQL queries in Nagiosql database, and a scheduled procedure.
You can close this thread.
We'll close this out. If you have any new questions, feel free to open another post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked