Custom Configuration Wizards

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
gcross
Posts: 4
Joined: Fri Dec 30, 2016 11:48 am

Custom Configuration Wizards

Post 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
Last edited by dwhitfield on Tue Jan 03, 2017 1:22 pm, edited 1 time in total.
Reason: marking with green check mark
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Custom Configuration Wizards

Post 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.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Custom Configuration Wizards

Post 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

Code: Select all

wizarddemo
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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
gcross
Posts: 4
Joined: Fri Dec 30, 2016 11:48 am

Re: Custom Configuration Wizards

Post by gcross »

dwhitfield wrote: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.
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.
gcross
Posts: 4
Joined: Fri Dec 30, 2016 11:48 am

Re: Custom Configuration Wizards

Post 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

Code: Select all

wizarddemo
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
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Custom Configuration Wizards

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
gcross
Posts: 4
Joined: Fri Dec 30, 2016 11:48 am

Re: Custom Configuration Wizards

Post 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
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Custom Configuration Wizards

Post 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!
Locked