Page 1 of 1

Editing xiwizard Templates

Posted: Thu May 18, 2017 8:26 am
by blariv
Is there a way to change the value for Max Check Attempts on the default import or passive checks. I want it to be 5 but will default to 1 no matter what template I change. It is tedious to use the Bulk Change to do it on new servers. I know this was not a feature in older versions but I am currently at the latest and I am not sure which templates to change.

Thanks!

Re: Editing xiwizard Templates

Posted: Thu May 18, 2017 1:09 pm
by tgriep
To find out which template a service or host is using, go to the Core Config Manager > Hosts or Service menu and open one of them up.
Then click on the Manage Templates button and that will show you the template that is getting applied to them and then you can change that setting in the template and it would apply to the objects.
Typically it is the xiwizard_passive_host template for hosts and xiwizard_passive_service template for service checks.

Re: Editing xiwizard Templates

Posted: Thu May 18, 2017 1:25 pm
by blariv
hmmm, those are the ones I changed and it did not take effect on the newly added services/host

Re: Editing xiwizard Templates

Posted: Thu May 18, 2017 1:29 pm
by tgriep
Can you post one of the service or host check here so we can view it's settings?
Go to the Core Config Manager > Hosts or Service menu and click on the floppy icon to display the configs and post that here.
What wizard / Process are you using when you are adding new host or services?

Re: Editing xiwizard Templates

Posted: Thu May 18, 2017 1:33 pm
by blariv
i am using the unconfigured objects link from the Admin console. the max check attempts should be 5

###############################################################################
#
# Service configuration file
#
# Created by: Nagios Core Config Manager 2.6.5
# Date: 2017-05-18 14:32:53
# Version: Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios CCM will overwrite all manual settings during the next update if you
# would like to edit files manually, place them in the 'static' directory or
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################

define service {
host_name brian-nagios
service_description check_windows_updates
use xiwizard_passive_service
max_check_attempts 1
check_interval 1
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 360
notification_period xi_timeperiod_24x7
contact_groups Infrastructure Support
stalking_options n
_xiwizard passiveobject
register 1
}

###############################################################################
#
# Service configuration file
#
# END OF FILE
#
###############################################################################

Re: Editing xiwizard Templates

Posted: Thu May 18, 2017 1:46 pm
by tgriep
When processing the Unconfigured Objects, this PHP script is used.

Code: Select all

/usr/local/nagiosxi/html/includes/configwizards/passiveobject/passiveobject.inc.php
So edit that file and in there, you can find and edit these options to what your needs are

Code: Select all

'check_interval' => 1,
'retry_interval' => 1,
'max_check_attempts' => 1,
Save the file and the next time you configure an object, those changes will be used for the host or service defaults.

Re: Editing xiwizard Templates

Posted: Thu May 18, 2017 2:14 pm
by blariv
perfect! i just imported a new service in and the correct values show.

is there a similar place for the freshness settings and Notification interval?

Re: Editing xiwizard Templates

Posted: Thu May 18, 2017 4:06 pm
by tgriep
In that same section in the passiveobject.inc.php script, you would add the extra options in the list and that would set those options when the Wizard is ran.
The example below, I added the notification_interval equal 100 and it seemed to work.

Code: Select all

    'type' => OBJECTTYPE_SERVICE,
                        'host_name' => $hostname,
                        'service_description' => $svcname,
                        'use' => 'xiwizard_passive_service',
                        'check_interval' => 1,
                        'retry_interval' => 1,
                        'max_check_attempts' => 1,
                        'notification_interval' => 100,                                                                                                                                                    
                        'is_volatile' => ($isvolatile == "yes") ? 1 : 0,
                        'stalking_options' => ($statestalking == "yes") ? "o,w,u,c" : "n",
                        //'icon_image' => 'passivecheck.png',
                        '_xiwizard' => $wizard_name,
                    );
All you would have to do is to add more of the options and they would get applied when the wizard runs.

FYI, If you upgrade XI in the future, you would have to re-edit the file and put back the changes.

Re: Editing xiwizard Templates

Posted: Fri May 19, 2017 8:51 am
by blariv
perfect, that all worked. you can lock this. thanks.