BGP Data Query, very easy to use

Templates, scripts for templates, scripts and requests for templates.

Moderators: Moderators, Developers

Author
Message
scottevil
Posts: 24
Joined: Tue Nov 28, 2006 6:44 am
Location: Akron
Contact:

BGP Data Query, very easy to use

#1 Post by scottevil » Mon Mar 29, 2010 12:19 pm

UPDATE 10/27/2010: Really fixed and tested with version 0.8.7e & 0.8.7g with no patches

This is a data query built for monitoring BGP prefixes in memory, and messages rx/tx. This will auto enumerate all BGP neighbors and allow quick creation of graphs.

Basic docs are included in the tgz file. For more info and other open source tools visit: http://crunchtools.com
Source Code Version here: http://code.google.com/p/crunchtools/source/browse/
Attachments
graph_bgp_neighbors.tgz
(5.28 KiB) Downloaded 1342 times
bgp_screen.jpeg
bgp_screen.jpeg (18.17 KiB) Viewed 12936 times
Last edited by scottevil on Wed Oct 27, 2010 1:57 pm, edited 7 times in total.

mcutting
Cacti Guru User
Posts: 1874
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

#2 Post by mcutting » Thu Apr 08, 2010 2:05 am

Data Query seems to be missing ?

Data Template
[success] eBGP/iBGP Monitor [update]
+ Found Dependency: (Data Input Method) Get SNMP Data (Indexed)
+ Unmet Dependency: (Data Input Field)
+ Unmet Dependency: (Data Input Field)
+ Found Dependency: (Data Input Field) SNMP IP Address
+ Found Dependency: (Data Input Field) SNMP Community
+ Found Dependency: (Data Input Field) SNMP Username (v3)
+ Found Dependency: (Data Input Field) SNMP Password (v3)
+ Found Dependency: (Data Input Field) SNMP Version (1, 2, or 3)
+ Found Dependency: (Data Input Field) Index Type
+ Found Dependency: (Data Input Field) Index Value
+ Found Dependency: (Data Input Field) Output Type ID
+ Found Dependency: (Data Input Field) SNMP Port
+ Found Dependency: (Data Input Field) SNMP Authenticaion Protocol (v3)
+ Found Dependency: (Data Input Field) SNMP Privacy Passphrase (v3)
+ Found Dependency: (Data Input Field) SNMP Privacy Protocol (v3)

Graph Template
[success] eBGP/iBGP Monitor [update]
+ Found Dependency: (Data Template Item) prefixes
+ Found Dependency: (CDEF) Divide by 1024
+ Found Dependency: (GPRINT Preset) Normal
+ Unmet Dependency: (Data Template Item)
+ Found Dependency: (CDEF) Make Per 5 Minutes
+ Unmet Dependency: (Data Template Item)
+ Unmet Dependency: (Data Template Item)
+ Unmet Dependency: (Data Template Item)
+ Unmet Dependency: (Data Template Item)
+ Unmet Dependency: (Data Template Item)
+ Unmet Dependency: (Data Template Item)
+ Unmet Dependency: (Data Template Item)
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b

srossen
Posts: 43
Joined: Mon Jun 13, 2005 1:10 pm

#3 Post by srossen » Fri Apr 09, 2010 1:40 pm

Do you have a sample of what the graphs look like?

scottevil
Posts: 24
Joined: Tue Nov 28, 2006 6:44 am
Location: Akron
Contact:

New version

#4 Post by scottevil » Mon Apr 19, 2010 10:11 am

Posted fix and example graph

mcutting
Cacti Guru User
Posts: 1874
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

#5 Post by mcutting » Mon Apr 19, 2010 11:17 am

Still the same

[success] eBGP/iBGP Monitor [update]
+ Found Dependency: (Data Input Method) Get SNMP Data (Indexed)
+ Unmet Dependency: (Data Input Field)
+ Unmet Dependency: (Data Input Field)
+ Found Dependency: (Data Input Field) SNMP IP Address
+ Found Dependency: (Data Input Field) SNMP Community
+ Found Dependency: (Data Input Field) SNMP Username (v3)
+ Found Dependency: (Data Input Field) SNMP Password (v3)
+ Found Dependency: (Data Input Field) SNMP Version (1, 2, or 3)
+ Found Dependency: (Data Input Field) Index Type
+ Found Dependency: (Data Input Field) Index Value
+ Found Dependency: (Data Input Field) Output Type ID
+ Found Dependency: (Data Input Field) SNMP Port
+ Found Dependency: (Data Input Field) SNMP Authenticaion Protocol (v3)
+ Found Dependency: (Data Input Field) SNMP Privacy Passphrase (v3)
+ Found Dependency: (Data Input Field) SNMP Privacy Protocol (v3)

Graph Template
[success] eBGP/iBGP Monitor [update]

Data Query
[success] eBGP/iBGP Monitor [new]
+ Found Dependency: (Data Input Method) Get SNMP Data (Indexed)
+ Found Dependency: (Graph Template) eBGP/iBGP Monitor
+ Found Dependency: (Data Template) eBGP/iBGP Monitor
+ Found Dependency: (Data Template Item) prefixes
+ Unmet Dependency: (Data Template Item)
+ Unmet Dependency: (Data Template Item)
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b

User avatar
BSOD2600
Cacti Moderator
Posts: 12160
Joined: Sat May 08, 2004 12:44 pm
Location: USA

#6 Post by BSOD2600 » Mon Apr 19, 2010 5:06 pm

Make sure you both have the 0.8.7e patch "Template Import/Export Duplication" installed. It also has a commandline tool that the exporter (aka scottevil) should run /cacti/cli/repair_templates.php which should hopefully fix the issues.

mcutting
Cacti Guru User
Posts: 1874
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

#7 Post by mcutting » Tue Apr 20, 2010 2:24 am

Never mind, did this myself - here's the corrected templates. I also labeled the templates as "generic", as they fit multiple devices, and not just Cisco.

These templates were exported from 0.8.7e, hence no backport (sorry)
Attachments
cacti_data_query_generic_-_ebgpibgp_monitor.xml
(22.79 KiB) Downloaded 1144 times
cacti_data_template_generic_-_ebgpibgp_monitor.xml
(10.39 KiB) Downloaded 1054 times
cacti_graph_template_generic_-_ebgpibgp_monitor.xml
(21.33 KiB) Downloaded 1353 times
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b

scottevil
Posts: 24
Joined: Tue Nov 28, 2006 6:44 am
Location: Akron
Contact:

Exporter: I will look into this

#8 Post by scottevil » Fri Apr 23, 2010 11:03 am

I don't understand exactly what you had to do to make it work? I exported from my production system, then spun up a brand new instance on another box and imported it no problem?

Thanks
Scott M

mcutting
Cacti Guru User
Posts: 1874
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

#9 Post by mcutting » Fri Apr 23, 2010 11:17 am

The data query was missing, and none of the dependencies were set on the graph (in terms of data sources assigned for CURRENT, AVERAGE, MAX etc)
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b

scottevil
Posts: 24
Joined: Tue Nov 28, 2006 6:44 am
Location: Akron
Contact:

Ahhhh

#10 Post by scottevil » Fri Apr 23, 2010 1:43 pm

I assume you mean the first time there was no data query. Now there are some un-assigned fields, that could be because I borrowed the graph template from an older check I wrote a long time ago.

Cool, thanks. I am still kind of a noob with creating these things, I have done for years, but never with any regularity or expertise :-) I just thought this one was too needed to not share.

scottevil
Posts: 24
Joined: Tue Nov 28, 2006 6:44 am
Location: Akron
Contact:

Re: BGP Data Query, very easy to use

#11 Post by scottevil » Wed Oct 27, 2010 1:48 pm

So, I finally had a chance to dig into this and understand what you were saying, I have repaired and tested this data query.
Scott McCarty
Solutions Architect/Open Source Evangelist
Twitter: @fatherlinux
URL: http://crunchtools.com

mcutting
Cacti Guru User
Posts: 1874
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Re: BGP Data Query, very easy to use

#12 Post by mcutting » Thu Oct 28, 2010 2:50 am

Did you repost this ?

[success] eBGP/iBGP Monitor [update]
+ Found Dependency: (Data Input Method) Get SNMP Data (Indexed)
+ Unmet Dependency: (Data Input Field)
+ Unmet Dependency: (Data Input Field)
+ Found Dependency: (Data Input Field) SNMP IP Address
+ Found Dependency: (Data Input Field) SNMP Community
+ Found Dependency: (Data Input Field) SNMP Username (v3)
+ Found Dependency: (Data Input Field) SNMP Password (v3)
+ Found Dependency: (Data Input Field) SNMP Version (1, 2, or 3)
+ Found Dependency: (Data Input Field) Index Type
+ Found Dependency: (Data Input Field) Index Value
+ Found Dependency: (Data Input Field) Output Type ID
+ Found Dependency: (Data Input Field) SNMP Port
+ Found Dependency: (Data Input Field) SNMP Authenticaion Protocol (v3)
+ Found Dependency: (Data Input Field) SNMP Privacy Passphrase (v3)
+ Found Dependency: (Data Input Field) SNMP Privacy Protocol (v3)
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b

scottevil
Posts: 24
Joined: Tue Nov 28, 2006 6:44 am
Location: Akron
Contact:

Re: BGP Data Query, very easy to use

#13 Post by scottevil » Thu Oct 28, 2010 3:52 am

I edited the post and updated the version after installing the patch, running the repair command and re-exporting. I tested import with scratch installs. Also, after patching, it still shows those 2 un-met dependancies, but works anyway.

Also, I tried everything to get rid of those un-met deps. I even looked at the XML by hand, nothing looks wrong to me. I suspect there is still some bug in the Cacti import/export code.

Best Regards
Scott M
Scott McCarty
Solutions Architect/Open Source Evangelist
Twitter: @fatherlinux
URL: http://crunchtools.com

m.arteta
Posts: 5
Joined: Fri Mar 26, 2010 4:17 am

Re: BGP Data Query, very easy to use

#14 Post by m.arteta » Tue Dec 21, 2010 9:50 am

Excuse me for my english google traductor :)

I tested this plugin with the version of scottevil and mcutting. But in both cases, the rrd is not create.
And even creating it manually:

/usr/local/bin/rrdtool create \
/data/www/cacti/cacti-0.8.7g/rra/test_received_8.rrd \
--step 300 \
DS:sent:COUNTER:600:0:1000000 \
DS:prefixes:GAUGE:600:0:1000000 \
DS:received:COUNTER:600:0:2000000 \
RRA:AVERAGE:0.5:1:600 \
RRA:AVERAGE:0.5:6:700 \
RRA:AVERAGE:0.5:24:775 \
RRA:AVERAGE:0.5:288:797 \
RRA:MAX:0.5:1:600 \
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:288:797 \


Graph Management:

RRDTool Command:

/usr/local/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title='test - eBGP/iBGP Monitor 21.XX.XX.XX ' \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label='Thousands of Prefixes' \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="/data/www/cacti/cacti-0.8.7g/rra/test_received_8.rrd":prefixes:AVERAGE \
DEF:b="/data/www/cacti/cacti-0.8.7g/rra/test_received_8.rrd":received:AVERAGE \
DEF:c="/data/www/cacti/cacti-0.8.7g/rra/test_received_8.rrd":sent:AVERAGE \
CDEF:cdefa=a,1024,/ \
CDEF:cdefe=b,300,* \
CDEF:cdefi=c,300,* \
LINE1:cdefa#0C5ECEFF:"Prefixes\:" \
GPRINT:cdefa:LAST:"Current\:%8.2lf %s" \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefa:MAX:"Max\:%8.2lf %s\n" \
LINE1:cdefe#FF4C4CFF:"Msg Rx\:" \
GPRINT:cdefe:LAST:" Current\:%8.2lf %s" \
GPRINT:cdefe:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefe:MAX:"Max\:%8.2lf %s\n" \
LINE1:cdefi#B84CB8FF:"Msg Tx\:" \
GPRINT:cdefi:LAST:" Current\:%8.2lf %s" \
GPRINT:cdefi:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefi:MAX:"Max\:%8.2lf %s\n"

RRDTool Says:
OK



the rra is not updated.
Even putting the spine in debug, I failed to find a solution.

cacti 0.8.7g whit & whitout paths.

Merci.

Guillaume.

scottevil
Posts: 24
Joined: Tue Nov 28, 2006 6:44 am
Location: Akron
Contact:

Re: BGP Data Query, very easy to use

#15 Post by scottevil » Tue Dec 21, 2010 2:44 pm

When you do a verbose query for the data query under the device, you should see something like this. I just did this on clean install of 0.8.7e, so it should work in 0.8.7g also. I tested on both version a few months back when I reposted this and it should still work ;-) If you don't see data coming back from your router then you might have an snmp version problem or a community string mismatch. When in those situations, I usually use tcpdump to sniff the traffic.
bgp.png
bgp.png (23.35 KiB) Viewed 12581 times
Scott McCarty
Solutions Architect/Open Source Evangelist
Twitter: @fatherlinux
URL: http://crunchtools.com

Post Reply