Default notification resend in config wizard

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
geoffmyers
Posts: 22
Joined: Fri Apr 03, 2015 3:57 pm

Default notification resend in config wizard

Post 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
You do not have the required permissions to view the files attached to this post.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Default notification resend in config wizard

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
geoffmyers
Posts: 22
Joined: Fri Apr 03, 2015 3:57 pm

Re: Default notification resend in config wizard

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Default notification resend in config wizard

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
geoffmyers
Posts: 22
Joined: Fri Apr 03, 2015 3:57 pm

Re: Default notification resend in config wizard

Post by geoffmyers »

Ah, good idea. Thanks for the assistance.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Default notification resend in config wizard

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked