Config Wizards Customization Question

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
niebais
Posts: 349
Joined: Tue Apr 13, 2010 2:15 pm

Config Wizards Customization Question

Post by niebais »

OS: Centos 5.5
Nagios XI Version: Nagios XI 2009R1.4B

We've been working on some new customized wizards for our company and we are trying to figure something out. We would like to remove the contacts and the hostgroup and servicegroups stages of the wizards. That way the user just selects a few things at the front of the wizard and he isn't bothered by "who is contacted" or the service groups. How can I do this?
tonyyarusso
Posts: 1128
Joined: Wed Mar 03, 2010 12:38 pm
Location: St. Paul, MN, USA
Contact:

Re: Config Wizards Customization Question

Post by tonyyarusso »

I believe you should be able to just delete those stages from the PHP file, then make sure your variables are properly passed between whatever stages remain in the same fashion they were going through those steps, and hardcode the contacts and such that you're taking out. I take it you're working from an existing wizard as a template?
Tony Yarusso
Technical Services
___
TIES
Web: http://ties.k12.mn.us/
User avatar
niebais
Posts: 349
Joined: Tue Apr 13, 2010 2:15 pm

Re: Config Wizards Customization Question

Post by niebais »

That's part of the problem, we only see three stages in the existing template (We're using genericnetdevice as a sample to go off of). We'd like to be able to not show some of other stages, like the service group and host group page, and kind of mock up our own instead.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Config Wizards Customization Question

Post by mguthrie »

I think this can be done, but I don't remember what the code looks like for it. I'll have to do some snooping around because I think some arguments can be passed to bypass some of the stages, but I need to double check on that...
User avatar
niebais
Posts: 349
Joined: Tue Apr 13, 2010 2:15 pm

Re: Config Wizards Customization Question

Post by niebais »

Thanks, that would be useful.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Config Wizards Customization Question

Post by mguthrie »

This might be a little bit of a hack, but if it works, it'd be super simple. Try adding

Code: Select all

<input type="hidden" name="nextstep" value="commit" />
To the html output, when you click "next" this might take you to the last step. Or it could throw tons of missing variable errors ; ) If it works let me know. There are some things that can be done to hide the actual form elements for some of the wizard stages, but it doesn't look like we have an actual argument to pass to bypass a stage altogether.
griffithusg
Posts: 64
Joined: Sun Nov 07, 2010 7:16 pm

Re: Config Wizards Customization Question

Post by griffithusg »

I would like to do something very similar but instead of just skipping it, actually assign a value to some of these variables. such as hostgroup selection and contact groups.

I would like to make it foolproof to add a host in. :)

Any thoughts on this would be excellentio.

Rob
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Config Wizards Customization Question

Post by mguthrie »

I would like to do something very similar but instead of just skipping it, actually assign a value to some of these variables. such as hostgroup selection and contact groups.
This can be done, let me go dig up a code example of how to do it.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Config Wizards Customization Question

Post by mguthrie »

Code Examples:

I'm going to write up a Doc on writing custom wizards. There's a doc on the exchange that user Box293 wrote that gives tips ans suggestions, but as of yet we don't have anything official.

Code: Select all


		case CONFIGWIZARD_MODE_GETSTAGE3OPTS:

		//example of force overriding options 		
				$outargs[CONFIGWIZARD_OVERRIDE_OPTIONS]=array(
				"max_check_attempts" => 3,
				);

                    //hide options for this stage
                            $result=CONFIGWIZARD_HIDE_OPTIONS;
You can use the CONFIGWIZARD_OVERRIDE_OPTIONS array to manually override config options. So for the hostgroup override, you'll have to pass something like this:

Code: Select all

			$outargs[CONFIGWIZARD_OVERRIDE_OPTIONS]=array(
				"hostgroups" => "my list of hostgroups",
				);
User avatar
niebais
Posts: 349
Joined: Tue Apr 13, 2010 2:15 pm

Re: Config Wizards Customization Question

Post by niebais »

Well that did direct me to the constants.inc.php file, which has all the constants in it. Thanks!
Locked