Copy and Modify a Configuration Wizard

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
ockmeyer
Posts: 74
Joined: Mon Jun 25, 2012 2:17 pm

Copy and Modify a Configuration Wizard

Post by ockmeyer »

I would like to take the Network Switch / Router configuration wizard and copy it so I have one for Switches and a second one for Routers. That way I can apply a separate template to each. Currently the wizard is set to apply the xiwizard_switch_host and there is no option to apply a different template.

What is the best way to do copy and then modify an existing CW?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Copy and Modify a Configuration Wizard

Post by scottwilkerson »

Unfortunately, you cannot really copy items from the Switch/Router wizard because when you run the wizard it also adds configuration information into the underlying mrtg.cfg that grabs the data.

With this particular wizard it must be run for each switch/router.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
ockmeyer
Posts: 74
Joined: Mon Jun 25, 2012 2:17 pm

Re: Copy and Modify a Configuration Wizard

Post by ockmeyer »

That's too bad. We have separate Action URLs for switches and routers. My plan then will be to edit the switch.inc.php file and change the template to xiwizard_router_host (a copy of the xiwizard_switch_host template with a different Action URL) when adding routers.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Copy and Modify a Configuration Wizard

Post by scottwilkerson »

That's a good plan.

I'm going to attach an additional actions component that you might find useful that is Beta but, may also solve your problem.

If you edit the wizard, I am going to suggest you do the following

Change line 22+ from

Code: Select all

	$args=array(
		CONFIGWIZARD_NAME => $name,
		CONFIGWIZARD_TYPE => CONFIGWIZARD_TYPE_MONITORING,
		CONFIGWIZARD_DESCRIPTION => "Monitor a network switch or router.",
		CONFIGWIZARD_DISPLAYTITLE => "Network Switch / Router",
		CONFIGWIZARD_FUNCTION => "switch_configwizard_func",
		CONFIGWIZARD_PREVIEWIMAGE => "switch.png",
		);
to

Code: Select all

$args=array(
		CONFIGWIZARD_NAME => $name,
		CONFIGWIZARD_VERSION => "1000",
		CONFIGWIZARD_TYPE => CONFIGWIZARD_TYPE_MONITORING,
		CONFIGWIZARD_DESCRIPTION => "Monitor a network switch or router.",
		CONFIGWIZARD_DISPLAYTITLE => "Network Switch / Router",
		CONFIGWIZARD_FUNCTION => "switch_configwizard_func",
		CONFIGWIZARD_PREVIEWIMAGE => "switch.png",
		);
This will set your version to 1000 so it doesn't get overwrittem by new wizards. Starting with the 2012 release we will be upgrading wizards & components if a newer version is available.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
ockmeyer
Posts: 74
Joined: Mon Jun 25, 2012 2:17 pm

Re: Copy and Modify a Configuration Wizard

Post by ockmeyer »

That explains why my testing failed before.

Thanks Scott!
Locked