User Tools

Site Tools


packet:snmp_graphs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
packet:snmp_graphs [2024/03/17 18:19] – created g7tajpacket:snmp_graphs [2024/03/17 20:30] (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.
 +
 +
 +{{:packet:snmp-graph.jpg?nolink&400|}}
  
 LinBPQ has the following OID's LinBPQ has the following OID's
Line 11: Line 14:
 </code> </code>
  
-Works the following way:+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 images
  
-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 an RRDTOOL dBase file for each port you want to monitor+- Create an RRDTOOL dBase file for each port you want to monitor
 <code> <code>
 rrdtool create port2.rrd --step=60 \ rrdtool create port2.rrd --step=60 \
Line 33: Line 36:
  
  
-You need to add the following to bpq32.cfg+You need to add the following to bpq32.cfg
  
 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.
Line 49: Line 52:
 </code> </code>
  
-Then from the same, or another machine +Then from the same, or another machine\\  
-- note, you may have to add a route. I do this in the script+(Note, you may have to add a route. This can be a service, or a cron script)
  
 <code> <code>
Line 58: Line 60:
 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 73:
 for val in $PortList; for val in $PortList;
  do  do
-# echo snmpget -Oqv -v1 -c public 44.131.253.72  1.3.6.1.2.1.2.2.1.10.$val +  echo update port$val.rrd
- echo update port$val.rrd+
  
   in=$(snmpget -r5 -Oqv -v1 -c public 44.131.253.72  1.3.6.1.2.1.2.2.1.10.$val )   in=$(snmpget -r5 -Oqv -v1 -c public 44.131.253.72  1.3.6.1.2.1.2.2.1.10.$val )
Line 90: Line 91:
  
  
- +- Run the next as a cron job
-This can be a service. +
- +
-I run the next as a cron job+
  
 <code> <code>
Line 161: Line 159:
 </code> </code>
  
-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 167:
 <head> <head>
 <script> <script>
- 
-function fetchData() { 
-      console.log('Fetching updated data.'); 
-      var xhr = new XMLHttpRequest(); 
-      xhr.open("GET", "graphs.html", true); 
-      xhr.onload = function() { 
-        document.getElementById('graph_div')=xhr.responseText; 
-      } 
-      xhr.send(); 
-      setTimeout( function () { fetchData() } , 3000); 
- 
-} 
- 
  
 function update() { function update() {
Line 193: Line 178:
  
 setTimeout( function () { update() } , 300000); setTimeout( function () { update() } , 300000);
- 
- 
- 
  
 } }
Line 202: Line 184:
  
 </script> </script>
- 
- 
 </head> </head>
 <BODY> <BODY>
packet/snmp_graphs.1710699581.txt.gz · Last modified: 2024/03/17 18:19 by g7taj