|
|
| Author |
Message |
Talon_Karrde
Joined: 17 Sep 2007 Posts: 8 Location: Moers, Germany
|
Posted: Wed Feb 20, 2008 7:07 am Post subject: Ineffective use of Scripts for indexed data |
|
|
Hallo,
so this is my first Post - please be patient with me.
I hope my english is comfortable enough.
I was fooling around with the scripting stuff in cacti,
when I recognized that my script is called with the "get" parameter for every OID.
So if I monitor a switch with 48 ports and I only want to see "in" and "out" octets the script is called 96 times. I think this is not very effective.
Is this a normal behavior?
And if so, are there any attempts to change this to use "query" instead of "get" ?
I'm using cacti 0.8.6j on a debian linux machine with al actual patches applied.
Thanks for any comment.
Werner |
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 2162 Location: United Kingdom
|
Posted: Wed Feb 20, 2008 8:29 am Post subject: |
|
|
Why are you using a script to get the interface OID? Is your switch non-standard?
You should be able to just use the normal SNMP Interface Traffic template and not run any script at all...
With Spine, the poller will combine multiple GET requests into a single request, for SNMP queries (not for scripts). The maximum is set in the Settings..Poller page: "Maximum SNMP OID's Per SNMP Get Request".
Of course, none of that answers your question, but you can avoid the problem  |
|
| Back to top |
|
 |
Talon_Karrde
Joined: 17 Sep 2007 Posts: 8 Location: Moers, Germany
|
Posted: Thu Feb 21, 2008 11:06 am Post subject: |
|
|
Thanks for your fast reply!
Ok this is a bit complicated - the switch is standard
and on the other hand it is not.
Its some kind of Alteon stuff ;o)
If you are interested in, I will explain in detail..
So you are right, this is not an answer to my question.
This question has a more general meaning, because I've some Ideas for scripts and
I would like to know about the behavior before I put energy in developing scripts
wich then slow down my system.
Kind Regards
Werner |
|
| Back to top |
|
 |
gandalf Developer
Joined: 02 Dec 2004 Posts: 12275 Location: Muenster, Germany
|
Posted: Thu Feb 21, 2008 4:16 pm Post subject: |
|
|
Your original post describes it correctly. This is kind of intended behaviour, because it mimics the way snmp does the work.
BTB: We also use Alteons (in fact, if I remember correctly I posted some templates years ago). Please explain in which way you assume that pure SNMP does not fit
Reinhard |
|
| Back to top |
|
 |
Talon_Karrde
Joined: 17 Sep 2007 Posts: 8 Location: Moers, Germany
|
Posted: Fri Feb 22, 2008 3:20 am Post subject: |
|
|
Hallo Gandalf,
when you say "this is the way snmp works" it doesn't really apply to my problem.
So let me give you an example.
When I choose verbose query in the device section for my script - it is called by cacti with the "query" parameter.
This then invokes a snmpwalk inside my script for the indexed OIDs.
Everything is fine, the script is called only once per OID.
So why doesn't cacti call the script again with "query" for the data gathering of indexed OIDs
instead of start the script with "get" for every index?
OK, now to the alteon things.
I've seen and tested your Templates and some of them works fine.
They also told me a lot of creating own templates.
So let me say "good work".
But especially for interface statistics I'm not satisfied.
Alteons doesn't use the same index for standard interface mib and private "port" mib.
But the private mib is the only way to get correct "Port Names" out of the alteon.
Sadly I didn't found an 64bit counter variable in the private mibs so that I can get correct
statistics for the gigabit ports.
In this case I think I've two chances.
First I make to different queries, on for normal and one for gigabit statistics.
Or second I write my own script and do some calculations for the indices inside the script.
Hope this makes it a bit clear why I'm hunting after this script stuff.
But maybe someone has an additional alternative for me which I don't hit on.
Many thanks
Werner |
|
| Back to top |
|
 |
gandalf Developer
Joined: 02 Dec 2004 Posts: 12275 Location: Muenster, Germany
|
Posted: Fri Feb 22, 2008 6:28 am Post subject: |
|
|
Ok, I understand your Alteon issue, then. And I accept, that script is the only way to get it. I asked, because if some few lines of code would extend SNMP options, I'd be willing to go for them.
For the performance issue, a feature request would be best
Reinhard |
|
| Back to top |
|
 |
Talon_Karrde
Joined: 17 Sep 2007 Posts: 8 Location: Moers, Germany
|
Posted: Mon Feb 25, 2008 4:39 am Post subject: |
|
|
Hallo Gandalf,
thanks for your for your advice.
So I will post a feature request.
C U
Werner |
|
| Back to top |
|
 |
|