Force the use of 64-Bit counters using Discovery Plugin

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
sluke
Posts: 22
Joined: Mon Apr 21, 2008 2:49 pm

Force the use of 64-Bit counters using Discovery Plugin

Post by sluke »

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!
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Moved to the plugin session.
Please consider posting this to the forum at http://cactiusers.org
Reinhard
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

Hum... I will have to look into this. Honestly, I think the Cacti Host Template should be saving whether you want a 32, 64, or whatever, and what type of indexing you want. I will have to think about this for a bit.
sluke
Posts: 22
Joined: Mon Apr 21, 2008 2:49 pm

Post by sluke »

Is there an easy way to show what's using 32b and what's using 64b?

Maybe I can start there and confirm that it's grabbing the right MIBs to poll.

From the testing I've done most V2 devices end up using 32b but have 64bit when I add/change them manually.
crazybdr
Posts: 6
Joined: Fri Oct 31, 2008 4:49 pm

Force the use of 64-Bit counters using Discovery Plugin

Post by crazybdr »

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.
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

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
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?
crazybdr
Posts: 6
Joined: Fri Oct 31, 2008 4:49 pm

thanks

Post by crazybdr »

Thanks for the quick reply, I'll take a look at the code and try to find that. Thanks a lot.
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

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
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?
User avatar
Vins
Cacti User
Posts: 116
Joined: Tue Sep 12, 2006 3:06 am

Post by Vins »

Interesting... will try and report

:roll:
crazybdr
Posts: 6
Joined: Fri Oct 31, 2008 4:49 pm

Post by crazybdr »

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!
sluke
Posts: 22
Joined: Mon Apr 21, 2008 2:49 pm

Post by sluke »

This worked for me, thanks!
hansm
Posts: 3
Joined: Sat Jul 02, 2011 9:53 am

Re: Force the use of 64-Bit counters using Discovery Plugin

Post by hansm »

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!
hansm
Posts: 3
Joined: Sat Jul 02, 2011 9:53 am

Re: Force the use of 64-Bit counters using Discovery Plugin

Post by hansm »

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.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests