How do Cacti console menus really work?

Discussions on developing plugins for the Cacti Plugin Architecture

Moderators: Developers, Moderators

Post Reply
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

How do Cacti console menus really work?

Post by Howie »

I've just added a new feature to Weathermap that I'd like to show on it's own sub-page in the console menu, like RRAs or CDEFs are. I've looked in global_arrays.php and there's code like this:

Code: Select all

$menu = array(
	"Create" => array(
		"graphs_new.php" => "New Graphs"
		),
	"Management" => array(
		"graphs.php" => array(
			"graphs.php" => "Graph Management",
			"cdef.php" => "CDEFs",
			"color.php" => "Colors",
			"gprint_presets.php" => "GPRINT Presets"
			),
So I did the following in my config_arrays function:

Code: Select all

$wm_menu = array(
		'plugins/weathermap/weathermap-cacti-plugin-mgmt.php' => "Weathermaps",
		'plugins/weathermap/weathermap-cacti-plugin-mgmt-groups.php' => "Groups"
	);
	
	$menu["Management"]['plugins/weathermap/weathermap-cacti-plugin-mgmt.php'] = $wm_menu;
and nothing happens - I just get the Weathermaps entry.

So I looked into html.php to see how it's drawn, and it seems that I might need to have a second entry in $user_auth_realm_filenames[] so that the submenu is drawn. I've tried that, but it still doesn't work.

How do I get the submenu to show up? Ideally I don't really want a whole second page, but just actions within weathermap-cacti-plugin-mgmt.php, but having it work at all would also be nice.

I'd also like it so that the one user realm (manage weathermaps) allows access to both pages.

Any suggestions?
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

Has nobody else done this?
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

To be honest, no.
And more: we will remove those sub-menues in 088.
But it "should" work nevertheless; but I honestly do not know how, at least not by heart
Reinhard
cigamit
Developer
Posts: 3369
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

No, the sub menus don't work for plugins, as the way Cacti handles it is very poorly done (at least for our uses). I haven't rewritten it yet, as we plan on getting rid of then eventually anyways.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

Hmm. That sucks...

thanks for the definitive answer though - I'll find another way.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest