Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Tue Aug 22, 2017 7:39 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 142 posts ]  Go to page 1, 2, 3, 4, 5 ... 10  Next
Author Message
 Post subject: MIB Protocol Statistics (RFC1213) [v2.1 - 2009-05-10]
PostPosted: Sat Dec 17, 2005 9:56 pm 
Offline
Cacti Moderator
User avatar

Joined: Sat May 08, 2004 12:44 pm
Posts: 12130
Location: USA
** MIB Protocol Statistics (RFC1213) **
Created by BSOD2600

-Notes-

These scripts get the various detailed protocol statistics for IP / TCP / UDP / SNMP. Since it polls the standard RFC1213-MIB objects, these should work on any SNMP networked device. The graphs are formatted to show the data 'per 5 minutes'. I did this because the standard output just wasn't as meaningful / pretty.


-Installation-

1) Drop RFC1213.xm into your \cacti\resources\snmp_queries\ folder.
2) Import the data query templates from \templates
3) Add the RFC1213 Statistics Data Query to a device.
4) From the 'Create Graphs for this Host' screen, select the protocol types and click Create.


-Changelog-

2.1 - Fixed graph template data source selection issues (Fixed IP graph template. Re-created SNMP graph template).
2.0 - Rewrite of the scripts ditching the Script server for pure/fast SNMP Data Query. Delete the ss_protocol* scripts from your \cacti\scripts\ folder. Delete the various *protocol statistics Data Input Methods. The Data templates remain the same, so you should be able to continue to use the 1.x graph/data sources post-upgrade.
1.3 - tiny error fixed with ss_protocol_ip.php (gandalf)
1.2 - update to fully support SNMPv3 (gandalf)
1.1 - Updated scripts to account for some values not returned for hosts (thanks lvm).
1.0 - Initial release.


Attachments:
File comment: templates & scripts. v2.1. Cacti 0.8.7d
proto_stats_2.1.zip [113.07 KiB]
Downloaded 3821 times
File comment: templates & scripts. v2.0. Cacti 0.8.7d
proto_stats_2.0.zip [112.34 KiB]
Downloaded 1360 times
File comment: templates & scripts V1.3
proto_stats_1.3.zip [126.32 KiB]
Downloaded 2150 times
File comment: Sample outputs
protocol_stats.png
protocol_stats.png [ 88.16 KiB | Viewed 71883 times ]

_________________

| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |


Last edited by BSOD2600 on Sun May 10, 2009 11:27 pm, edited 5 times in total.
Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 18, 2005 9:03 am 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
WOW, this is really gooood!
Reinhard

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 18, 2005 1:09 pm 
Offline

Joined: Sun Dec 18, 2005 1:08 pm
Posts: 1
Your darn right, WOW. Nice work and thank you!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 17, 2006 5:39 am 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
Just targeted these Scripts to some z/OS hosts, but proto stats failed due to missing SNMP Out Packets. To get get the other values at last, I decided to change one single line
Code:
[$result = is_numeric($var) ? ($result . $row["key"] . ":" . $var . " ") : ($result . $row["key"] . ":NaN ");
Furthermore, I decided to initialize the $result string
Code:
$result = "";
Please find the upgraded scripts attached
Reinhard


Attachments:
File comment: gzipped Protocol Scripts
ss_protocol.gz [2.37 KiB]
Downloaded 2052 times

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Last edited by gandalf on Fri Jan 27, 2006 3:32 pm, edited 1 time in total.
Top
 Profile  
 
 Post subject: Re: MIB Protocol Statistics 1.1
PostPosted: Thu Jan 26, 2006 7:57 am 
Offline

Joined: Sun Jan 22, 2006 4:07 am
Posts: 1
It's really useful templates. Thank You. :)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 27, 2006 3:00 pm 
Offline

Joined: Tue Jan 24, 2006 6:11 pm
Posts: 18
These look really cool - thanks for doing them. I'm testing them out now, but having a few problems (of course). This is on a Debian sarge/stable system, running 0.8.6h and rrdtool v1.0.49. The only graph that seems to work is the Combined one.

I'm targeting this at a Cisco 2621 router, so they should all work, right ?

When I check the IP Protocol Statistics under Graph Management, I see the following :

Code:
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="Cybercon 1 - IP Protocol Statistics" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale \
--vertical-label="per 5 minutes" \
DEF:a="/usr/share/cacti/site/rra/cybercon_1_ipinhdrerrors_25.rrd":ipForwDatagrams:AVERAGE \
DEF:b="/usr/share/cacti/site/rra/cybercon_1_ipinhdrerrors_25.rrd":ipFragCreates:AVERAGE \
DEF:c="/usr/share/cacti/site/rra/cybercon_1_ipinhdrerrors_25.rrd":ipFragFails:AVERAGE \
DEF:d="/usr/share/cacti/site/rra/cybercon_1_ipinhdrerrors_25.rrd":ipFragOKs:AVERAGE \
DEF:e="/usr/share/cacti/site/rra/cybercon_1_ipinhdrerrors_25.rrd":ipInAddrErrors:AVERAGE \
DEF:f="/usr/share/cacti/site/rra/cybercon_1_ipinhdrerrors_25.rrd":ipInDiscards:AVERAGE \
DEF:g="/usr/share/cacti/site/rra/cybercon_1_ipinhdrerrors_25.rrd":ipInHdrErrors:AVERAGE \
DEF:h="/usr/share/cacti/site/rra/cybercon_1_ipinhdrerrors_25.rrd":ipInUnknownProtos:AVERAGE \
DEF:i="/usr/share/cacti/site/rra/cybercon_1_ipinhdrerrors_25.rrd":ipOutDiscards:AVERAGE \
DEF:j="/usr/share/cacti/site/rra/cybercon_1_ipinhdrerrors_25.rrd":ipOutNoRoutes:AVERAGE \
DEF:ba="/usr/share/cacti/site/rra/cybercon_1_ipinhdrerrors_25.rrd":ipReasmFails:AVERAGE \
DEF:bb="/usr/share/cacti/site/rra/cybercon_1_ipinhdrerrors_25.rrd":ipReasmOKs:AVERAGE \
DEF:bc="/usr/share/cacti/site/rra/cybercon_1_ipinhdrerrors_25.rrd":ipReasmReqds:AVERAGE \
DEF:bd="/usr/share/cacti/site/rra/cybercon_1_ipinhdrerrors_25.rrd":ipRoutingDiscards:AVERAGE \
CDEF:cdefa=a,300,* \
CDEF:cdefe=b,300,* \
CDEF:cdefi=c,300,* \
CDEF:cdefbc=d,300,* \
CDEF:cdefbg=e,300,* \
CDEF:cdefca=f,300,* \
CDEF:cdefce=g,300,* \
CDEF:cdefci=h,300,* \
CDEF:cdefdd=i,-300,* \
CDEF:cdefde=i,300,* \
CDEF:cdefdh=j,-300,* \
CDEF:cdefdi=j,300,* \
CDEF:cdefeb=ba,-300,* \
CDEF:cdefec=ba,300,* \
CDEF:cdefef=bb,-300,* \
CDEF:cdefeg=bb,300,* \
CDEF:cdefej=bc,-300,* \
CDEF:cdeffa=bc,300,* \
CDEF:cdeffd=bd,-300,* \
CDEF:cdeffe=bd,300,* \
AREA:cdefa#FFF200:"IpForwDatagrams"  \
GPRINT:cdefa:LAST:"  Current\:"  \
GPRINT:cdefa:AVERAGE:"Average\:"  \
GPRINT:cdefa:MAX:"Maximum\:\n"  \
STACK:cdefe#FF6044:"ipFragCreates"  \
GPRINT:cdefe:LAST:"    Current\:"  \
GPRINT:cdefe:AVERAGE:"Average\:"  \
GPRINT:cdefe:MAX:"Maximum\:\n"  \
STACK:cdefi#C4FD3D:"ipFragFails"  \
GPRINT:cdefi:LAST:"      Current\:"  \
GPRINT:cdefi:AVERAGE:"Average\:"  \
GPRINT:cdefi:MAX:"Maximum\:\n"  \
STACK:cdefbc#D8ACE0:"ipFragOKs"  \
GPRINT:cdefbc:LAST:"        Current\:"  \
GPRINT:cdefbc:AVERAGE:"Average\:"  \
GPRINT:cdefbc:MAX:"Maximum\:\n"  \
STACK:cdefbg#CCCCCC:"ipInAddrErrors"  \
GPRINT:cdefbg:LAST:"   Current\:"  \
GPRINT:cdefbg:AVERAGE:"Average\:"  \
GPRINT:cdefbg:MAX:"Maximum\:\n"  \
STACK:cdefca#B90054:"ipInDiscards"  \
GPRINT:cdefca:LAST:"     Current\:"  \
GPRINT:cdefca:AVERAGE:"Average\:"  \
GPRINT:cdefca:MAX:"Maximum\:\n"  \
STACK:cdefce#00BED9:"ipInHdrErrors"  \
GPRINT:cdefce:LAST:"    Current\:"  \
GPRINT:cdefce:AVERAGE:"Average\:"  \
GPRINT:cdefce:MAX:"Maximum\:\n"  \
LINE1:cdefci#623465:"ipInUnknownProtos"  \
GPRINT:cdefci:LAST:"Current\:"  \
GPRINT:cdefci:AVERAGE:"Average\:"  \
GPRINT:cdefci:MAX:"Maximum\:\n"  \
COMMENT:"\n"  \
AREA:cdefdd#55D6D3:"ipOutDiscards"  \
GPRINT:cdefde:LAST:"    Current\:"  \
GPRINT:cdefde:AVERAGE:"Average\:"  \
GPRINT:cdefde:MAX:"Maximum\:\n"  \
STACK:cdefdh#6557D0:"ipOutNoRoutes"  \
GPRINT:cdefdi:LAST:"    Current\:"  \
GPRINT:cdefdi:AVERAGE:"Average\:"  \
GPRINT:cdefdi:MAX:"Maximum\:\n"  \
STACK:cdefeb#35962B:"ipReasmFails"  \
GPRINT:cdefec:LAST:"     Current\:"  \
GPRINT:cdefec:AVERAGE:"Average\:"  \
GPRINT:cdefec:MAX:"Maximum\:\n"  \
STACK:cdefef#0000FF:"ipReasmOKs"  \
GPRINT:cdefeg:LAST:"       Current\:"  \
GPRINT:cdefeg:AVERAGE:"Average\:"  \
GPRINT:cdefeg:MAX:"Maximum\:\n"  \
STACK:cdefej#311F4E:"ipReasmReqds"  \
GPRINT:cdeffa:LAST:"     Current\:"  \
GPRINT:cdeffa:AVERAGE:"Average\:"  \
GPRINT:cdeffa:MAX:"Maximum\:\n"  \
LINE1:cdeffd#FFF200:"ipRoutingDiscards"  \
GPRINT:cdeffe:LAST:"Current\:"  \
GPRINT:cdeffe:AVERAGE:"Average\:"  \
GPRINT:cdeffe:MAX:"Maximum\:\n"

RRDTool Says:

ERROR: bad format for [G]PRINT in '  Current:'

So this one doesn't graph. Does it require rrdtool v1.2.x ?

TCP Protocol Statistics under Graph Management shows this :

Code:
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="Cybercon 1 - TCP Protocol Statistics" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale \
--vertical-label="per 5 minutes" \
DEF:a="/usr/share/cacti/site/rra/cybercon_1_tcpactiveopens_26.rrd":tcpActiveOpens:AVERAGE \
DEF:b="/usr/share/cacti/site/rra/cybercon_1_tcpactiveopens_26.rrd":tcpAttemptFails:AVERAGE \
DEF:c="/usr/share/cacti/site/rra/cybercon_1_tcpactiveopens_26.rrd":tcpEstabResets:AVERAGE \
DEF:d="/usr/share/cacti/site/rra/cybercon_1_tcpactiveopens_26.rrd":tcpInErrs:AVERAGE \
DEF:e="/usr/share/cacti/site/rra/cybercon_1_tcpactiveopens_26.rrd":tcpOutRsts:AVERAGE \
DEF:f="/usr/share/cacti/site/rra/cybercon_1_tcpactiveopens_26.rrd":tcpPassiveOpens:AVERAGE \
DEF:g="/usr/share/cacti/site/rra/cybercon_1_tcpactiveopens_26.rrd":tcpRetransSegs:AVERAGE \
DEF:h="/usr/share/cacti/site/rra/cybercon_1_tcpactiveopens_26.rrd":tcpCurrEstab:AVERAGE \
CDEF:cdefa=a,300,* \
CDEF:cdefe=b,300,* \
CDEF:cdefi=c,300,* \
CDEF:cdefbc=d,300,* \
CDEF:cdefbg=e,300,* \
CDEF:cdefca=f,300,* \
CDEF:cdefce=g,300,* \
AREA:cdefa#FFD660:"tcpActiveOpens"  \
GPRINT:cdefa:LAST:" Current\:"  \
GPRINT:cdefa:AVERAGE:"Average\:"  \
GPRINT:cdefa:MAX:"Maximum\:\n"  \
STACK:cdefe#FF5700:"tcpAttemptFails"  \
GPRINT:cdefe:LAST:"Current\:"  \
GPRINT:cdefe:AVERAGE:"Average\:"  \
GPRINT:cdefe:MAX:"Maximum\:\n"  \
STACK:cdefi#EAAF00:"tcpEstabResets"  \
GPRINT:cdefi:LAST:" Current\:"  \
GPRINT:cdefi:AVERAGE:"Average\:"  \
GPRINT:cdefi:MAX:"Maximum\:\n"  \
STACK:cdefbc#D8ACE0:"tcpInErrs"  \
GPRINT:cdefbc:LAST:"      Current\:"  \
GPRINT:cdefbc:AVERAGE:"Average\:"  \
GPRINT:cdefbc:MAX:"Maximum\:\n"  \
STACK:cdefbg#CDCFC4:"tcpOutRsts"  \
GPRINT:cdefbg:LAST:"     Current\:"  \
GPRINT:cdefbg:AVERAGE:"Average\:"  \
GPRINT:cdefbg:MAX:"Maximum\:\n"  \
STACK:cdefca#C4FD3D:"tcpPassiveOpens"  \
GPRINT:cdefca:LAST:"Current\:"  \
GPRINT:cdefca:AVERAGE:"Average\:"  \
GPRINT:cdefca:MAX:"Maximum\:\n"  \
STACK:cdefce#AD3B6E:"tcpRetransSegs"  \
GPRINT:cdefce:LAST:" Current\:"  \
GPRINT:cdefce:AVERAGE:"Average\:"  \
GPRINT:cdefce:MAX:"Maximum\:\n"  \
LINE1:h#4444FF:"tcpCurrEstab"  \
GPRINT:h:LAST:"   Current\:"  \
GPRINT:h:AVERAGE:"Average\:"  \
GPRINT:h:MAX:"Maximum\:\n"

RRDTool Says:

ERROR: opening '/usr/share/cacti/site/rra/cybercon_1_tcpactiveopens_26.rrd': No such file or directory

Ah ha. RRD file missing. So go look at the Data Source for that, and ... it's completely blank. No debug output to show what the rrdtool create should have been.

I'm suspecting the XML import isn't quite working properly. It seems that all the imports I've done have had one problem or another. For example, the Advanced CPU Usage one from http://forums.cacti.net/viewtopic.php?t=10537 had problems too - only one datatemplate was correct - the other two had to have the OID and Data Input Method fields corrected.

How can I debug or check this to make sure they're OK ?

D.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 27, 2006 3:35 pm 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
What are your Settings for RRDTool Utility Version? I bet there's rrdtool-1.2.x whilst you're running 1.0.x? Both versions differ in escaping colons ...
Reinhard

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 27, 2006 4:18 pm 
Offline

Joined: Tue Jan 24, 2006 6:11 pm
Posts: 18
Settings are for 1.0.x. I got bitten by that before :oops:

How about the total lack of a data source for TCP Protocol Statistics (also for IP and UDP btw) ?

D.

PS - appreciate the fast response here.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 27, 2006 4:55 pm 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
Please re-import and post a screenshot of the outcome
Reinhard

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 27, 2006 6:11 pm 
Offline

Joined: Tue Jan 24, 2006 6:11 pm
Posts: 18
OK - I re-imported the TCP one - results are below. Going to a datasource using it still has a blank debug area. Nothing there.

D.


Attachments:
File comment: Results of TCP import.
Import-1.png
Import-1.png [ 6.08 KiB | Viewed 70863 times ]
File comment: Data source is still blank.
Import-2.png
Import-2.png [ 28.44 KiB | Viewed 70863 times ]
Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 27, 2006 6:28 pm 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
You surely put the protocol_stats script into the scripts folder, did you? Next thing we need is a debug log: goto Settings and select DEBUG as Logging Level. Run for one polling cycle and please post the log/cacti.log. Don't forget to re-set the Logging Level afterwards
Reinhard

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 27, 2006 6:59 pm 
Offline
Cacti Moderator
User avatar

Joined: Sat May 08, 2004 12:44 pm
Posts: 12130
Location: USA
Halfwalker: Manually run the script via the script server and see if it returns any data.
1) php c:\cacti\script_server.php
2) c:\cacti\scripts\ss_protocol_tcp.php ss_protocol_tcp <hostname> <snmp_community> <snmp_version> <snmp_port> <snmp_timeout> <snmpv3_auth_username> <snmpv3_auth_password>

If no data is returned, then your device does not support that MIB.

_________________

| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 18, 2006 1:16 am 
Offline
Cacti User
User avatar

Joined: Thu Sep 22, 2005 7:50 pm
Posts: 242
Location: Landenberg, PA
BSOD2600: I don't know how I missed getting this back on Dec.17 when you uploaded this wonderful collection!
But, I have it now!
Thank you, this is a nice set of templates and scripts.
I downloaded your tar.gz file, read the readme, installed per your notes and two polling cycles later I am impressed!
Nice work!
:D

_________________
Thank you,

Ernie
http://www.NMSWorld.com
Dual Zeon Dual Core 2.6Ghz / 8GB RAM / 4x15k RPM SATA RAID5
Cacti Version - 0.8.7b
Poller Type - cactid 0.8.7 with Boost v1.7
Server Info - FreeBSD 7.0-RELEASE
Web Server - Apache/2.2.6 (Unix) mod_ssl/2.2.6 OpenSSL/0.9.8g DAV/2 PHP/5.2.5 mod_perl/2.0.3 Perl/v5.8.8
PHP - 5.2.6
MySQL - 5.0.51b Mod: poller_output ENGINE = MEMORY
RRDTool - 1.3.0
SNMP - 5.4.1
Plugins - Host Info (hostinfo - v0.2), Update Checker (update - v0.3), Network Tools (tools - v0.2), FlowView (flowview - v0.3), Read-only Devices Tab (devices - v0.4), Network Discovery (discovery - v0.8.3), Syslog Monitoring (syslog - v0.5.2), Thresholds (thold - v0.3.9), Device Monitoring (monitor - v0.8.2), PHP Network Weathermap (weathermap - v0.941), SuperLinks (superlinks - v0.72), Report Creator (reports - v0.1b)


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 25, 2006 10:59 pm 
Offline
Cacti User

Joined: Tue Oct 25, 2005 10:01 am
Posts: 142
i have a problem. it seems as though the data is only updating when i run the scripts manually from the command. doesnt seem strange as i have another web hits script that does the same thing. any ideas on how to remedy the situation?

the logs post no errors and return results when logging is set to high.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 19, 2006 12:23 pm 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
Diceman wrote:
i have a problem. it seems as though the data is only updating when i run the scripts manually from the command. doesnt seem strange as i have another web hits script that does the same thing. any ideas on how to remedy the situation?

the logs post no errors and return results when logging is set to high.
This seems to be an environment thingy. Please check, if all used binaries have to full paths. Are you running cmd.php or cactid?
Reinhard

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 142 posts ]  Go to page 1, 2, 3, 4, 5 ... 10  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group