Cacti 0.8.7d, PA 2.4 and Weathermap 0.95b

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

Post Reply
NetAdmin
Cacti User
Posts: 98
Joined: Wed Aug 30, 2006 8:45 pm

Cacti 0.8.7d, PA 2.4 and Weathermap 0.95b

Post by NetAdmin »

Howie,

Just upgraded to Cacti 0.8.7d, PA 2.4 and started receiving the following message at the top of the screen when clicking on weathermap tab:

Notice: Undefined index: action in C:\Cacti\plugins\weathermap\setup.php on line 84

Everything still works, just wasn't sure if there was anything different in the newest Cacti or PA release that might be causing this.

I wasn't getting this with 0.8.7c, PA 2.3.

Thanks,

NetAdmin
Attachments
error.png
error.png (26.28 KiB) Viewed 10560 times
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

I'll upgrade my test server this evening, and see what I can see. Someone else had this error a couple of weeks ago with 0.8.7c and PA 2.3, and I think it turned out to be a problem with the PA patches (vs the pre-patched files), or the way they had applied them.

I'll see if I get the same problem.
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!)
NetAdmin
Cacti User
Posts: 98
Joined: Wed Aug 30, 2006 8:45 pm

Post by NetAdmin »

I did see that posting, but I upgraded using the pre-patched files as opposed to patching which I believe was the problem outlined in that post.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

I don't get that errror, and weathermap appears to work OK (I'll let it all run for a while before committing :-) ) but I *do* get the same broken images for the graph options in the top right...
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!)
NetAdmin
Cacti User
Posts: 98
Joined: Wed Aug 30, 2006 8:45 pm

Post by NetAdmin »

I'm also getting the broken graph images in the top right.
NetAdmin
Cacti User
Posts: 98
Joined: Wed Aug 30, 2006 8:45 pm

Post by NetAdmin »

Oddly enough, if I open a new browser (doesn't matter which one) and click on weathermap tab I don't get the error until hitting refresh.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

I take it back, now I do get the error.

But the fix is simple. Change line 84 of setup.php to:

Code: Select all

        if(isset( $_REQUEST["action"] ) && $_REQUEST["action"] == 'viewmapcycle')
I still have those broken tabs though.
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!)
NetAdmin
Cacti User
Posts: 98
Joined: Wed Aug 30, 2006 8:45 pm

Post by NetAdmin »

Easy fix is right. Thanks... :D

If it's any consolation, it's not just Weathermap plugin causing the broken images. Also getting that with Thold and Uptime plugins.
NetAdmin
Cacti User
Posts: 98
Joined: Wed Aug 30, 2006 8:45 pm

Post by NetAdmin »

Discovered that the problem is with the top_graph_header.php file. I simply replaced that file with the one from PA 2.3 and it's working great now.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

Yeah, if you look at the HTML output, it has PHP error in it:

Code: Select all

><a href="/cacti-0.8.7d/graph_view.php?action=preview"><img src="/cacti-0.8.7d/images/tab_mode_preview<br />
<b>Notice</b>:  Undefined index:  action in <b>/var/www/wotsit/docs/cacti-0.8.7d/include/top_graph_header.php</b> on line <b>102</b><br />
.gif" 
since it's the same error about action not being defined, I guess something's amiss somewhere else, and you don't really need my fix if the other thing was working right.
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!)
cigamit
Developer
Posts: 3369
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

I think its more of a Cacti bug, that you don't see unless you use a plugin. No core file should be using $_Request without first checking that it exists. I need to see when that change was made.
Sn4kY
Posts: 2
Joined: Thu Feb 19, 2009 4:17 am

Post by Sn4kY »

Hi all

I found another way to fix this "bug".

On your URL bar, if you type "cacti/plugins/weathermap/weathermap-cacti-plugin.php?action=" there is no php notice.

To make this fix permanently, just edit the "cacti/plugins/weathermap/setup.php", go to line 80, or search the line who contains :
"if (basename($_SERVER["PHP_SELF"]) != "weathermap-cacti-plugin.php")"

and just add "?action=" like this : "weathermap-cacti-plugin.php?action="

Well it works fine !

cheers
cgreves
Posts: 1
Joined: Fri Feb 27, 2009 8:39 am

Post by cgreves »

Quick dirty fix for the broken Tree View, List View, Preview View images in the upper right corner. No gurantees...not sure what this could break....not sure this is the correct fix....might be a better place for this....blah blah blah. Simply checking if $_REQUEST is set before trying to read it. I'm going to guess there is a more global place for this, but until there's an office fix this is what I'm using.

Replace line 102 in ./include/top_graph_header.php with:

<?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["graph_settings"] == "on")) { print '<a href="'. $config['url_path'] . 'graph_settings.php"><img src="'. $config['url_path'] . 'images/tab_settings'; if (basename($_SERVER["PHP_SELF"]) == "graph_settings.php") { print "_down"; } print '.gif" border="0" alt="Settings" align="absmiddle"></a>';}?>&nbsp;&nbsp;<?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["show_tree"] == "on")) { print '<a href="'. $config['url_path'] . 'graph_view.php?action=tree"><img src="' . $config['url_path'] . 'images/tab_mode_tree'; if (isset($_REQUEST["action"])) {if ($_REQUEST["action"] == "tree") { print "_down"; }} print '.gif" border="0" title="Tree View" alt="Tree View" align="absmiddle"></a>';}?><?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["show_list"] == "on")) { print '<a href="'. $config['url_path'] . 'graph_view.php?action=list"><img src="' . $config['url_path'] . 'images/tab_mode_list'; if (isset($_REQUEST["action"])) {if ($_REQUEST["action"] == "list") { print "_down"; }} print '.gif" border="0" title="List View" alt="List View" align="absmiddle"></a>';}?><?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["show_preview"] == "on")) { print '<a href="'. $config['url_path'] . 'graph_view.php?action=preview"><img src="' . $config['url_path'] . 'images/tab_mode_preview'; if (isset($_REQUEST["action"])) {if ($_REQUEST["action"] == "preview") { print "_down"; }} print '.gif" border="0" title="Preview View" alt="Preview View" align="absmiddle"></a>';}?>

Thanks for the great work guys. Cacti is invaluable.

CG
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests