Page 1 of 1
Custom Configuration Wizards
Posted: Fri Dec 30, 2016 12:50 pm
by gcross
I have customized the wizarddemo and uploaded to our Nagios XI and it works well. My question is how do I modify the wizarddemo a second time for a new custom wizard? I have changed the wizard name ($wizard_name) but my changes to the wizarddemo.inc.php only update the existing wizard, not create a new wizard.
What do I change in the code to make a new configuration wizard without overwriting the existing configuration wizard? Thanks
Re: Custom Configuration Wizards
Posted: Fri Dec 30, 2016 1:27 pm
by dwhitfield
Have you looked at
https://assets.nagios.com/downloads/nag ... ios-XI.pdf ?
If so, is there a particular place that seems to be tripping you up?
What version of XI are you running? 5.4 was recently released with some important security fixes.
Re: Custom Configuration Wizards
Posted: Fri Dec 30, 2016 1:28 pm
by tgriep
The following section from the wizarddemo.inc.php file would have to be edited.
Code: Select all
function wizarddemo_configwizard_init(){
//name / ID for config wizard
$name="wizarddemo";
//relevant info for wizard
$args=array(
CONFIGWIZARD_NAME => $name,
CONFIGWIZARD_TYPE => CONFIGWIZARD_TYPE_MONITORING,
CONFIGWIZARD_DESCRIPTION => "This is a developer demo wizard that creates checks for severe weather alerts",
CONFIGWIZARD_DISPLAYTITLE => "Weather Alerts",
CONFIGWIZARD_FUNCTION => "wizarddemo_configwizard_func",
CONFIGWIZARD_PREVIEWIMAGE => "wizarddemo.jpg",
CONFIGWIZARD_VERSION => "1.0",
CONFIGWIZARD_DATE => "2011-06-16",
CONFIGWIZARD_COPYRIGHT => "Copyright © 2008-2010 Nagios Enterprises, LLC.",
CONFIGWIZARD_AUTHOR => "Nagios Enterprises, LLC",
);
//register wizard with XI
register_configwizard($name,$args);
}
But, if you search the PHP file for the following string
Those would have to change as well.
If you are still having problems after the changes, can you post your php file so we can view it and see if we can replicate the issue?
Re: Custom Configuration Wizards
Posted: Tue Jan 03, 2017 9:40 am
by gcross
Currently running version 5.3.3 I will upgrade and try it again. I get tripped up when I change the .php file reflecting a new custom script, but the upload does not create a new custom script instead it modifies the previous custom script I had uploaded. My first custom script works perfectly.
Re: Custom Configuration Wizards
Posted: Tue Jan 03, 2017 10:11 am
by gcross
tgriep wrote:The following section from the wizarddemo.inc.php file would have to be edited.
Code: Select all
function wizarddemo_configwizard_init(){
//name / ID for config wizard
$name="wizarddemo";
//relevant info for wizard
$args=array(
CONFIGWIZARD_NAME => $name,
CONFIGWIZARD_TYPE => CONFIGWIZARD_TYPE_MONITORING,
CONFIGWIZARD_DESCRIPTION => "This is a developer demo wizard that creates checks for severe weather alerts",
CONFIGWIZARD_DISPLAYTITLE => "Weather Alerts",
CONFIGWIZARD_FUNCTION => "wizarddemo_configwizard_func",
CONFIGWIZARD_PREVIEWIMAGE => "wizarddemo.jpg",
CONFIGWIZARD_VERSION => "1.0",
CONFIGWIZARD_DATE => "2011-06-16",
CONFIGWIZARD_COPYRIGHT => "Copyright © 2008-2010 Nagios Enterprises, LLC.",
CONFIGWIZARD_AUTHOR => "Nagios Enterprises, LLC",
);
//register wizard with XI
register_configwizard($name,$args);
}
But, if you search the PHP file for the following string
Those would have to change as well.
If you are still having problems after the changes, can you post your php file so we can view it and see if we can replicate the issue?
I have attached screenshots in a word document, this is after upgrading to 5.4
Re: Custom Configuration Wizards
Posted: Tue Jan 03, 2017 11:58 am
by tgriep
Did you rename the php file and the folder structure in the zip file to a different name?
It could be that the upload over writes the existing files unless those are changed.
Re: Custom Configuration Wizards
Posted: Tue Jan 03, 2017 12:31 pm
by gcross
tgriep wrote:Did you rename the php file and the folder structure in the zip file to a different name?
It could be that the upload over writes the existing files unless those are changed.
Solved, Awesome, that did the trick. Renamed the containing folder->tempdemo and the .php ->tempdemo.inc.php. The .zip file then became tempdemo.zip Thanks all
Re: Custom Configuration Wizards
Posted: Tue Jan 03, 2017 1:22 pm
by dwhitfield
Glad to hear it is resolved. I am going to lock the thread. Please feel free to post again if you have you another issue. Thank you for using the Nagios forums!