Cacti 0.8.7 and weathermap 0.93 Undefined index?

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

viper8
Posts: 6
Joined: Mon Oct 29, 2007 2:44 pm

Cacti 0.8.7 and weathermap 0.93 Undefined index?

Post by viper8 »

With cacti 0.8.7, plugin arch 1.3 and weathermap 0.93 I get the following error:

Notice: Undefined index: sess_user_id in /usr/share/cacti/plugins/weathermap/setup.php on line 251

I've seen this on other plugins until I upgraded them to their latest versions.

Any ideas?

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

Post by Howie »

Are you running Cacti with and authentcation method of No Auth?
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
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

He might be and not even know it.. :(

Stupid upgrade bug, my fault... :evil:
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

rony wrote:He might be and not even know it.. :(

Stupid upgrade bug, my fault... :evil:
Then again, I suppose the same thing must happen in 0.8.6j if you turn off the built-in authentication? I've never wanted to give the world access to my Cacti, so I've probably never tested that.
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!)
viper8
Posts: 6
Joined: Mon Oct 29, 2007 2:44 pm

Post by viper8 »

Wowww...thanks guys! I didn't even realize that was an option in the new version. I set it to use built-in auth and it's all good now!

Appreciate the feedback :D

For the record...I upgraded from 0.8.6i right to 0.8.7 and all went well except for this minor hiccup.
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

There is a bug in the upgrade that if you have never saved your Authentication settings, IE, clicked save while on the tab, it will improperly default to "No Authentication" when upgrading to 0.8.7.

This has been repaired in the upgrade scripts, but has little effect on users who have upgraded.

0.8.7a will not have this problem. :o
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
dave99
Posts: 26
Joined: Fri Mar 17, 2006 11:12 pm

Post by dave99 »

I'm running into a similar problem, I've set cacti auth to none, as I have an external authentication wrapper. Is there an option to use weathermap in this method? I've made a couple of hacks to get rid of the warnings that have come up, but they aren't an ideal fix, and I'm not sure if I'm leaving underlying problems.
thanks
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

dave99 wrote:I'm running into a similar problem, I've set cacti auth to none, as I have an external authentication wrapper. Is there an option to use weathermap in this method? I've made a couple of hacks to get rid of the warnings that have come up, but they aren't an ideal fix, and I'm not sure if I'm leaving underlying problems.
thanks
If you have external authentication, how does Cacti know which user you are? Or do you just have all users treated the same?
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!)
dave99
Posts: 26
Joined: Fri Mar 17, 2006 11:12 pm

Post by dave99 »

Howie wrote:
dave99 wrote:I'm running into a similar problem, I've set cacti auth to none, as I have an external authentication wrapper. Is there an option to use weathermap in this method? I've made a couple of hacks to get rid of the warnings that have come up, but they aren't an ideal fix, and I'm not sure if I'm leaving underlying problems.
thanks
If you have external authentication, how does Cacti know which user you are? Or do you just have all users treated the same?
All the same, admin for everyone. The external wrapper (which is groundwork), would determine if the user is able get to cacti.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

dave99 wrote:
Howie wrote:
dave99 wrote:I'm running into a similar problem, I've set cacti auth to none, as I have an external authentication wrapper. Is there an option to use weathermap in this method? I've made a couple of hacks to get rid of the warnings that have come up, but they aren't an ideal fix, and I'm not sure if I'm leaving underlying problems.
thanks
If you have external authentication, how does Cacti know which user you are? Or do you just have all users treated the same?
All the same, admin for everyone. The external wrapper (which is groundwork), would determine if the user is able get to cacti.
OK, and Cacti sees you as the user called 'admin'? or as 'guest'?
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!)
dave99
Posts: 26
Joined: Fri Mar 17, 2006 11:12 pm

Post by dave99 »

Howie wrote:
dave99 wrote:
Howie wrote: If you have external authentication, how does Cacti know which user you are? Or do you just have all users treated the same?
All the same, admin for everyone. The external wrapper (which is groundwork), would determine if the user is able get to cacti.
OK, and Cacti sees you as the user called 'admin'? or as 'guest'?
That I'm not sure of, if you disable cacti's builtin auth, does it see the user as anything? (I would think it would be admin, but I'm not sure).
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

dave99 wrote:
That I'm not sure of, if you disable cacti's builtin auth, does it see the user as anything? (I would think it would be admin, but I'm not sure).
OK, I'll have a little play. I'm not too surprised that it gets upset, but I'll see if I can see a way to get around it.
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!)
dave99
Posts: 26
Joined: Fri Mar 17, 2006 11:12 pm

Post by dave99 »

What I've done is go through and replace the instances of

Code: Select all

userid=".$_SESSION["sess_user_id"]."
with

Code: Select all

userid='1'
Maybe an easy fix would be to query the DB, and if the auth level is set at 0, then to set the session variable to the admin user. That would avoid having to change a config file or edit any of the code. I think anyway, my php skills are pretty non-existent.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

I've just taken a look at this, and I still don't quite understand how Cacti is integrated into GWOS.

When you add a new cacti plugin, what user do you need to give the right to, to see the tab?

What your change does is just force the user to always be admin, which generally isn't the 'right thing'. However, I would have expected with auth turned off, that you'd get the guest user as your userid...
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!)
dave99
Posts: 26
Joined: Fri Mar 17, 2006 11:12 pm

Post by dave99 »

There are only 2 cacti users in my setup, admin & guest. It appears that guest can only view graphs and nothing more. When adding a plugin, I add the permissions to the admin user. With cacti auth off, it appears the concept of users disappears, the sess_user_id variable just doesn't get set anymore. The authentication I use with groundwork is really secondary to this, it doesn't affect cacti at all, it's tied into apache. As far as cacti knows, it is just sitting there by itself with it's built-in authentication off.

What seems to be a cleaner fix is to put your original file back, and in auth.php add a section that checks if the authentication method is 0, if so then go ahead and set the sess_user_id=1.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest