Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


Cacti 0.8.7 and weathermap 0.93 Undefined index?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cacti Forum Index -> Plugin: (Network Weather Map)
Author Message
viper8



Joined: 29 Oct 2007
Posts: 5

PostPosted: Wed Oct 31, 2007 11:06 am    Post subject: Cacti 0.8.7 and weathermap 0.93 Undefined index? Reply with quote

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
Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 2059
Location: United Kingdom

PostPosted: Wed Oct 31, 2007 12:48 pm    Post subject: Reply with quote

Are you running Cacti with and authentcation method of No Auth?
Back to top
rony
Developer/Forum Admin


Joined: 17 Nov 2003
Posts: 5398
Location: Wisconsin, USA

PostPosted: Wed Oct 31, 2007 1:50 pm    Post subject: Reply with quote

He might be and not even know it..

Stupid upgrade bug, my fault...
Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 2059
Location: United Kingdom

PostPosted: Wed Oct 31, 2007 1:58 pm    Post subject: Reply with quote

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

Stupid upgrade bug, my fault...


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.
Back to top
viper8



Joined: 29 Oct 2007
Posts: 5

PostPosted: Wed Oct 31, 2007 2:14 pm    Post subject: Reply with quote

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

For the record...I upgraded from 0.8.6i right to 0.8.7 and all went well except for this minor hiccup.
Back to top
rony
Developer/Forum Admin


Joined: 17 Nov 2003
Posts: 5398
Location: Wisconsin, USA

PostPosted: Wed Oct 31, 2007 3:18 pm    Post subject: Reply with quote

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.
Back to top
dave99



Joined: 17 Mar 2006
Posts: 17

PostPosted: Tue Mar 11, 2008 11:11 pm    Post subject: Reply with quote

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
Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 2059
Location: United Kingdom

PostPosted: Wed Mar 12, 2008 3:40 am    Post subject: Reply with quote

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?
Back to top
dave99



Joined: 17 Mar 2006
Posts: 17

PostPosted: Wed Mar 12, 2008 9:54 am    Post subject: Reply with quote

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.
Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 2059
Location: United Kingdom

PostPosted: Wed Mar 12, 2008 9:59 am    Post subject: Reply with quote

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'?
Back to top
dave99



Joined: 17 Mar 2006
Posts: 17

PostPosted: Wed Mar 12, 2008 10:55 am    Post subject: Reply with quote

Howie wrote:
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'?


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).
Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 2059
Location: United Kingdom

PostPosted: Wed Mar 12, 2008 12:28 pm    Post subject: Reply with quote

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.
Back to top
dave99



Joined: 17 Mar 2006
Posts: 17

PostPosted: Wed Mar 12, 2008 12:45 pm    Post subject: Reply with quote

What I've done is go through and replace the instances of
Code:
userid=".$_SESSION["sess_user_id"]."

with
Code:
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.
Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 2059
Location: United Kingdom

PostPosted: Sat Mar 15, 2008 1:38 pm    Post subject: Reply with quote

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...
Back to top
dave99



Joined: 17 Mar 2006
Posts: 17

PostPosted: Mon Mar 17, 2008 10:36 am    Post subject: Reply with quote

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.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Plugin: (Network Weather Map) All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 



Powered by phpBB © 2001, 2005 phpBB Group