BGP Data Query, very easy to use

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

Moderators: Developers, Moderators

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

BGP Data Query, very easy to use

Post by scottevil »

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 1572 times
bgp_screen.jpeg
bgp_screen.jpeg (18.17 KiB) Viewed 15254 times
Last edited by scottevil on Wed Oct 27, 2010 1:57 pm, edited 7 times in total.
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

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

Post by srossen »

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

Post by scottevil »

Posted fix and example graph
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

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: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

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: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

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 1376 times
cacti_data_template_generic_-_ebgpibgp_monitor.xml
(10.39 KiB) Downloaded 1280 times
cacti_graph_template_generic_-_ebgpibgp_monitor.xml
(21.33 KiB) Downloaded 1577 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

Post by scottevil »

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: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

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

Post by scottevil »

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

Post by scottevil »

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: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Re: BGP Data Query, very easy to use

Post by mcutting »

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

Post by scottevil »

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

Post by m.arteta »

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

Post by scottevil »

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 14899 times
Scott McCarty
Solutions Architect/Open Source Evangelist
Twitter: @fatherlinux
URL: http://crunchtools.com
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests