User Tools

Site Tools


packet:snmp_graphs

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
packet:snmp_graphs [2024/03/17 20:17] g7tajpacket:snmp_graphs [2024/09/22 18:15] (current) g7taj
Line 14: 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 35: Line 35:
 </code> </code>
  
 +- 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 
  
 +<code>SNMPPORT=161</code>
 +
 +e.g.
 +<code>
 +PORT
 + PORTNUM=3
 + ID=Telnet Server
 + DRIVER=Telnet
 + CONFIG
 + SecureTelnet=1
 + LOGGING=1
 + DisconnectOnClose=1
 + TCPPORT=8010
 + FBBPORT=8011
 + HTTPPORT=9122
 + SNMPPORT=161
 +ENDPORT
 +</code>
 +
 +
 +- 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 52: Line 75:
 </code> </code>
  
-Then from the same, or another machine +Then from the same, or another machine\\  
-- note, you may have to add a route. This can be a service, or a cron script:+(Note, you may have to add a route. This can be a service, or a cron script)
  
 <code> <code>
Line 60: 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 73: Line 96:
 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 92: Line 114:
  
  
-I run the next as a cron job+- Run the next as a cron job
  
 <code> <code>
Line 160: Line 182:
 </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 168: Line 190:
 <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 192: Line 201:
  
 setTimeout( function () { update() } , 300000); setTimeout( function () { update() } , 300000);
- 
- 
- 
  
 } }
Line 201: Line 207:
  
 </script> </script>
- 
- 
 </head> </head>
 <BODY> <BODY>
packet/snmp_graphs.1710706661.txt.gz · Last modified: 2024/03/17 20:17 by g7taj