Simple Network Management Protocol

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 22:31, 11 July 2006 (edit)
Bluse-Blue (Talk | contribs)

← Previous diff
Revision as of 22:54, 11 July 2006 (edit) (undo)
Bluse-Blue (Talk | contribs)

Next diff →
Line 61: Line 61:
-This should get all the available OIDS+This should get important available OIDS for SNMP requst against DD-WRT V23 SP1
<center> <center>
Line 125: Line 125:
| "eth1" "imq0" "lo" | "eth1" "imq0" "lo"
|- |-
-| +| 1.3.6.1.2.1.2.2.1.4'''.*''' <br> ''iso.org.dod.internet.mgmt.mib-2.interfaces.ifTable.ifEntry.ifMtu''
-| +| size of the largest datagram which can be sent/received on the interface
-| +| octets (replace the '''.*''' with specific interface from 1 to max interfaces)
-| +| "1500" "1454"
|- |-
-| +| 1.3.6.1.2.1.2.2.1.5'''.*''' <br> ''iso.org.dod.internet.mgmt.mib-2.interfaces.ifTable.ifEntry.ifSpeed.*''
-| +| interface's current bandwidth
-| +| bits per second (replace the '''.*''' with specific interface from 1 to max interfaces)
-| +| "10000000"
 +|-
 +| 1.3.6.1.2.1.2.2.1.6'''.*''' <br> ''iso.org.dod.internet.mgmt.mib-2.interfaces.ifTable.ifEntry.ifPhysAddress.*''
 +| interface's physical MAC address
 +| octet-string (replace the '''.*''' with specific interface from 1 to max interfaces)
 +| "000625D7D203"
 +|-
 +| 1.3.6.1.2.1.2.2.1.10'''.*''' <br> ''iso.org.dod.internet.mgmt.mib-2.interfaces.ifTable.ifEntry.ifInOctets.*''
 +| total number of octets received on the interface, including framing characters.
 +| integer (replace the '''.*''' with specific interface from 1 to max interfaces)
 +| "3869059965"
 +|-
 +| 1.3.6.1.2.1.2.2.1.16'''.*''' <br> ''iso.org.dod.internet.mgmt.mib-2.interfaces.ifTable.ifEntry.ifOutOctets.*''
 +| total number of octets transmitted out of the interface, including framing characters.
 +| integer (replace the '''.*''' with specific interface from 1 to max interfaces)
 +| "3195287514"
 +|-
 +| 1.3.6.1.2.1.2.2.1.20.*''' <br> ''iso.org.dod.internet.mgmt.mib-2.interfaces.ifTable.ifEntry.ifOutErrors.*''
 +| number of outbound packets that could not be transmitted because of errors
 +| integer (replace the '''.*''' with specific interface from 1 to max interfaces)
 +| "95332"
|- |-
| |

Revision as of 22:54, 11 July 2006

Contents

Introduction

The Simple Network Management Protocol (SNMP) is a protocol for monitoring of network-attached devices for any conditions that warrant administrative attention.


Wireless Rate Via SNMP

This particular setup is for creating new SNMP values that monitor the Rate setting of the wireless and the RSSI values of specific clients/WDS. I borrowed some of this code and modified it to work with v23. Someone said this came from the Sveasoft forums. Assumes use of DD-WRT v23.


Tools: Getif (SNMP MIB browser)


1) Turn on SNMP in DD-WRT (Administration->Services)

2) Turn on JFFS and clean it (Administration->Management)

3) Log in via SSH and create the following scripts:


/jffs/snmpd/wlrate:

#!/bin/sh
/usr/sbin/wl rate |/usr/bin/cut -b 9-10


/jffs/snmpd/wlrssi1:

#!/bin/sh
/usr/sbin/wl rssi <mac_address_of_client_or_wds> | /usr/bin/cut -b 10-11


You can repeat wlrssi1 multiple times for each client or WDS you want to monitor. Just increment the number.


Next, type the following into the command-line:

nvram set snmpd_conf="syslocation <your_location>
syscontact <your_email>
sysname <your_system_name>
rocommunity <your_password>
rwcommunity <your_other_password>
exec Rate /jffs/snmpd/wlrate
exec RSSI-CLIENT1 /jffs/snmpd/wlrssi1
"
nvram commit
reboot


Again, repeat the "RSSI-CLIENT1" line if you have more than 1 client to monitor (incrementing the number, of course).


Test the settings with Getif. You will need to look for .1.3.6.1.4.1.2021.8.1 in the "MBrowser" screen.


Steps:


In "Parameters", type in the IP of the router and the read and write community passwords. Press "Start" and you should see the bottom status say something like "Sysinfo variables OK". Next, go to the "MBrowser" tab and put ".1.3.6.1.4.1.2021.8.1" in the second entry box (it probably says ".1"). Press "Start" and you should see a list of values pop into the lower output screen. You will see your configuration variables, then a list of numbers in the values side. The first 3 numbers will be "0", then your values will show up. First is your "Rate", then each of your RSSI values that you entered above.

Known OID´s via SNMP

This should get important available OIDS for SNMP requst against DD-WRT V23 SP1

OID [dottedt & text format] MEANING RANGE of VALUES CONTENT (example)
1.3.6.1.2.1.1.1.0 router description string "Linux WRT54G 2.4.20 #2 Thu Sep 9"
1.3.6.1.2.1.1.3.0 uptime (in hundredths of a second) timeticks "0:9:58:43.95"
1.3.6.1.2.1.1.6.0 location entry of this node string "Sundhausen"
1.3.6.1.4.1.2021.10.1.3.1
iso.org.dod.internet.private.enterprises.2021.10.1.3.1
CPU-load-1 (1-min average) fixed-point number [0.00 .. 1.00] "0.08"
1.3.6.1.4.1.2021.10.1.3.2
iso.org.dod.internet.private.enterprises.2021.10.1.3.2
CPU-load-5 (5-min average) fixed-point number [0.00 .. 1.00] "0.04"
1.3.6.1.4.1.2021.10.1.3.3
iso.org.dod.internet.private.enterprises.2021.10.1.3.3
CPU-load-15 (15-min average) fixed-point number [0.00 .. 1.00] "0.08"
1.3.6.1.4.1.2021.10.1.5.1
iso.org.dod.internet.private.enterprises.2021.10.1.5.1
CPU-load-1 (1-min average) integer [0...100] "8"
1.3.6.1.4.1.2021.10.1.5.2
iso.org.dod.internet.private.enterprises.2021.10.1.5.2
CPU-load-5 (5-min average) integer [0...100] "4"
1.3.6.1.4.1.2021.10.1.5.3
iso.org.dod.internet.private.enterprises.2021.10.1.5.3
CPU-load-15 (15-min average) integer [0...100] "2"
1.3.6.1.2.1.2.1.0 number of network interfaces
iso.org.dod.internet.mgmt.mib-2.interfaces.ifNumber.0
integer "11"
1.3.6.1.2.1.2.2.1.2.*
iso.org.dod.internet.mgmt.mib-2.interfaces.ifTable.ifEntry.ifDescr.*
names of all networkinterfaces string (replace the .* with a numer from 1 to max interfaces) "eth1" "imq0" "lo"
1.3.6.1.2.1.2.2.1.4.*
iso.org.dod.internet.mgmt.mib-2.interfaces.ifTable.ifEntry.ifMtu
size of the largest datagram which can be sent/received on the interface octets (replace the .* with specific interface from 1 to max interfaces) "1500" "1454"
1.3.6.1.2.1.2.2.1.5.*
iso.org.dod.internet.mgmt.mib-2.interfaces.ifTable.ifEntry.ifSpeed.*
interface's current bandwidth bits per second (replace the .* with specific interface from 1 to max interfaces) "10000000"
1.3.6.1.2.1.2.2.1.6.*
iso.org.dod.internet.mgmt.mib-2.interfaces.ifTable.ifEntry.ifPhysAddress.*
interface's physical MAC address octet-string (replace the .* with specific interface from 1 to max interfaces) "000625D7D203"
1.3.6.1.2.1.2.2.1.10.*
iso.org.dod.internet.mgmt.mib-2.interfaces.ifTable.ifEntry.ifInOctets.*
total number of octets received on the interface, including framing characters. integer (replace the .* with specific interface from 1 to max interfaces) "3869059965"
1.3.6.1.2.1.2.2.1.16.*
iso.org.dod.internet.mgmt.mib-2.interfaces.ifTable.ifEntry.ifOutOctets.*
total number of octets transmitted out of the interface, including framing characters. integer (replace the .* with specific interface from 1 to max interfaces) "3195287514"
1.3.6.1.2.1.2.2.1.20.*
iso.org.dod.internet.mgmt.mib-2.interfaces.ifTable.ifEntry.ifOutErrors.*
number of outbound packets that could not be transmitted because of errors integer (replace the .* with specific interface from 1 to max interfaces) "95332"

CPU is 1.3.6.1.4.1.2021.10.1.3.1 CPU-Last-1 (1-min Durchschnitt) [0..1] 0.08 1.3.6.1.4.1.2021.10.1.3.2 CPU-Last-5 (5-min Durchschnitt) 0.04 1.3.6.1.4.1.2021.10.1.3.3 CPU-Last-15 (15-min Durchschnitt) 0.02 1.3.6.1.4.1.2021.10.1.5.1 CPU-Last-1 (1-min Durchschnitt) [0..100] 8 1.3.6.1.4.1.2021.10.1.5.2 CPU-Last-5 (5-min Durchschnitt) 4 1.3.6.1.4.1.2021.10.1.5.3 CPU-Last-15 (15-min Durchschnitt) 2

For tcp there are many counters I use tcp active an passive connections at

.1.3.6.1.2.1.6.5.0 and .1.3.6.1.2.1.6.6.0

Uptime 1.3.6.1.2.1.2.2.1.10.5

Total Available Memory .1.3.6.1.2.1.25.2.3.1.5.101

Using SNMP for bandwith monitoring

You can also use SNMP for bandwith monitoring by using programs like MRTG or PRTG Traffic Graphers.

The routers SNMP traffic layout:

                   (___br0___) 
                    / | \ \_ \____ 
                   /  |  \  \__   \_____ 
                  /   |   \    \        \ 
       | [0]    [1]  [2]  [3]  [4] | | [wlan] | 
       |vlan1    ---- vlan0 -----  | |        | 
       | WAN           LAN         | |  WLAN  | 
       |                           | |        | 
       |Internet 1    2    3    4  | |  WLAN  | <-- label 
       +---------------------------+ +--------+ 
             ethernet switch          wireless 
            eth0 (cpu port 5)           eth1


See also