Config Wizards Customization Question
Config Wizards Customization Question
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?
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
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?
Re: Config Wizards Customization Question
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.
Re: Config Wizards Customization Question
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...
Re: Config Wizards Customization Question
Thanks, that would be useful.
Re: Config Wizards Customization Question
This might be a little bit of a hack, but if it works, it'd be super simple. Try adding
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.
Code: Select all
<input type="hidden" name="nextstep" value="commit" />-
griffithusg
- Posts: 64
- Joined: Sun Nov 07, 2010 7:16 pm
Re: Config Wizards Customization Question
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
I would like to make it foolproof to add a host in.
Any thoughts on this would be excellentio.
Rob
Re: Config Wizards Customization Question
This can be done, let me go dig up a code example of how to do it.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.
Re: Config Wizards Customization Question
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.
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:
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;
Code: Select all
$outargs[CONFIGWIZARD_OVERRIDE_OPTIONS]=array(
"hostgroups" => "my list of hostgroups",
);Re: Config Wizards Customization Question
Well that did direct me to the constants.inc.php file, which has all the constants in it. Thanks!