Force the use of 64-Bit counters using Discovery Plugin
Moderators: Developers, Moderators
Force the use of 64-Bit counters using Discovery Plugin
When I add a device using the discovery plugin it seems to grab/use the 32-but traffic in/out instead of the 64-bit.
Is there a way to force the use of 64-bit counters?
I have it setup as a snmpv2
TIA!
Is there a way to force the use of 64-bit counters?
I have it setup as a snmpv2
TIA!
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Moved to the plugin session.
Please consider posting this to the forum at http://cactiusers.org
Reinhard
Please consider posting this to the forum at http://cactiusers.org
Reinhard
Force the use of 64-Bit counters using Discovery Plugin
Did anyone ever figure this out? We've got an installation of about 3000 devices. We added them all with discovery which automatically made them 32bit counters, but when cross referencing with other traffic monitoring systems we saw something was wrong. After much investigation we found out that the 32 bit counters were overflowing twice within the 5 minute polling period (which happens around 114Mbps).
We've got plenty of devices that we know go over this rate all the time, so we'd like to just re-discover everything and have it use 64bit counters instead of 32bit anybody have ideas...
I'm guessing it can be done with a discovery template somehow but I haven't really figured it out what that template would say to make it use 64bit counters (I know how to use discovery templates, I just don't know how to make a template use 64 bit counters). Thanks guys.
We've got plenty of devices that we know go over this rate all the time, so we'd like to just re-discover everything and have it use 64bit counters instead of 32bit anybody have ideas...
I'm guessing it can be done with a discovery template somehow but I haven't really figured it out what that template would say to make it use 64bit counters (I know how to use discovery templates, I just don't know how to make a template use 64 bit counters). Thanks guys.
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
You would have to change the Data Query Graph Id in the plugin to point to the correct one. I don't know the plugin, but I'm sure it's not too hard.
TheWitness
TheWitness
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
That's the magic. The table that contains the data_query_graph_id (it's not called that, it's just the ID of that table) is snmp_query_graph. So, the trick is, in that table find the id of the 32bit graph and search through the discover plugin for that id and column. Then change it in the plugin to the correct one. Don't guess, but good luck.
TheWitness
TheWitness
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Alright, so I've finally found some time to work on this and I wanted to post my findings for others to use.
In the file findhosts.php is where the changes need to be made.
findhosts.php is the script that runs during the polling cycle, this is when the discovery plugin adds the new graphs. So in our setup we have Discovery set up to run once a day around midnight. So day 1 it runs and finds Host B. The next morning I come into work and click the add button next to Host B. Host B is then added as a device, but currently has no graphs. At midnight when the discovery polling runs again, it sees that I have added a host and will add all the appropriate graphs for this host.
The function that does the graph adding is called discover_create_graphs around line 535 of findhosts.php (at least in my copy of the file).
To figure out which "data_query_graph_id" to use, the function grabs all the snmp_query_graph table data and sorts it by name (an example name would be "In/Out Bits"). In my case (and anyone else who hasn't screwed with too much) In/Out Bits ends up being the first in the sort order where snmp_query_id is = 1, meaning In/Out Bits will always be used. So the easy fix is to change the entries name in the sql table to sort before the others, but I did this instead...
Commented out:
$sgraphs['sgg_' . $snmp_query["id"]] = $data_query_graphs[0]['id'];
and put this in its place:
$sgraphs['sgg_' . $snmp_query["id"]] = 14;
14 is the id that related to the snmp query graph with 64 bit counters.
This fix has worked for me. maybe in the future this can be something built into the discovery settings (I didn't have time to make it pretty yet).
Hope this helps other people!
In the file findhosts.php is where the changes need to be made.
findhosts.php is the script that runs during the polling cycle, this is when the discovery plugin adds the new graphs. So in our setup we have Discovery set up to run once a day around midnight. So day 1 it runs and finds Host B. The next morning I come into work and click the add button next to Host B. Host B is then added as a device, but currently has no graphs. At midnight when the discovery polling runs again, it sees that I have added a host and will add all the appropriate graphs for this host.
The function that does the graph adding is called discover_create_graphs around line 535 of findhosts.php (at least in my copy of the file).
To figure out which "data_query_graph_id" to use, the function grabs all the snmp_query_graph table data and sorts it by name (an example name would be "In/Out Bits"). In my case (and anyone else who hasn't screwed with too much) In/Out Bits ends up being the first in the sort order where snmp_query_id is = 1, meaning In/Out Bits will always be used. So the easy fix is to change the entries name in the sql table to sort before the others, but I did this instead...
Commented out:
$sgraphs['sgg_' . $snmp_query["id"]] = $data_query_graphs[0]['id'];
and put this in its place:
$sgraphs['sgg_' . $snmp_query["id"]] = 14;
14 is the id that related to the snmp query graph with 64 bit counters.
This fix has worked for me. maybe in the future this can be something built into the discovery settings (I didn't have time to make it pretty yet).
Hope this helps other people!
Re: Force the use of 64-Bit counters using Discovery Plugin
Hi,
Thanks this also works for me. But is discovered only the data templates are 64-bits now. The graph templates are still using the normal In/Out bits graph template and not the In-/Out bits (64-bits).
For changes for Data output (visible into Graph Management) i must change the data template into data Collection Methods > Data Queries > SNMP Interface statistics > In/Out Bits (64-bit Counters)
For changes for Graph titles (visible into the graphs themselfs) i must change the graph template into the 'Standard' In/Out Bits template.
It has something to do with the snmp_query_graph_id to which the descriptions of the templates are linked.
I'm using CentOS 4.9
Cacti 0.8.7g
Discovery plugin 1.1
So what must i change into the findhosts.php to let Discover also choose the good Graph template?
Thanks!
Thanks this also works for me. But is discovered only the data templates are 64-bits now. The graph templates are still using the normal In/Out bits graph template and not the In-/Out bits (64-bits).
For changes for Data output (visible into Graph Management) i must change the data template into data Collection Methods > Data Queries > SNMP Interface statistics > In/Out Bits (64-bit Counters)
For changes for Graph titles (visible into the graphs themselfs) i must change the graph template into the 'Standard' In/Out Bits template.
It has something to do with the snmp_query_graph_id to which the descriptions of the templates are linked.
I'm using CentOS 4.9
Cacti 0.8.7g
Discovery plugin 1.1
So what must i change into the findhosts.php to let Discover also choose the good Graph template?
Thanks!
Re: Force the use of 64-Bit counters using Discovery Plugin
It has something to do with the poller_graphs_reapply_names.php which had a bug in it and always reapply to 32 bit graphs.
I also noticed 64-bit graphs are not always worked on FastEthernet Cisco interfaces from routers.
I also noticed 64-bit graphs are not always worked on FastEthernet Cisco interfaces from routers.
Who is online
Users browsing this forum: No registered users and 3 guests