Page 1 of 1

Copy and Modify a Configuration Wizard

Posted: Wed Aug 29, 2012 12:41 pm
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?

Re: Copy and Modify a Configuration Wizard

Posted: Wed Aug 29, 2012 3:30 pm
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.

Re: Copy and Modify a Configuration Wizard

Posted: Wed Aug 29, 2012 3:44 pm
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.

Re: Copy and Modify a Configuration Wizard

Posted: Wed Aug 29, 2012 4:40 pm
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.

Re: Copy and Modify a Configuration Wizard

Posted: Thu Aug 30, 2012 9:39 am
by ockmeyer
That explains why my testing failed before.

Thanks Scott!