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?
Copy and Modify a Configuration Wizard
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Copy and Modify a Configuration Wizard
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.
With this particular wizard it must be run for each switch/router.
Re: Copy and Modify a Configuration Wizard
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
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
to
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.
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",
);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",
);
Re: Copy and Modify a Configuration Wizard
That explains why my testing failed before.
Thanks Scott!
Thanks Scott!