packet:snmp_graphs
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
packet:snmp_graphs [2024/03/17 18:19] – created g7taj | packet:snmp_graphs [2024/09/22 18:15] (current) – g7taj | ||
---|---|---|---|
Line 1: | Line 1: | ||
With LinBPQ you can make graphs for the traffic flow through your node. | With LinBPQ you can make graphs for the traffic flow through your node. | ||
You can use this technique or you can grab the SNMP data and use it via any other SNMP graphing tool. | You can use this technique or you can grab the SNMP data and use it via any other SNMP graphing tool. | ||
+ | |||
+ | |||
+ | {{: | ||
LinBPQ has the following OID's | LinBPQ has the following OID's | ||
Line 11: | Line 14: | ||
</ | </ | ||
- | Works the following | + | The way I have set things up works like this: |
- | linbpq SNMP interface -> updatescript -> rrdtool (created graphs) -> webpage images | + | linbpq SNMP interface -> updatescript -> rrdtool (created graphs) -> webpage |
- | You need a webserver (bpq built-in will work also) and the following software installed | + | You need a webserver (bpq built-in will work) and the following software installed |
rrdtool \\ | rrdtool \\ | ||
snmp | snmp | ||
- | create | + | - Create |
< | < | ||
rrdtool create port2.rrd --step=60 \ | rrdtool create port2.rrd --step=60 \ | ||
Line 32: | Line 35: | ||
</ | </ | ||
+ | - You need to enable SNMP in bpq32.cfg. You can do it two ways, either inside TELNET config, or inside IPGATEWAY | ||
- | You need to add the following to bpq32.cfg | + | - TELNET |
+ | In the telnet configuration section, add | ||
+ | < | ||
+ | |||
+ | e.g. | ||
+ | < | ||
+ | PORT | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | ENDPORT | ||
+ | </ | ||
+ | |||
+ | |||
+ | - IPGATWEAY | ||
The IP's used here are for example only. If you setup linBPQ for 44-net, please use all the proper IP's allocated to you. | The IP's used here are for example only. If you setup linBPQ for 44-net, please use all the proper IP's allocated to you. | ||
192.168.1.44 - unused on the LAN (not the node's IP address) | 192.168.1.44 - unused on the LAN (not the node's IP address) | ||
Line 49: | Line 75: | ||
</ | </ | ||
- | Then from the same, or another machine | + | - Then from the same, or another machine\\ |
- | - note, you may have to add a route. | + | (Note, you may have to add a route. |
< | < | ||
Line 58: | Line 83: | ||
sleep 60 | sleep 60 | ||
- | #Adding rule to main linbpq instance | + | #Adding rule to linbpq instance |
sudo route add 44.131.1.1 gateway 192.168.1.44 | sudo route add 44.131.1.1 gateway 192.168.1.44 | ||
Line 71: | Line 96: | ||
for val in $PortList; | for val in $PortList; | ||
do | do | ||
- | # echo snmpget -Oqv -v1 -c public 44.131.253.72 | + | |
- | echo update port$val.rrd | + | |
in=$(snmpget -r5 -Oqv -v1 -c public 44.131.253.72 | in=$(snmpget -r5 -Oqv -v1 -c public 44.131.253.72 | ||
Line 90: | Line 114: | ||
- | + | - Run the next as a cron job | |
- | This can be a service. | + | |
- | + | ||
- | I run the next as a cron job | + | |
< | < | ||
Line 161: | Line 182: | ||
</ | </ | ||
- | really simple Webpage, which could be made a lot better (i.e. pull a cfg file with the ports and | + | - This is a really simple Webpage, which could be made a lot better (i.e. pull a cfg file with the ports and |
process those dynamically rather than have static entries for each, or just define them at the top of the JS) : | process those dynamically rather than have static entries for each, or just define them at the top of the JS) : | ||
Line 169: | Line 190: | ||
< | < | ||
< | < | ||
- | |||
- | function fetchData() { | ||
- | console.log(' | ||
- | var xhr = new XMLHttpRequest(); | ||
- | xhr.open(" | ||
- | xhr.onload = function() { | ||
- | document.getElementById(' | ||
- | } | ||
- | xhr.send(); | ||
- | setTimeout( function () { fetchData() } , 3000); | ||
- | |||
- | } | ||
- | |||
function update() { | function update() { | ||
Line 193: | Line 201: | ||
setTimeout( function () { update() } , 300000); | setTimeout( function () { update() } , 300000); | ||
- | |||
- | |||
- | |||
} | } | ||
Line 202: | Line 207: | ||
</ | </ | ||
- | |||
- | |||
</ | </ | ||
< | < |
packet/snmp_graphs.1710699581.txt.gz · Last modified: 2024/03/17 18:19 by g7taj