Fix 64bit counters in Interface Traffic graphs

Announcements concerning Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
shd
Cacti User
Posts: 96
Joined: Mon Apr 09, 2007 1:33 pm
Location: Nizhnevartovsk, Russia

Fix 64bit counters in Interface Traffic graphs

Post by shd »

Sometimes you want to convert some interfaces from 32bit interface counters to 64bit. Normally you should go in Data Sources page, find data source for wanted graph, change its input type, then reset maximum in rrd file, then reset the maximum in database. Too many movements. To automate this I made little plugin - Fix 64bit Counters.

With this plugin you only click on image near the graph you want to convert, and all the dirty work is made by script.

Installation is simple, like any other plugin - just copy its folder in plugins directory, enable it in Plugin Management, then give rights to users in User Management, then go to Settings/Misc, check settings to be like in the screenshot and hit Save:

Hit save for one time even if settings from the beginning are totally like in the screenshot - just in case.

Also you can choose graphs to convert in the “Graph Management” page. Just select needed graphs, choose a “Fix 64bit Counters” action in dropdown and hit “Ok”.
If graphs could not be converted, you will receive corresponding message and when you press “Continue” it will fix all the graphs that it can fix.
Image

Fixing process is performed after the next run of poller (this is due to the need to edit rrd file), so 64bit counters are begin to work only after two polls. Checks are rather thorough, plugin checks SNMP version (it should be 2 or greater) and every SNMP query constraints.

May be this plugin would save a day or two for someone.

Icon is from FamFamFam Silk Icons.

ChangeLog

--- 0.5 ---
Cacti 1.0 compatibility

--- 0.4 ---
Updated graphs spiking fix (thanks, mitchese!)
update_poller_cache fix for Cacti 8.8.a (thanks, mitchese!)

--- 0.3 ---
Added mass graph fixing through the “Graph Management” page.
Uninstall and then reinstall plugin to use this functionality.

--- 0.2 ---
Replaced short tags "<?" with long tags "<?php"
Code cleanup

--- 0.1 ---
Initial release


Plugin page: http://docs.cacti.net/userplugin:fix64bit
Plugin github page: https://github.com/simnv/fix64bit
Attachments
fix64bit-0.5.tar.gz
not properly tested
(7.93 KiB) Downloaded 602 times
fix64bit-0.4.tar.gz
(7.95 KiB) Downloaded 1725 times
Last edited by shd on Thu Mar 22, 2018 11:32 pm, edited 8 times in total.
CentOS 64-bit, 20Gb RAM, 8xCPU, some virtual datastore. 600+ hosts, 200k+ datasources, avg polltime 45 sec
User avatar
Linegod
Developer
Posts: 1626
Joined: Thu Feb 20, 2003 10:16 am
Location: Canada
Contact:

Post by Linegod »

Nice.

If you get a chance, please post this to the Plugin are of the Docs site:

http://docs.cacti.net/plugins
http://docs.cacti.net/plugins.guidelines
--
Live fast, die young
You're sucking up my bandwidth.

J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Fix 64bit counters in Interface Traffic graphs

Post by gandalf »

shd wrote:May be this plugin would save a day or two for someone.
Yes, this is quite sure. I will go and have a try. I support Howies request to post it as advised.
R.
shd
Cacti User
Posts: 96
Joined: Mon Apr 09, 2007 1:33 pm
Location: Nizhnevartovsk, Russia

Post by shd »

Linegod wrote:If you get a chance, please post this to the Plugin are of the Docs site:
http://docs.cacti.net/plugins
http://docs.cacti.net/plugins.guidelines
Done:
http://docs.cacti.net/userplugin:fix64bit
CentOS 64-bit, 20Gb RAM, 8xCPU, some virtual datastore. 600+ hosts, 200k+ datasources, avg polltime 45 sec
User avatar
JorisFRST
Cacti User
Posts: 229
Joined: Mon Oct 02, 2006 1:22 pm
Location: Belgium
Contact:

Post by JorisFRST »

Tried it for a few and get for my windows boxes :

04/15/2010 05:05:04 PM - CMDPHP: Poller[0] Host[13] Description[ZELS2012 - PB] DS[107] Graphs['ZELS2012 - PB - Traffic - 172.21.100.121 (Broadcom NetXtreme Gigabit Ethernet Driver)'] WARNING: Result from SNMP not valid. Partial Result: U
04/15/2010 05:05:04 PM - CMDPHP: Poller[0] Host[13] Description[ZELS2012 - PB] DS[107] Graphs['ZELS2012 - PB - Traffic - 172.21.100.121 (Broadcom NetXtreme Gigabit Ethernet Driver)'] WARNING: Result from SNMP not valid. Partial Result: U

Looked at the poller cache, then tried snmpget :

[root@cacticentos ~]# snmpget -v 2c -c brad1 zels2012.brc.gbl .1.3.6.1.2.1.31.1.1.1.10.16777220
IF-MIB::ifHCOutOctets.16777220 = No Such Object available on this agent at this OID

Any quick way I can fix it and revert back to the old counters ?

Joris.
shd
Cacti User
Posts: 96
Joined: Mon Apr 09, 2007 1:33 pm
Location: Nizhnevartovsk, Russia

Post by shd »

JorisFRST wrote:[root@cacticentos ~]# snmpget -v 2c -c brad1 zels2012.brc.gbl .1.3.6.1.2.1.31.1.1.1.10.16777220
IF-MIB::ifHCOutOctets.16777220 = No Such Object available on this agent at this OID
Looks like some problem with SNMP on that box.
JorisFRST wrote:Any quick way I can fix it and revert back to the old counters ?
Just go to settings/misc and set appropriate "SNMP query to search" and "Desired SNMP query".
CentOS 64-bit, 20Gb RAM, 8xCPU, some virtual datastore. 600+ hosts, 200k+ datasources, avg polltime 45 sec
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

shd wrote:
JorisFRST wrote:[root@cacticentos ~]# snmpget -v 2c -c brad1 zels2012.brc.gbl .1.3.6.1.2.1.31.1.1.1.10.16777220
IF-MIB::ifHCOutOctets.16777220 = No Such Object available on this agent at this OID
Looks like some problem with SNMP on that box.
No and yes. It's windows, you know. No 64 bit counters, you know (at least to my knowledge). If you don't trust me, ask in the windows forum. BSOD2600 knows better
R.
User avatar
JorisFRST
Cacti User
Posts: 229
Joined: Mon Oct 02, 2006 1:22 pm
Location: Belgium
Contact:

Post by JorisFRST »

Yeah, my own fault with beeing a bit to enthiousast clicking the fix button...
Should have engaged my brain first
cabsalon
Posts: 12
Joined: Tue Apr 13, 2010 9:47 am

Post by cabsalon »

Hello
Do you know if there is a solution for windows.
because 40% of my server are on remote site with non manageable switch, and so i can only monitor network on server interface.

thanks
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

cabsalon wrote:Hello
Do you know if there is a solution for windows.
because 40% of my server are on remote site with non manageable switch, and so i can only monitor network on server interface.

thanks
Please open a thread in the windows forum. There are the guys that know better ...
R.
User avatar
Sirup
Cacti Moderator
Posts: 348
Joined: Tue Mar 02, 2010 9:03 am

Post by Sirup »

Nice Plugin!
[size=67]Cacti version: 0.8.7e5
OS: FreeBSD 7.2
Plugin Architecture: 2.6
Plugins: aggregate 0.74, autom8 0.33, loginmod 1.0

[url=http://docs.cacti.net/manual:087]Official Cacti Documentation[/url]
[url=http://docs.cacti.net/manual:087:4_help.2_debugging#debugging]Gandalfs Official Debugging Help[/url]
[/size]
shd
Cacti User
Posts: 96
Joined: Mon Apr 09, 2007 1:33 pm
Location: Nizhnevartovsk, Russia

Post by shd »

Sirup wrote:I installed the plugin, enabled it in the plugin managament tab and granted the rights in the user tab. also checked the settings in settings/misc.
but there is no icon showing up next to the graphs? :-?
icon shows up only near graph that complies to "SNMP Query to Search" parameter. for example, it won't show up near the 64bit graphs if you are looking for the ordinary graphs.
CentOS 64-bit, 20Gb RAM, 8xCPU, some virtual datastore. 600+ hosts, 200k+ datasources, avg polltime 45 sec
User avatar
Sirup
Cacti Moderator
Posts: 348
Joined: Tue Mar 02, 2010 9:03 am

Post by Sirup »

mhm - there is snmpv2 enable for this host..
Attachments
Unbenannt.jpg
Unbenannt.jpg (99.47 KiB) Viewed 53460 times
Last edited by Sirup on Thu May 06, 2010 3:02 am, edited 1 time in total.
[size=67]Cacti version: 0.8.7e5
OS: FreeBSD 7.2
Plugin Architecture: 2.6
Plugins: aggregate 0.74, autom8 0.33, loginmod 1.0

[url=http://docs.cacti.net/manual:087]Official Cacti Documentation[/url]
[url=http://docs.cacti.net/manual:087:4_help.2_debugging#debugging]Gandalfs Official Debugging Help[/url]
[/size]
shd
Cacti User
Posts: 96
Joined: Mon Apr 09, 2007 1:33 pm
Location: Nizhnevartovsk, Russia

Post by shd »

Sirup wrote:found little "bug". i konw the reason why the plugin is not working here - but maybe there shouldn't be all that code inside the pop up window.
replace "<?" with "<?php" in script bodies.
or just make php to be not so strict with script boundaries by editing php.ini
CentOS 64-bit, 20Gb RAM, 8xCPU, some virtual datastore. 600+ hosts, 200k+ datasources, avg polltime 45 sec
shd
Cacti User
Posts: 96
Joined: Mon Apr 09, 2007 1:33 pm
Location: Nizhnevartovsk, Russia

Post by shd »

Code: Select all

short_open_tag = On
CentOS 64-bit, 20Gb RAM, 8xCPU, some virtual datastore. 600+ hosts, 200k+ datasources, avg polltime 45 sec
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests