Page 1 of 1

Default notification resend in config wizard

Posted: Tue Apr 14, 2015 4:38 pm
by geoffmyers
I'd like to change the default resend interval from 60 minutes to something else in the configuration wizard notification settings, but I can't figure out where this is specified. Can someone point me in the right direction?

Thanks,

Geoff

Re: Default notification resend in config wizard

Posted: Tue Apr 14, 2015 5:58 pm
by Box293
This is currently not a configuration option that can be done easily.

It can be done in the PHP code. In the example below I will change 60 to 180. Basically we add the following to the code in several locations:

Code: Select all

"notification_interval" => "180",
In the version 2.1.7 of the wizard.
In the file /usr/local/nagiosxi/html/includes/configwizards/switch/switch.inc.php
It needs to be defined on the Host Object, Ping Service, Bandwidth Service and Port Status Service.

Host Object
Starting at line 910 use this code instead:

Code: Select all

$objs[] = array(
	"type" => OBJECTTYPE_HOST,
	"use" => "xiwizard_switch_host",
	"host_name" => $hostname,
	"address" => $hostaddress,
	"icon_image" => "switch.png",
	"statusmap_image" => "switch.png",
	"_xiwizard" => $wizard_name,
	"notification_interval" => "180",
);

Ping Service
Starting at line 931 use this code instead:

Code: Select all

$objs[] = array(
	"type" => OBJECTTYPE_SERVICE,
	"host_name" => $hostname,
	"service_description" => "Ping",
	"use" => "xiwizard_switch_ping_service",
	"_xiwizard" => $wizard_name,
	"notification_interval" => "180",
);
Bandwidth Service
Starting at line 979 use this code instead:

Code: Select all

$objs[] = array(
	"type" => OBJECTTYPE_SERVICE,
	"host_name" => $hostname,
	"service_description" => $portname . " Bandwidth",
	"use" => "xiwizard_switch_port_bandwidth_service",
	"check_command" => "check_xi_service_mrtgtraf!" . $hostaddress . "_" . $portnum . ".rrd!" . $warn_pair . "!" . $crit_pair . "!" . $label,
	"_xiwizard" => $wizard_name,
	"notification_interval" => "180",
);

Port Status Service
Starting at line 995 use this code instead:

Code: Select all

$objs[] = array(
	"type" => OBJECTTYPE_SERVICE,
	"host_name" => $hostname,
	"service_description" => $portname . " Status",
	"use" => "xiwizard_switch_port_status_service",
	"check_command" => "check_xi_service_ifoperstatus!" . $snmpopts['snmpcommunity'] . "!" . $portnum . "!-v " . (int)$snmpversion,
	"_xiwizard" => $wizard_name,
	"notification_interval" => "180",
);
Starting at line 1012 use this code instead:

Code: Select all

$objs[] = array(
	"type" => OBJECTTYPE_SERVICE,
	"host_name" => $hostname,
	"service_description" => $portname . " Status",
	"use" => "xiwizard_switch_port_status_service",
	"check_command" => "check_xi_service_ifoperstatusnag!{$portnum}!-v{$snmpversion} -u {$snmpopts['v3_username']} -A {$snmpopts['v3_auth_password']} {$priv_password_and_proto} -a {$snmpopts["v3_auth_proto"]} -l {$snmpopts['v3_security_level']}",
	"_xiwizard" => $wizard_name,
	"notification_interval" => "180",
);

NOTES:
If the wizard gets updated later you'll need to re-add these settings
The wizard will still display 60 in the field, but when the objects are created they are overwritten with these hard coded values

Re: Default notification resend in config wizard

Posted: Wed Apr 15, 2015 10:31 pm
by geoffmyers
It would be good to be able to set that as well as a default config for the selections of who to notify. If you are adding one or two hosts it's not a big deal, but if you are trying to add a lot and have to remember to do it for each one it is annoying to say the least.

Thanks for your help.

Re: Default notification resend in config wizard

Posted: Thu Apr 16, 2015 10:00 am
by lmiltchev
If you are adding one or two hosts it's not a big deal, but if you are trying to add a lot and have to remember to do it for each one it is annoying to say the least.
You can set up a host and its services the way you want it, then use this host as a "template" and clone it as many times as you want via the "Bulk Host Cloning & Import" wizard.

Note: this will not work 100% of the time - it would depend on the type of host you are trying to clone. For "regular" Windows or Linux hosts it should work just fine though.

You can read more about the "Bulk Host Cloning & Import" wizard here:

http://assets.nagios.com/downloads/nagi ... Wizard.pdf

Re: Default notification resend in config wizard

Posted: Mon Apr 20, 2015 2:50 pm
by geoffmyers
Ah, good idea. Thanks for the assistance.

Re: Default notification resend in config wizard

Posted: Mon Apr 20, 2015 3:31 pm
by lmiltchev
You are welcome! I am going to lock this topic. If you have any more questions/issue, please start a new thread. PM me if you want this topic to be unlocked.