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    


A couple of time eaters

 
Post new topic   Reply to topic    Cacti Forum Index -> Plugin: (Network Weather Map)
Author Message
colejv



Joined: 19 Mar 2008
Posts: 17

PostPosted: Fri Aug 22, 2008 12:44 pm    Post subject: A couple of time eaters Reply with quote

I thought I would post a couple of problems I have experienced that had me puzzled for a while, they both are a result of sloppy typing and are time consuming because I have 90 "main" nodes and tend to make changes in bulk and tweak bit here and there when I am scrolling by (2500 lines in the config).

The first one is 96 only, so far I have done it twice about three weeks apart (long enough for me to forget what caused the problem).

If you call an undefined template weathermap stops working
no new maps are generated and the log plugin for cacti displays a php error when you attempt to access it

the first time I did it was a just a regular typo, the second the time I title cased the template name so I had TEMPLATE temp defined and called TEMPLATE Temp

The other time killer is caused by blank spaces, I followed the excellent tutorial on displaying host status and 5 or 6 of my hosts did not work, I really went overboard trying to figure out why, before I finally noticed the extra character space using the arrow keys, apparently I had hit the space bar after typing out

Code:
set cacti_id 20


so there was a single space after the 20
Back to top
Howie
Cacti Guru User


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

PostPosted: Fri Aug 22, 2008 1:53 pm    Post subject: Reply with quote

OK. Both of those could be dealt with better

I can't see any problem with always trimming trailing spaces, can you?
Back to top
colejv



Joined: 19 Mar 2008
Posts: 17

PostPosted: Sat Aug 23, 2008 5:17 pm    Post subject: Reply with quote

No I can't see a problem with eliminating trailing spaces, and I did not mention it but one of the problems I had was a trailing tab, in php using trim() would take care of all of it (leading,trailing space/tab/cr) but may not work out in some instances.

That being said, for an application like this I think users should be aware of this type of issue, but not expect the code to fix their sloppiness for them.

To me not fixing the problem with code allows the application to scale further on less resources, now if the fix was a one time deal the config was adjusted once to strip white spaces then ok, but if fixing it chews up clock cycles every time the app runs then I am against it.

I am I making any sense here?

What does everyone else think?
Back to top
Howie
Cacti Guru User


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

PostPosted: Sat Aug 23, 2008 5:29 pm    Post subject: Reply with quote

It's just a case of tweaking the regexps that are used to match the config commands so they don't pick up the spaces in the first place. It's simple enough to say "everything apart from whitespace on the end" instead of "everything on the end". Considering how much other stuff is going on in a weathermap run (e.g. either running dozens of rrdtool processes or dozens of mysql queries), I don't think it's an efficiency issue.
Back to top
colejv



Joined: 19 Mar 2008
Posts: 17

PostPosted: Sat Aug 23, 2008 5:36 pm    Post subject: Reply with quote

Well obviously I defer

By the way GREAT product
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
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group