snmp 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +179 -0
- data/Rakefile +34 -39
- data/data/ruby/snmp/mibs/ACCOUNTING-CONTROL-MIB.yaml +33 -32
- data/data/ruby/snmp/mibs/ADSL-LINE-EXT-MIB.yaml +57 -56
- data/data/ruby/snmp/mibs/ADSL-LINE-MIB.yaml +224 -223
- data/data/ruby/snmp/mibs/ADSL-TC-MIB.yaml +1 -0
- data/data/ruby/snmp/mibs/ADSL2-LINE-MIB.yaml +321 -0
- data/data/ruby/snmp/mibs/ADSL2-LINE-TC-MIB.yaml +3 -0
- data/data/ruby/snmp/mibs/AGENTX-MIB.yaml +25 -24
- data/data/ruby/snmp/mibs/AGGREGATE-MIB.yaml +28 -0
- data/data/ruby/snmp/mibs/ALARM-MIB.yaml +77 -0
- data/data/ruby/snmp/mibs/APM-MIB.yaml +75 -74
- data/data/ruby/snmp/mibs/APPC-MIB.yaml +261 -260
- data/data/ruby/snmp/mibs/APPLETALK-MIB.yaml +255 -254
- data/data/ruby/snmp/mibs/APPLICATION-MIB.yaml +138 -137
- data/data/ruby/snmp/mibs/APPN-DLUR-MIB.yaml +30 -29
- data/data/ruby/snmp/mibs/APPN-MIB.yaml +325 -324
- data/data/ruby/snmp/mibs/APPN-TRAP-MIB.yaml +10 -9
- data/data/ruby/snmp/mibs/APS-MIB.yaml +50 -49
- data/data/ruby/snmp/mibs/ARC-MIB.yaml +19 -0
- data/data/ruby/snmp/mibs/ATM-ACCOUNTING-INFORMATION-MIB.yaml +22 -21
- data/data/ruby/snmp/mibs/ATM-MIB.yaml +94 -93
- data/data/ruby/snmp/mibs/ATM-TC-MIB.yaml +12 -11
- data/data/ruby/snmp/mibs/ATM2-MIB.yaml +156 -155
- data/data/ruby/snmp/mibs/BGP4-MIB.yaml +48 -41
- data/data/ruby/snmp/mibs/BLDG-HVAC-MIB.yaml +25 -24
- data/data/ruby/snmp/mibs/BRIDGE-MIB.yaml +50 -44
- data/data/ruby/snmp/mibs/CHARACTER-MIB.yaml +35 -34
- data/data/ruby/snmp/mibs/CIRCUIT-IF-MIB.yaml +13 -12
- data/data/ruby/snmp/mibs/CLNS-MIB.yaml +98 -97
- data/data/ruby/snmp/mibs/COFFEE-POT-MIB.yaml +8 -7
- data/data/ruby/snmp/mibs/COPS-CLIENT-MIB.yaml +38 -37
- data/data/ruby/snmp/mibs/DECNET-PHIV-MIB.yaml +209 -208
- data/data/ruby/snmp/mibs/DIAL-CONTROL-MIB.yaml +72 -71
- data/data/ruby/snmp/mibs/DIFFSERV-CONFIG-MIB.yaml +11 -10
- data/data/ruby/snmp/mibs/DIFFSERV-DSCP-TC.yaml +1 -0
- data/data/ruby/snmp/mibs/DIFFSERV-MIB.yaml +151 -150
- data/data/ruby/snmp/mibs/DIRECTORY-SERVER-MIB.yaml +35 -34
- data/data/ruby/snmp/mibs/DISMAN-EVENT-MIB.yaml +95 -94
- data/data/ruby/snmp/mibs/DISMAN-EXPRESSION-MIB.yaml +37 -36
- data/data/ruby/snmp/mibs/DISMAN-NSLOOKUP-MIB.yaml +15 -14
- data/data/ruby/snmp/mibs/DISMAN-PING-MIB.yaml +43 -42
- data/data/ruby/snmp/mibs/DISMAN-SCHEDULE-MIB.yaml +22 -21
- data/data/ruby/snmp/mibs/DISMAN-SCRIPT-MIB.yaml +64 -63
- data/data/ruby/snmp/mibs/DISMAN-TRACEROUTE-MIB.yaml +59 -58
- data/data/ruby/snmp/mibs/DLSW-MIB.yaml +172 -171
- data/data/ruby/snmp/mibs/DNS-RESOLVER-MIB.yaml +70 -69
- data/data/ruby/snmp/mibs/DNS-SERVER-MIB.yaml +57 -56
- data/data/ruby/snmp/mibs/DOCS-BPI-MIB.yaml +81 -80
- data/data/ruby/snmp/mibs/DOCS-CABLE-DEVICE-MIB.yaml +114 -89
- data/data/ruby/snmp/mibs/DOCS-IETF-BPI2-MIB.yaml +187 -0
- data/data/ruby/snmp/mibs/DOCS-IETF-CABLE-DEVICE-NOTIFICATION-MIB.yaml +39 -0
- data/data/ruby/snmp/mibs/DOCS-IETF-QOS-MIB.yaml +166 -0
- data/data/ruby/snmp/mibs/DOCS-IETF-SUBMGT-MIB.yaml +32 -0
- data/data/ruby/snmp/mibs/DOCS-IF-MIB.yaml +208 -119
- data/data/ruby/snmp/mibs/DOT12-IF-MIB.yaml +21 -20
- data/data/ruby/snmp/mibs/DOT3-EPON-MIB.yaml +101 -0
- data/data/ruby/snmp/mibs/DOT3-OAM-MIB.yaml +82 -0
- data/data/ruby/snmp/mibs/DS0-MIB.yaml +11 -10
- data/data/ruby/snmp/mibs/DS0BUNDLE-MIB.yaml +9 -8
- data/data/ruby/snmp/mibs/DS1-MIB.yaml +102 -98
- data/data/ruby/snmp/mibs/DS3-MIB.yaml +84 -83
- data/data/ruby/snmp/mibs/DSA-MIB.yaml +31 -30
- data/data/ruby/snmp/mibs/DSMON-MIB.yaml +193 -192
- data/data/ruby/snmp/mibs/EBN-MIB.yaml +32 -31
- data/data/ruby/snmp/mibs/EFM-CU-MIB.yaml +113 -0
- data/data/ruby/snmp/mibs/ENTITY-MIB.yaml +41 -38
- data/data/ruby/snmp/mibs/ENTITY-SENSOR-MIB.yaml +8 -7
- data/data/ruby/snmp/mibs/ENTITY-STATE-MIB.yaml +18 -0
- data/data/ruby/snmp/mibs/ENTITY-STATE-TC-MIB.yaml +3 -0
- data/data/ruby/snmp/mibs/ETHER-CHIPSET-MIB.yaml +61 -60
- data/data/ruby/snmp/mibs/ETHER-WIS.yaml +16 -15
- data/data/ruby/snmp/mibs/EtherLike-MIB.yaml +43 -42
- data/data/ruby/snmp/mibs/FC-MGMT-MIB.yaml +154 -0
- data/data/ruby/snmp/mibs/FCIP-MGMT-MIB.yaml +68 -0
- data/data/ruby/snmp/mibs/FDDI-SMT73-MIB.yaml +107 -106
- data/data/ruby/snmp/mibs/FIBRE-CHANNEL-FE-MIB.yaml +100 -99
- data/data/ruby/snmp/mibs/FLOW-METER-MIB.yaml +92 -91
- data/data/ruby/snmp/mibs/FR-ATM-PVC-SERVICE-IWF-MIB.yaml +33 -32
- data/data/ruby/snmp/mibs/FR-MFR-MIB.yaml +38 -37
- data/data/ruby/snmp/mibs/FRAME-RELAY-DTE-MIB.yaml +41 -40
- data/data/ruby/snmp/mibs/FRNETSERV-MIB.yaml +92 -91
- data/data/ruby/snmp/mibs/FRSLD-MIB.yaml +66 -65
- data/data/ruby/snmp/mibs/Finisher-MIB.yaml +38 -37
- data/data/ruby/snmp/mibs/GMPLS-LABEL-STD-MIB.yaml +27 -0
- data/data/ruby/snmp/mibs/GMPLS-LSR-STD-MIB.yaml +20 -0
- data/data/ruby/snmp/mibs/GMPLS-TC-STD-MIB.yaml +3 -0
- data/data/ruby/snmp/mibs/GMPLS-TE-STD-MIB.yaml +72 -0
- data/data/ruby/snmp/mibs/GSMP-MIB.yaml +75 -74
- data/data/ruby/snmp/mibs/HC-ALARM-MIB.yaml +26 -25
- data/data/ruby/snmp/mibs/HC-PerfHist-TC-MIB.yaml +1 -0
- data/data/ruby/snmp/mibs/HC-RMON-MIB.yaml +164 -163
- data/data/ruby/snmp/mibs/HCNUM-TC.yaml +1 -0
- data/data/ruby/snmp/mibs/HDSL2-SHDSL-LINE-MIB.yaml +117 -112
- data/data/ruby/snmp/mibs/HOST-RESOURCES-MIB.yaml +82 -81
- data/data/ruby/snmp/mibs/HOST-RESOURCES-TYPES.yaml +40 -39
- data/data/ruby/snmp/mibs/HPR-IP-MIB.yaml +17 -16
- data/data/ruby/snmp/mibs/HPR-MIB.yaml +64 -63
- data/data/ruby/snmp/mibs/IANA-ITU-ALARM-TC-MIB.yaml +3 -0
- data/data/ruby/snmp/mibs/IF-CAP-STACK-MIB.yaml +13 -0
- data/data/ruby/snmp/mibs/IF-INVERTED-STACK-MIB.yaml +6 -5
- data/data/ruby/snmp/mibs/IF-MIB.yaml +57 -56
- data/data/ruby/snmp/mibs/IFCP-MGMT-MIB.yaml +65 -0
- data/data/ruby/snmp/mibs/IGMP-STD-MIB.yaml +24 -23
- data/data/ruby/snmp/mibs/INET-ADDRESS-MIB.yaml +1 -0
- data/data/ruby/snmp/mibs/INTEGRATED-SERVICES-GUARANTEED-MIB.yaml +6 -5
- data/data/ruby/snmp/mibs/INTEGRATED-SERVICES-MIB.yaml +29 -28
- data/data/ruby/snmp/mibs/INTERFACETOPN-MIB.yaml +21 -20
- data/data/ruby/snmp/mibs/IP-FORWARD-MIB.yaml +49 -27
- data/data/ruby/snmp/mibs/IP-MIB.yaml +243 -40
- data/data/ruby/snmp/mibs/IPATM-IPMC-MIB.yaml +179 -178
- data/data/ruby/snmp/mibs/IPMCAST-MIB.yaml +105 -0
- data/data/ruby/snmp/mibs/IPMROUTE-STD-MIB.yaml +49 -48
- data/data/ruby/snmp/mibs/IPOA-MIB.yaml +74 -73
- data/data/ruby/snmp/mibs/IPS-AUTH-MIB.yaml +68 -0
- data/data/ruby/snmp/mibs/IPSEC-SPD-MIB.yaml +121 -0
- data/data/ruby/snmp/mibs/IPV6-FLOW-LABEL-MIB.yaml +1 -0
- data/data/ruby/snmp/mibs/IPV6-ICMP-MIB.yaml +27 -26
- data/data/ruby/snmp/mibs/IPV6-MIB.yaml +70 -69
- data/data/ruby/snmp/mibs/IPV6-MLD-MIB.yaml +18 -17
- data/data/ruby/snmp/mibs/IPV6-TCP-MIB.yaml +7 -6
- data/data/ruby/snmp/mibs/IPV6-UDP-MIB.yaml +6 -5
- data/data/ruby/snmp/mibs/ISCSI-MIB.yaml +199 -0
- data/data/ruby/snmp/mibs/ISDN-MIB.yaml +57 -56
- data/data/ruby/snmp/mibs/ISIS-MIB.yaml +247 -0
- data/data/ruby/snmp/mibs/ISNS-MIB.yaml +179 -0
- data/data/ruby/snmp/mibs/ITU-ALARM-MIB.yaml +34 -0
- data/data/ruby/snmp/mibs/ITU-ALARM-TC-MIB.yaml +3 -0
- data/data/ruby/snmp/mibs/Job-Monitoring-MIB.yaml +26 -27
- data/data/ruby/snmp/mibs/L2TP-MIB.yaml +138 -137
- data/data/ruby/snmp/mibs/LANGTAG-TC-MIB.yaml +3 -0
- data/data/ruby/snmp/mibs/LMP-MIB.yaml +202 -0
- data/data/ruby/snmp/mibs/MALLOC-MIB.yaml +66 -65
- data/data/ruby/snmp/mibs/MAU-MIB.yaml +55 -95
- data/data/ruby/snmp/mibs/MIDCOM-MIB.yaml +83 -0
- data/data/ruby/snmp/mibs/MIOX25-MIB.yaml +28 -27
- data/data/ruby/snmp/mibs/MIP-MIB.yaml +157 -156
- data/data/ruby/snmp/mibs/MOBILEIPV6-MIB.yaml +189 -0
- data/data/ruby/snmp/mibs/MPLS-FTN-STD-MIB.yaml +29 -28
- data/data/ruby/snmp/mibs/MPLS-L3VPN-STD-MIB.yaml +88 -0
- data/data/ruby/snmp/mibs/MPLS-LC-ATM-STD-MIB.yaml +19 -0
- data/data/ruby/snmp/mibs/MPLS-LC-FR-STD-MIB.yaml +16 -0
- data/data/ruby/snmp/mibs/MPLS-LDP-ATM-STD-MIB.yaml +23 -22
- data/data/ruby/snmp/mibs/MPLS-LDP-FRAME-RELAY-STD-MIB.yaml +17 -16
- data/data/ruby/snmp/mibs/MPLS-LDP-GENERIC-STD-MIB.yaml +9 -8
- data/data/ruby/snmp/mibs/MPLS-LDP-STD-MIB.yaml +103 -102
- data/data/ruby/snmp/mibs/MPLS-LSR-STD-MIB.yaml +85 -84
- data/data/ruby/snmp/mibs/MPLS-TC-STD-MIB.yaml +1 -0
- data/data/ruby/snmp/mibs/MPLS-TE-STD-MIB.yaml +106 -105
- data/data/ruby/snmp/mibs/MSDP-MIB.yaml +71 -0
- data/data/ruby/snmp/mibs/MTA-MIB.yaml +42 -41
- data/data/ruby/snmp/mibs/Modem-MIB.yaml +87 -86
- data/data/ruby/snmp/mibs/NAT-MIB.yaml +116 -0
- data/data/ruby/snmp/mibs/NETWORK-SERVICES-MIB.yaml +18 -17
- data/data/ruby/snmp/mibs/NHRP-MIB.yaml +140 -139
- data/data/ruby/snmp/mibs/NOTIFICATION-LOG-MIB.yaml +37 -36
- data/data/ruby/snmp/mibs/OPT-IF-MIB.yaml +394 -393
- data/data/ruby/snmp/mibs/OSPF-MIB.yaml +192 -123
- data/data/ruby/snmp/mibs/OSPF-TRAP-MIB.yaml +24 -19
- data/data/ruby/snmp/mibs/P-BRIDGE-MIB.yaml +37 -35
- data/data/ruby/snmp/mibs/PARALLEL-MIB.yaml +16 -15
- data/data/ruby/snmp/mibs/PIM-MIB.yaml +47 -46
- data/data/ruby/snmp/mibs/PIM-STD-MIB.yaml +235 -0
- data/data/ruby/snmp/mibs/PINT-MIB.yaml +38 -37
- data/data/ruby/snmp/mibs/PKTC-IETF-MTA-MIB.yaml +81 -0
- data/data/ruby/snmp/mibs/PKTC-IETF-SIG-MIB.yaml +128 -0
- data/data/ruby/snmp/mibs/POLICY-BASED-MANAGEMENT-MIB.yaml +94 -0
- data/data/ruby/snmp/mibs/POWER-ETHERNET-MIB.yaml +27 -26
- data/data/ruby/snmp/mibs/PPP-BRIDGE-NCP-MIB.yaml +16 -15
- data/data/ruby/snmp/mibs/PPP-IP-NCP-MIB.yaml +7 -6
- data/data/ruby/snmp/mibs/PPP-LCP-MIB.yaml +33 -32
- data/data/ruby/snmp/mibs/PPP-SEC-MIB.yaml +13 -12
- data/data/ruby/snmp/mibs/PTOPO-MIB.yaml +29 -28
- data/data/ruby/snmp/mibs/PerfHist-TC-MIB.yaml +1 -0
- data/data/ruby/snmp/mibs/Printer-MIB.yaml +185 -184
- data/data/ruby/snmp/mibs/Q-BRIDGE-MIB.yaml +96 -82
- data/data/ruby/snmp/mibs/RADIUS-ACC-CLIENT-MIB.yaml +34 -16
- data/data/ruby/snmp/mibs/RADIUS-ACC-SERVER-MIB.yaml +40 -24
- data/data/ruby/snmp/mibs/RADIUS-AUTH-CLIENT-MIB.yaml +38 -18
- data/data/ruby/snmp/mibs/RADIUS-AUTH-SERVER-MIB.yaml +40 -23
- data/data/ruby/snmp/mibs/RADIUS-DYNAUTH-CLIENT-MIB.yaml +44 -0
- data/data/ruby/snmp/mibs/RADIUS-DYNAUTH-SERVER-MIB.yaml +40 -0
- data/data/ruby/snmp/mibs/RAQMON-MIB.yaml +90 -0
- data/data/ruby/snmp/mibs/RDBMS-MIB.yaml +69 -68
- data/data/ruby/snmp/mibs/RFC1065-SMI.yaml +4 -5
- data/data/ruby/snmp/mibs/RFC1155-SMI.yaml +4 -5
- data/data/ruby/snmp/mibs/RFC1158-MIB.yaml +174 -173
- data/data/ruby/snmp/mibs/RFC1213-MIB.yaml +173 -172
- data/data/ruby/snmp/mibs/RFC1269-MIB.yaml +20 -19
- data/data/ruby/snmp/mibs/RFC1271-MIB.yaml +185 -184
- data/data/ruby/snmp/mibs/RFC1285-MIB.yaml +85 -84
- data/data/ruby/snmp/mibs/RFC1316-MIB.yaml +30 -29
- data/data/ruby/snmp/mibs/RFC1381-MIB.yaml +40 -39
- data/data/ruby/snmp/mibs/RFC1382-MIB.yaml +149 -148
- data/data/ruby/snmp/mibs/RFC1414-MIB.yaml +4 -3
- data/data/ruby/snmp/mibs/RIPv2-MIB.yaml +25 -24
- data/data/ruby/snmp/mibs/RMON-MIB.yaml +192 -191
- data/data/ruby/snmp/mibs/RMON2-MIB.yaml +253 -252
- data/data/ruby/snmp/mibs/ROHC-MIB.yaml +49 -48
- data/data/ruby/snmp/mibs/ROHC-RTP-MIB.yaml +19 -18
- data/data/ruby/snmp/mibs/ROHC-UNCOMPRESSED-MIB.yaml +6 -5
- data/data/ruby/snmp/mibs/RS-232-MIB.yaml +36 -35
- data/data/ruby/snmp/mibs/RSTP-MIB.yaml +18 -0
- data/data/ruby/snmp/mibs/RSVP-MIB.yaml +137 -136
- data/data/ruby/snmp/mibs/RTP-MIB.yaml +42 -41
- data/data/ruby/snmp/mibs/SCSI-MIB.yaml +160 -0
- data/data/ruby/snmp/mibs/SCTP-MIB.yaml +83 -0
- data/data/ruby/snmp/mibs/SFLOW-MIB.yaml +15 -14
- data/data/ruby/snmp/mibs/SIP-COMMON-MIB.yaml +112 -0
- data/data/ruby/snmp/mibs/SIP-MIB.yaml +56 -55
- data/data/ruby/snmp/mibs/SIP-SERVER-MIB.yaml +52 -0
- data/data/ruby/snmp/mibs/SIP-TC-MIB.yaml +3 -0
- data/data/ruby/snmp/mibs/SIP-UA-MIB.yaml +14 -0
- data/data/ruby/snmp/mibs/SLAPM-MIB.yaml +134 -133
- data/data/ruby/snmp/mibs/SMON-MIB.yaml +47 -46
- data/data/ruby/snmp/mibs/SNA-NAU-MIB.yaml +117 -116
- data/data/ruby/snmp/mibs/SNA-SDLC-MIB.yaml +126 -125
- data/data/ruby/snmp/mibs/SNMP-COMMUNITY-MIB.yaml +12 -11
- data/data/ruby/snmp/mibs/SNMP-FRAMEWORK-MIB.yaml +8 -7
- data/data/ruby/snmp/mibs/SNMP-MPD-MIB.yaml +6 -5
- data/data/ruby/snmp/mibs/SNMP-NOTIFICATION-MIB.yaml +16 -15
- data/data/ruby/snmp/mibs/SNMP-PROXY-MIB.yaml +10 -9
- data/data/ruby/snmp/mibs/SNMP-REPEATER-MIB.yaml +120 -119
- data/data/ruby/snmp/mibs/SNMP-TARGET-MIB.yaml +19 -18
- data/data/ruby/snmp/mibs/SNMP-USER-BASED-SM-MIB.yaml +26 -25
- data/data/ruby/snmp/mibs/SNMP-USM-AES-MIB.yaml +4 -0
- data/data/ruby/snmp/mibs/SNMP-USM-DH-OBJECTS-MIB.yaml +10 -9
- data/data/ruby/snmp/mibs/SNMP-VIEW-BASED-ACM-MIB.yaml +26 -25
- data/data/ruby/snmp/mibs/SNMPv2-MIB.yaml +46 -45
- data/data/ruby/snmp/mibs/SNMPv2-SMI.yaml +12 -11
- data/data/ruby/snmp/mibs/SNMPv2-TM.yaml +5 -4
- data/data/ruby/snmp/mibs/SNMPv2-USEC-MIB.yaml +10 -9
- data/data/ruby/snmp/mibs/SONET-MIB.yaml +110 -109
- data/data/ruby/snmp/mibs/SOURCE-ROUTING-MIB.yaml +18 -17
- data/data/ruby/snmp/mibs/SSPM-MIB.yaml +67 -0
- data/data/ruby/snmp/mibs/SYSAPPL-MIB.yaml +65 -64
- data/data/ruby/snmp/mibs/T11-FC-FABRIC-ADDR-MGR-MIB.yaml +63 -0
- data/data/ruby/snmp/mibs/T11-FC-FABRIC-CONFIG-SERVER-MIB.yaml +100 -0
- data/data/ruby/snmp/mibs/T11-FC-FABRIC-LOCK-MIB.yaml +22 -0
- data/data/ruby/snmp/mibs/T11-FC-FSPF-MIB.yaml +70 -0
- data/data/ruby/snmp/mibs/T11-FC-NAME-SERVER-MIB.yaml +56 -0
- data/data/ruby/snmp/mibs/T11-FC-ROUTE-MIB.yaml +27 -0
- data/data/ruby/snmp/mibs/T11-FC-RSCN-MIB.yaml +47 -0
- data/data/ruby/snmp/mibs/T11-FC-VIRTUAL-FABRIC-MIB.yaml +31 -0
- data/data/ruby/snmp/mibs/T11-FC-ZONE-SERVER-MIB.yaml +124 -0
- data/data/ruby/snmp/mibs/T11-TC-MIB.yaml +3 -0
- data/data/ruby/snmp/mibs/TCP-ESTATS-MIB.yaml +167 -0
- data/data/ruby/snmp/mibs/TCP-MIB.yaml +37 -18
- data/data/ruby/snmp/mibs/TCPIPX-MIB.yaml +16 -15
- data/data/ruby/snmp/mibs/TE-LINK-STD-MIB.yaml +82 -0
- data/data/ruby/snmp/mibs/TE-MIB.yaml +81 -0
- data/data/ruby/snmp/mibs/TIME-AGGREGATE-MIB.yaml +22 -0
- data/data/ruby/snmp/mibs/TN3270E-MIB.yaml +85 -84
- data/data/ruby/snmp/mibs/TN3270E-RT-MIB.yaml +33 -32
- data/data/ruby/snmp/mibs/TOKEN-RING-RMON-MIB.yaml +159 -158
- data/data/ruby/snmp/mibs/TOKENRING-MIB.yaml +42 -41
- data/data/ruby/snmp/mibs/TOKENRING-STATION-SR-MIB.yaml +8 -7
- data/data/ruby/snmp/mibs/TRANSPORT-ADDRESS-MIB.yaml +13 -12
- data/data/ruby/snmp/mibs/TRIP-MIB.yaml +118 -0
- data/data/ruby/snmp/mibs/TRIP-TC-MIB.yaml +3 -0
- data/data/ruby/snmp/mibs/TUNNEL-MIB.yaml +29 -13
- data/data/ruby/snmp/mibs/UDP-MIB.yaml +19 -6
- data/data/ruby/snmp/mibs/UDPLITE-MIB.yaml +26 -0
- data/data/ruby/snmp/mibs/UPS-MIB.yaml +100 -99
- data/data/ruby/snmp/mibs/URI-TC-MIB.yaml +3 -0
- data/data/ruby/snmp/mibs/VDSL-LINE-EXT-MCM-MIB.yaml +42 -0
- data/data/ruby/snmp/mibs/VDSL-LINE-EXT-SCM-MIB.yaml +27 -0
- data/data/ruby/snmp/mibs/VDSL-LINE-MIB.yaml +162 -161
- data/data/ruby/snmp/mibs/VPN-TC-STD-MIB.yaml +3 -0
- data/data/ruby/snmp/mibs/VRRP-MIB.yaml +39 -38
- data/data/ruby/snmp/mibs/WWW-MIB.yaml +75 -74
- data/examples/dump.rb +5 -5
- data/examples/iftable.rb +4 -4
- data/examples/link_down.rb +18 -18
- data/examples/log_traps.rb +9 -9
- data/examples/walk.rb +4 -4
- data/lib/snmp/agent.rb +42 -43
- data/lib/snmp/ber.rb +155 -156
- data/lib/snmp/manager.rb +412 -372
- data/lib/snmp/mib.rb +172 -182
- data/lib/snmp/options.rb +64 -0
- data/lib/snmp/pdu.rb +245 -245
- data/lib/snmp/varbind.rb +346 -341
- data/lib/snmp/version.rb +3 -0
- data/test/test_ber.rb +232 -233
- data/test/test_manager.rb +277 -238
- data/test/test_mib.rb +57 -57
- data/test/test_pdu.rb +172 -172
- data/test/test_retry.rb +54 -54
- data/test/test_smi.rb +10 -10
- data/test/test_varbind.rb +342 -331
- data/test/test_walk.rb +150 -150
- metadata +103 -45
- data/README +0 -252
- data/setup.rb +0 -1360
@@ -1,91 +1,92 @@
|
|
1
1
|
---
|
2
|
-
|
2
|
+
wwwMIB: 1.3.6.1.2.1.65
|
3
|
+
wwwMIBObjects: 1.3.6.1.2.1.65.1
|
4
|
+
wwwService: 1.3.6.1.2.1.65.1.1
|
5
|
+
wwwServiceTable: 1.3.6.1.2.1.65.1.1.1
|
6
|
+
wwwServiceEntry: 1.3.6.1.2.1.65.1.1.1.1
|
7
|
+
wwwServiceIndex: 1.3.6.1.2.1.65.1.1.1.1.1
|
8
|
+
wwwServiceDescription: 1.3.6.1.2.1.65.1.1.1.1.2
|
9
|
+
wwwServiceContact: 1.3.6.1.2.1.65.1.1.1.1.3
|
10
|
+
wwwServiceProtocol: 1.3.6.1.2.1.65.1.1.1.1.4
|
11
|
+
wwwServiceName: 1.3.6.1.2.1.65.1.1.1.1.5
|
12
|
+
wwwServiceType: 1.3.6.1.2.1.65.1.1.1.1.6
|
13
|
+
wwwServiceStartTime: 1.3.6.1.2.1.65.1.1.1.1.7
|
3
14
|
wwwServiceOperStatus: 1.3.6.1.2.1.65.1.1.1.1.8
|
4
|
-
|
5
|
-
|
15
|
+
wwwServiceLastChange: 1.3.6.1.2.1.65.1.1.1.1.9
|
16
|
+
wwwProtocolStatistics: 1.3.6.1.2.1.65.1.2
|
17
|
+
wwwSummaryTable: 1.3.6.1.2.1.65.1.2.1
|
18
|
+
wwwSummaryEntry: 1.3.6.1.2.1.65.1.2.1.1
|
19
|
+
wwwSummaryInRequests: 1.3.6.1.2.1.65.1.2.1.1.1
|
20
|
+
wwwSummaryOutRequests: 1.3.6.1.2.1.65.1.2.1.1.2
|
21
|
+
wwwSummaryInResponses: 1.3.6.1.2.1.65.1.2.1.1.3
|
22
|
+
wwwSummaryOutResponses: 1.3.6.1.2.1.65.1.2.1.1.4
|
23
|
+
wwwSummaryInBytes: 1.3.6.1.2.1.65.1.2.1.1.5
|
24
|
+
wwwSummaryInLowBytes: 1.3.6.1.2.1.65.1.2.1.1.6
|
25
|
+
wwwSummaryOutBytes: 1.3.6.1.2.1.65.1.2.1.1.7
|
26
|
+
wwwSummaryOutLowBytes: 1.3.6.1.2.1.65.1.2.1.1.8
|
6
27
|
wwwRequestInTable: 1.3.6.1.2.1.65.1.2.2
|
7
28
|
wwwRequestInEntry: 1.3.6.1.2.1.65.1.2.2.1
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
wwwResponseOutIndex: 1.3.6.1.2.1.65.1.2.5.1.1
|
12
|
-
wwwDocBucketTable: 1.3.6.1.2.1.65.1.3.3
|
29
|
+
wwwRequestInIndex: 1.3.6.1.2.1.65.1.2.2.1.1
|
30
|
+
wwwRequestInRequests: 1.3.6.1.2.1.65.1.2.2.1.2
|
31
|
+
wwwRequestInBytes: 1.3.6.1.2.1.65.1.2.2.1.3
|
13
32
|
wwwRequestInLastTime: 1.3.6.1.2.1.65.1.2.2.1.4
|
14
|
-
wwwSummaryInResponses: 1.3.6.1.2.1.65.1.2.1.1.3
|
15
|
-
wwwDocAccessTopNBytes: 1.3.6.1.2.1.65.1.3.4.1.4
|
16
|
-
wwwServiceContact: 1.3.6.1.2.1.65.1.1.1.1.3
|
17
|
-
wwwServiceStartTime: 1.3.6.1.2.1.65.1.1.1.1.7
|
18
33
|
wwwRequestOutTable: 1.3.6.1.2.1.65.1.2.3
|
19
34
|
wwwRequestOutEntry: 1.3.6.1.2.1.65.1.2.3.1
|
20
|
-
|
21
|
-
|
22
|
-
wwwDocLastNEntry: 1.3.6.1.2.1.65.1.3.2.1
|
23
|
-
wwwSummaryInBytes: 1.3.6.1.2.1.65.1.2.1.1.5
|
24
|
-
wwwRequestInBytes: 1.3.6.1.2.1.65.1.2.2.1.3
|
35
|
+
wwwRequestOutIndex: 1.3.6.1.2.1.65.1.2.3.1.1
|
36
|
+
wwwRequestOutRequests: 1.3.6.1.2.1.65.1.2.3.1.2
|
25
37
|
wwwRequestOutBytes: 1.3.6.1.2.1.65.1.2.3.1.3
|
26
|
-
|
27
|
-
wwwResponseOutResponses: 1.3.6.1.2.1.65.1.2.5.1.2
|
28
|
-
wwwDocLastNName: 1.3.6.1.2.1.65.1.3.2.1.2
|
29
|
-
wwwSummaryOutResponses: 1.3.6.1.2.1.65.1.2.1.1.4
|
30
|
-
wwwDocCtrlBucketTimeInterval: 1.3.6.1.2.1.65.1.3.1.1.4
|
31
|
-
wwwDocBucketDocuments: 1.3.6.1.2.1.65.1.3.3.1.4
|
32
|
-
wwwSummaryOutBytes: 1.3.6.1.2.1.65.1.2.1.1.7
|
33
|
-
wwwResponseInIndex: 1.3.6.1.2.1.65.1.2.4.1.1
|
34
|
-
wwwDocLastNBytes: 1.3.6.1.2.1.65.1.3.2.1.7
|
35
|
-
wwwDocCtrlEntry: 1.3.6.1.2.1.65.1.3.1.1
|
36
|
-
wwwDocBytesTopNIndex: 1.3.6.1.2.1.65.1.3.5.1.1
|
37
|
-
wwwService: 1.3.6.1.2.1.65.1.1
|
38
|
-
wwwProtocolStatistics: 1.3.6.1.2.1.65.1.2
|
39
|
-
wwwDocBucketTimeStamp: 1.3.6.1.2.1.65.1.3.3.1.2
|
40
|
-
wwwMIBGroups: 1.3.6.1.2.1.65.2.2
|
41
|
-
wwwSummaryTable: 1.3.6.1.2.1.65.1.2.1
|
38
|
+
wwwRequestOutLastTime: 1.3.6.1.2.1.65.1.2.3.1.4
|
42
39
|
wwwResponseInTable: 1.3.6.1.2.1.65.1.2.4
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
wwwDocCtrlLastNLock: 1.3.6.1.2.1.65.1.3.1.1.2
|
48
|
-
wwwMIBCompliances: 1.3.6.1.2.1.65.2.1
|
49
|
-
wwwDocAccessTopNName: 1.3.6.1.2.1.65.1.3.4.1.2
|
50
|
-
wwwDocBytesTopNTable: 1.3.6.1.2.1.65.1.3.5
|
51
|
-
wwwDocBucketEntry: 1.3.6.1.2.1.65.1.3.3.1
|
52
|
-
wwwDocCtrlBuckets: 1.3.6.1.2.1.65.1.3.1.1.3
|
53
|
-
wwwServiceName: 1.3.6.1.2.1.65.1.1.1.1.5
|
54
|
-
wwwServiceTable: 1.3.6.1.2.1.65.1.1.1
|
40
|
+
wwwResponseInEntry: 1.3.6.1.2.1.65.1.2.4.1
|
41
|
+
wwwResponseInIndex: 1.3.6.1.2.1.65.1.2.4.1.1
|
42
|
+
wwwResponseInResponses: 1.3.6.1.2.1.65.1.2.4.1.2
|
43
|
+
wwwResponseInBytes: 1.3.6.1.2.1.65.1.2.4.1.3
|
55
44
|
wwwResponseInLastTime: 1.3.6.1.2.1.65.1.2.4.1.4
|
56
|
-
wwwDocLastNTimeStamp: 1.3.6.1.2.1.65.1.3.2.1.3
|
57
|
-
wwwDocAccessTopNAccesses: 1.3.6.1.2.1.65.1.3.4.1.3
|
58
45
|
wwwResponseOutTable: 1.3.6.1.2.1.65.1.2.5
|
59
46
|
wwwResponseOutEntry: 1.3.6.1.2.1.65.1.2.5.1
|
60
|
-
|
61
|
-
|
62
|
-
wwwDocAccessTopNIndex: 1.3.6.1.2.1.65.1.3.4.1.1
|
63
|
-
wwwDocLastNStatusMsg: 1.3.6.1.2.1.65.1.3.2.1.6
|
64
|
-
wwwRequestInIndex: 1.3.6.1.2.1.65.1.2.2.1.1
|
65
|
-
wwwDocBytesTopNBytes: 1.3.6.1.2.1.65.1.3.5.1.4
|
66
|
-
wwwDocCtrlLastNSize: 1.3.6.1.2.1.65.1.3.1.1.1
|
67
|
-
wwwRequestOutIndex: 1.3.6.1.2.1.65.1.2.3.1.1
|
47
|
+
wwwResponseOutIndex: 1.3.6.1.2.1.65.1.2.5.1.1
|
48
|
+
wwwResponseOutResponses: 1.3.6.1.2.1.65.1.2.5.1.2
|
68
49
|
wwwResponseOutBytes: 1.3.6.1.2.1.65.1.2.5.1.3
|
69
|
-
wwwDocAccessTopNTable: 1.3.6.1.2.1.65.1.3.4
|
70
|
-
wwwDocBytesTopNAccesses: 1.3.6.1.2.1.65.1.3.5.1.3
|
71
|
-
wwwResponseInResponses: 1.3.6.1.2.1.65.1.2.4.1.2
|
72
|
-
wwwRequestOutRequests: 1.3.6.1.2.1.65.1.2.3.1.2
|
73
|
-
wwwDocLastNIndex: 1.3.6.1.2.1.65.1.3.2.1.1
|
74
|
-
wwwResponseInEntry: 1.3.6.1.2.1.65.1.2.4.1
|
75
|
-
wwwDocLastNTable: 1.3.6.1.2.1.65.1.3.2
|
76
|
-
wwwServiceDescription: 1.3.6.1.2.1.65.1.1.1.1.2
|
77
|
-
wwwServiceProtocol: 1.3.6.1.2.1.65.1.1.1.1.4
|
78
|
-
wwwSummaryEntry: 1.3.6.1.2.1.65.1.2.1.1
|
79
|
-
wwwMIBObjects: 1.3.6.1.2.1.65.1
|
80
|
-
wwwDocBytesTopNEntry: 1.3.6.1.2.1.65.1.3.5.1
|
81
|
-
wwwServiceEntry: 1.3.6.1.2.1.65.1.1.1.1
|
82
|
-
wwwRequestOutLastTime: 1.3.6.1.2.1.65.1.2.3.1.4
|
83
|
-
wwwSummaryOutLowBytes: 1.3.6.1.2.1.65.1.2.1.1.8
|
84
|
-
wwwServiceType: 1.3.6.1.2.1.65.1.1.1.1.6
|
85
|
-
wwwDocLastNResponseType: 1.3.6.1.2.1.65.1.3.2.1.5
|
86
|
-
wwwMIB: 1.3.6.1.2.1.65
|
87
|
-
wwwRequestInRequests: 1.3.6.1.2.1.65.1.2.2.1.2
|
88
50
|
wwwResponseOutLastTime: 1.3.6.1.2.1.65.1.2.5.1.4
|
89
51
|
wwwDocumentStatistics: 1.3.6.1.2.1.65.1.3
|
90
52
|
wwwDocCtrlTable: 1.3.6.1.2.1.65.1.3.1
|
53
|
+
wwwDocCtrlEntry: 1.3.6.1.2.1.65.1.3.1.1
|
54
|
+
wwwDocCtrlLastNSize: 1.3.6.1.2.1.65.1.3.1.1.1
|
55
|
+
wwwDocCtrlLastNLock: 1.3.6.1.2.1.65.1.3.1.1.2
|
56
|
+
wwwDocCtrlBuckets: 1.3.6.1.2.1.65.1.3.1.1.3
|
57
|
+
wwwDocCtrlBucketTimeInterval: 1.3.6.1.2.1.65.1.3.1.1.4
|
58
|
+
wwwDocCtrlTopNSize: 1.3.6.1.2.1.65.1.3.1.1.5
|
59
|
+
wwwDocLastNTable: 1.3.6.1.2.1.65.1.3.2
|
60
|
+
wwwDocLastNEntry: 1.3.6.1.2.1.65.1.3.2.1
|
61
|
+
wwwDocLastNIndex: 1.3.6.1.2.1.65.1.3.2.1.1
|
62
|
+
wwwDocLastNName: 1.3.6.1.2.1.65.1.3.2.1.2
|
63
|
+
wwwDocLastNTimeStamp: 1.3.6.1.2.1.65.1.3.2.1.3
|
64
|
+
wwwDocLastNRequestType: 1.3.6.1.2.1.65.1.3.2.1.4
|
65
|
+
wwwDocLastNResponseType: 1.3.6.1.2.1.65.1.3.2.1.5
|
66
|
+
wwwDocLastNStatusMsg: 1.3.6.1.2.1.65.1.3.2.1.6
|
67
|
+
wwwDocLastNBytes: 1.3.6.1.2.1.65.1.3.2.1.7
|
68
|
+
wwwDocBucketTable: 1.3.6.1.2.1.65.1.3.3
|
69
|
+
wwwDocBucketEntry: 1.3.6.1.2.1.65.1.3.3.1
|
91
70
|
wwwDocBucketIndex: 1.3.6.1.2.1.65.1.3.3.1.1
|
71
|
+
wwwDocBucketTimeStamp: 1.3.6.1.2.1.65.1.3.3.1.2
|
72
|
+
wwwDocBucketAccesses: 1.3.6.1.2.1.65.1.3.3.1.3
|
73
|
+
wwwDocBucketDocuments: 1.3.6.1.2.1.65.1.3.3.1.4
|
74
|
+
wwwDocBucketBytes: 1.3.6.1.2.1.65.1.3.3.1.5
|
75
|
+
wwwDocAccessTopNTable: 1.3.6.1.2.1.65.1.3.4
|
76
|
+
wwwDocAccessTopNEntry: 1.3.6.1.2.1.65.1.3.4.1
|
77
|
+
wwwDocAccessTopNIndex: 1.3.6.1.2.1.65.1.3.4.1.1
|
78
|
+
wwwDocAccessTopNName: 1.3.6.1.2.1.65.1.3.4.1.2
|
79
|
+
wwwDocAccessTopNAccesses: 1.3.6.1.2.1.65.1.3.4.1.3
|
80
|
+
wwwDocAccessTopNBytes: 1.3.6.1.2.1.65.1.3.4.1.4
|
81
|
+
wwwDocAccessTopNLastResponseType: 1.3.6.1.2.1.65.1.3.4.1.5
|
82
|
+
wwwDocBytesTopNTable: 1.3.6.1.2.1.65.1.3.5
|
83
|
+
wwwDocBytesTopNEntry: 1.3.6.1.2.1.65.1.3.5.1
|
84
|
+
wwwDocBytesTopNIndex: 1.3.6.1.2.1.65.1.3.5.1.1
|
85
|
+
wwwDocBytesTopNName: 1.3.6.1.2.1.65.1.3.5.1.2
|
86
|
+
wwwDocBytesTopNAccesses: 1.3.6.1.2.1.65.1.3.5.1.3
|
87
|
+
wwwDocBytesTopNBytes: 1.3.6.1.2.1.65.1.3.5.1.4
|
88
|
+
wwwDocBytesTopNLastResponseType: 1.3.6.1.2.1.65.1.3.5.1.5
|
89
|
+
wwwMIBConformance: 1.3.6.1.2.1.65.2
|
90
|
+
wwwMIBCompliances: 1.3.6.1.2.1.65.2.1
|
91
|
+
wwwMIBGroups: 1.3.6.1.2.1.65.2.2
|
92
|
+
|
data/examples/dump.rb
CHANGED
@@ -7,9 +7,9 @@ manager = Manager.new(:Host => host, :Port => 161)
|
|
7
7
|
start_oid = ObjectId.new("1.3.6.1.2")
|
8
8
|
next_oid = start_oid
|
9
9
|
while next_oid.subtree_of?(start_oid)
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
response = manager.get_next(next_oid)
|
11
|
+
varbind = response.varbind_list.first
|
12
|
+
break if EndOfMibView == varbind.value
|
13
|
+
next_oid = varbind.name
|
14
|
+
puts "#{varbind.name.to_s} #{varbind.value.to_s} #{varbind.value.asn1_type}"
|
15
15
|
end
|
data/examples/iftable.rb
CHANGED
@@ -7,8 +7,8 @@ manager = Manager.new(:Host => host, :Port => 161)
|
|
7
7
|
ifTable = ObjectId.new("1.3.6.1.2.1.2.2")
|
8
8
|
next_oid = ifTable
|
9
9
|
while next_oid.subtree_of?(ifTable)
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
response = manager.get_next(next_oid)
|
11
|
+
varbind = response.varbind_list.first
|
12
|
+
next_oid = varbind.name
|
13
|
+
puts "#{varbind.name.to_s} #{varbind.value.to_s} #{varbind.value.asn1_type}"
|
14
14
|
end
|
data/examples/link_down.rb
CHANGED
@@ -15,29 +15,29 @@ ADMIN_DOWN = 2
|
|
15
15
|
listener = SNMP::TrapListener.new(:Port => 1062, :Community => 'public') do |listener|
|
16
16
|
log.info "Listening for linkDown traps"
|
17
17
|
listener.on_trap(linkDown_OID) do |trap|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
18
|
+
vb_list = trap.vb_list
|
19
|
+
up_time = vb_list[0].value # standard varbind - always in v2c trap
|
20
|
+
trap_oid = vb_list[1].value # standard varbind - always in v2c trap
|
21
|
+
|
22
|
+
# extract trap info - order determined by IF-MIB
|
23
|
+
ifIndex = vb_list[2].value
|
24
|
+
adminStatus = vb_list[3].value
|
25
|
+
operStatus = vb_list[4].value
|
26
|
+
|
27
|
+
# log stuff based on interface status
|
28
|
+
if adminStatus == ADMIN_DOWN
|
29
|
+
log.info "Interface #{ifIndex} turned down"
|
30
|
+
else
|
31
|
+
log.error "Problem on interface #{ifIndex}! Link unintentionally down"
|
32
|
+
end
|
33
33
|
end
|
34
|
-
|
34
|
+
|
35
35
|
listener.on_trap_v1 do |trap|
|
36
|
-
|
36
|
+
log.warn "Unexpected v1 trap: #{trap.generic_trap}"
|
37
37
|
end
|
38
38
|
|
39
39
|
listener.on_trap_v2c do |trap|
|
40
|
-
|
40
|
+
log.warn "Unexpected v2c trap: #{trap.trap_oid}"
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
data/examples/log_traps.rb
CHANGED
@@ -2,22 +2,22 @@ require 'snmp'
|
|
2
2
|
require 'logger'
|
3
3
|
|
4
4
|
def format_v1_trap(trap)
|
5
|
-
|
5
|
+
"Trap #{trap.generic_trap} from #{trap.source_ip}"
|
6
6
|
end
|
7
7
|
|
8
8
|
def format_v2c_trap(trap)
|
9
|
-
|
9
|
+
"Trap #{trap.trap_oid} from #{trap.source_ip}"
|
10
10
|
end
|
11
11
|
|
12
12
|
log = Logger.new(STDOUT)
|
13
13
|
m = SNMP::TrapManager.new(:Port => 1062) do |manager|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
14
|
+
manager.on_trap_v1 do |trap|
|
15
|
+
log.info format_v1_trap(trap)
|
16
|
+
end
|
17
|
+
manager.on_trap_v2c do |trap|
|
18
|
+
log.info format_v2c_trap(trap)
|
19
|
+
end
|
20
|
+
log.info "Logging started"
|
21
21
|
end
|
22
22
|
trap("INT") { log.info "Logging stopped"; m.exit }
|
23
23
|
m.join
|
data/examples/walk.rb
CHANGED
@@ -3,12 +3,12 @@ require 'snmp'
|
|
3
3
|
host = ARGV[0] || 'localhost'
|
4
4
|
|
5
5
|
SNMP::Manager.open(:Host => "localhost") do |manager|
|
6
|
-
|
6
|
+
manager.walk("ifTable") { |vb| puts vb }
|
7
7
|
end
|
8
8
|
|
9
9
|
|
10
10
|
SNMP::Manager.open(:Host => host) do |manager|
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
manager.walk(["ifIndex", "ifDescr"]) do |ifIndex, ifDescr|
|
12
|
+
puts "#{ifIndex} #{ifDescr}"
|
13
|
+
end
|
14
14
|
end
|
data/lib/snmp/agent.rb
CHANGED
@@ -13,62 +13,61 @@ require 'logger'
|
|
13
13
|
|
14
14
|
module SNMP
|
15
15
|
|
16
|
-
class Agent #:nodoc:all
|
16
|
+
class Agent #:nodoc:all
|
17
17
|
|
18
18
|
def initialize(listen_port=161, max_packet=8000)
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
19
|
+
@log = Logger.new(STDOUT)
|
20
|
+
@log.level = Logger::DEBUG
|
21
|
+
@max_packet = max_packet
|
22
|
+
@socket = UDPSocket.open
|
23
|
+
@socket.bind(nil, listen_port)
|
24
|
+
@mib = MIB::SystemMIB.new
|
25
25
|
end
|
26
|
-
|
26
|
+
|
27
27
|
def start
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
end
|
41
|
-
when SetRequest
|
42
|
-
response = message.response
|
43
|
-
else
|
44
|
-
raise "invalid message #{message.to_s}"
|
45
|
-
end
|
46
|
-
puts "Responding to #{remote_info[3]}:#{remote_info[1]}"
|
47
|
-
encoded_message = response.encode
|
48
|
-
n=@socket.send(encoded_message, 0, remote_info[3], remote_info[1])
|
49
|
-
p encoded_message
|
50
|
-
rescue => e
|
51
|
-
@log.error e
|
52
|
-
shutdown
|
28
|
+
@log.info "SNMP agent running"
|
29
|
+
loop do
|
30
|
+
begin
|
31
|
+
data, remote_info = @socket.recvfrom(@max_packet)
|
32
|
+
puts "Received #{data.length} bytes"
|
33
|
+
p data
|
34
|
+
message = Message.decode(data)
|
35
|
+
case message.pdu
|
36
|
+
when GetRequest
|
37
|
+
response = message.response
|
38
|
+
response.pdu.varbind_list.each do |v|
|
39
|
+
v.value = @mib.get(v.name)
|
53
40
|
end
|
41
|
+
when SetRequest
|
42
|
+
response = message.response
|
43
|
+
else
|
44
|
+
raise "invalid message #{message.to_s}"
|
45
|
+
end
|
46
|
+
puts "Responding to #{remote_info[3]}:#{remote_info[1]}"
|
47
|
+
encoded_message = response.encode
|
48
|
+
n=@socket.send(encoded_message, 0, remote_info[3], remote_info[1])
|
49
|
+
p encoded_message
|
50
|
+
rescue => e
|
51
|
+
@log.error e
|
52
|
+
shutdown
|
54
53
|
end
|
54
|
+
end
|
55
55
|
end
|
56
|
-
|
56
|
+
|
57
57
|
def shutdown
|
58
|
-
|
59
|
-
|
60
|
-
|
58
|
+
@log.info "SNMP agent stopping"
|
59
|
+
@socket.close
|
60
|
+
exit
|
61
61
|
end
|
62
62
|
|
63
63
|
alias stop :shutdown
|
64
|
-
|
65
|
-
end
|
64
|
+
|
65
|
+
end
|
66
66
|
|
67
67
|
end
|
68
68
|
|
69
69
|
if $0 == __FILE__
|
70
|
-
agent = SNMP::Agent.new(1061)
|
71
|
-
trap("INT") { agent.shutdown }
|
72
|
-
agent.start
|
70
|
+
agent = SNMP::Agent.new(1061)
|
71
|
+
trap("INT") { agent.shutdown }
|
72
|
+
agent.start
|
73
73
|
end
|
74
|
-
|
data/lib/snmp/ber.rb
CHANGED
@@ -11,11 +11,11 @@
|
|
11
11
|
# Add ord method to Fixnum for forward compatibility with Ruby 1.9
|
12
12
|
#
|
13
13
|
if "a"[0].kind_of? Fixnum
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
end
|
14
|
+
unless Fixnum.methods.include? :ord
|
15
|
+
class Fixnum
|
16
|
+
def ord; self; end
|
18
17
|
end
|
18
|
+
end
|
19
19
|
end
|
20
20
|
|
21
21
|
#
|
@@ -23,7 +23,7 @@ end
|
|
23
23
|
# using the ASN.1 BER (Basic Encoding Rules).
|
24
24
|
#
|
25
25
|
module SNMP
|
26
|
-
module BER #:nodoc:all
|
26
|
+
module BER #:nodoc:all
|
27
27
|
|
28
28
|
# SNMP version codes
|
29
29
|
SNMP_V1 = 0
|
@@ -41,17 +41,17 @@ module BER #:nodoc:all
|
|
41
41
|
GetBulkRequest_PDU_TAG = 0xa5
|
42
42
|
InformRequest_PDU_TAG = 0xa6
|
43
43
|
SNMPv2_Trap_PDU_TAG = 0xa7
|
44
|
-
Report_PDU_TAG = 0xa8 # Note: Usage not defined - not supported
|
44
|
+
Report_PDU_TAG = 0xa8 # Note: Usage not defined - not supported
|
45
45
|
|
46
46
|
# Primitive ASN.1 data types
|
47
47
|
INTEGER_TAG = 0x02
|
48
48
|
OCTET_STRING_TAG = 0x04
|
49
49
|
NULL_TAG = 0x05
|
50
50
|
OBJECT_IDENTIFIER_TAG = 0x06
|
51
|
-
|
51
|
+
|
52
52
|
# Constructed ASN.1 data type
|
53
53
|
SEQUENCE_TAG = 0x30
|
54
|
-
|
54
|
+
|
55
55
|
# SNMP application data types
|
56
56
|
# See RFC 1155 for SNMPv1
|
57
57
|
# See RFC 1902 for SNMPv2c
|
@@ -62,23 +62,23 @@ module BER #:nodoc:all
|
|
62
62
|
TimeTicks_TAG = 0x43
|
63
63
|
Opaque_TAG = 0x44
|
64
64
|
Counter64_TAG = 0x46
|
65
|
-
|
65
|
+
|
66
66
|
# VarBind response exceptions
|
67
67
|
NoSuchObject_TAG = 0x80
|
68
68
|
NoSuchInstance_TAG = 0x81
|
69
69
|
EndOfMibView_TAG = 0x82
|
70
|
-
|
70
|
+
|
71
71
|
# Exceptions thrown in this module
|
72
|
-
class OutOfData < RuntimeError; end
|
72
|
+
class OutOfData < RuntimeError; end
|
73
73
|
class InvalidLength < RuntimeError; end
|
74
74
|
class InvalidTag < RuntimeError; end
|
75
75
|
class InvalidObjectId < RuntimeError; end
|
76
76
|
class InvalidLength < RuntimeError; end
|
77
77
|
|
78
78
|
def assert_no_remainder(remainder)
|
79
|
-
|
79
|
+
raise ParseError, remainder.inspect if remainder != ""
|
80
80
|
end
|
81
|
-
|
81
|
+
|
82
82
|
#
|
83
83
|
# Decode tag-length-value data. The data is assumed to be a string of
|
84
84
|
# bytes in network byte order. This format is returned by Socket#recv.
|
@@ -95,23 +95,23 @@ module BER #:nodoc:all
|
|
95
95
|
# multi-byte).
|
96
96
|
#
|
97
97
|
def decode_tlv(data)
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
98
|
+
raise OutOfData if (data.length == 2 && data[1].ord != 0) || data.length < 2
|
99
|
+
tag = data[0].ord
|
100
|
+
length = data[1].ord
|
101
|
+
if length < 0x80
|
102
|
+
value = data[2, length]
|
103
|
+
remainder = data[length+2..-1]
|
104
|
+
else
|
105
|
+
# ASN.1 says this octet can't be 0xff
|
106
|
+
raise InvalidLength, length.to_s if length == 0xff
|
107
|
+
num_octets = length & 0x7f
|
108
|
+
length = build_integer(data, 2, num_octets)
|
109
|
+
value = data[num_octets+2, length]
|
110
|
+
remainder = data[num_octets+2+length..-1]
|
111
|
+
end
|
112
|
+
return tag, value, remainder
|
113
113
|
end
|
114
|
-
|
114
|
+
|
115
115
|
#
|
116
116
|
# Decode TLV data for an ASN.1 integer.
|
117
117
|
#
|
@@ -120,38 +120,38 @@ module BER #:nodoc:all
|
|
120
120
|
# Returns a tuple containing an integer and any remaining unprocessed data.
|
121
121
|
#
|
122
122
|
def decode_integer(data)
|
123
|
-
|
124
|
-
|
125
|
-
|
123
|
+
tag, value, remainder = decode_tlv(data)
|
124
|
+
raise InvalidTag, tag.to_s if tag != INTEGER_TAG
|
125
|
+
return decode_integer_value(value), remainder
|
126
126
|
end
|
127
127
|
|
128
128
|
def decode_timeticks(data)
|
129
|
-
|
130
|
-
|
131
|
-
|
129
|
+
tag, value, remainder = decode_tlv(data)
|
130
|
+
raise InvalidTag, tag.to_s if tag != TimeTicks_TAG
|
131
|
+
return decode_uinteger_value(value), remainder
|
132
132
|
end
|
133
|
-
|
133
|
+
|
134
134
|
def decode_integer_value(value)
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
135
|
+
result = build_integer(value, 0, value.length)
|
136
|
+
if value[0].ord[7] == 1
|
137
|
+
result -= (1 << (8 * value.length))
|
138
|
+
end
|
139
|
+
result
|
140
140
|
end
|
141
|
-
|
141
|
+
|
142
142
|
##
|
143
143
|
# Decode an integer, ignoring the sign bit. Some agents insist on
|
144
144
|
# encoding 32 bit unsigned integers with four bytes even though it
|
145
145
|
# should be 5 bytes (at least the way I read it).
|
146
146
|
#
|
147
147
|
def decode_uinteger_value(value)
|
148
|
-
|
148
|
+
build_integer(value, 0, value.length)
|
149
149
|
end
|
150
|
-
|
150
|
+
|
151
151
|
def build_integer(data, start, num_octets)
|
152
|
-
|
153
|
-
|
154
|
-
|
152
|
+
number = 0
|
153
|
+
num_octets.times { |i| number = number<<8 | data[start+i].ord }
|
154
|
+
return number
|
155
155
|
end
|
156
156
|
|
157
157
|
#
|
@@ -160,34 +160,34 @@ module BER #:nodoc:all
|
|
160
160
|
# Throws an InvalidTag exception if the tag is incorrect.
|
161
161
|
#
|
162
162
|
# Returns a tuple containing a string and any remaining unprocessed data.
|
163
|
-
#
|
163
|
+
#
|
164
164
|
def decode_octet_string(data)
|
165
|
-
|
166
|
-
|
167
|
-
|
165
|
+
tag, value, remainder = decode_tlv(data)
|
166
|
+
raise InvalidTag, tag.to_s if tag != OCTET_STRING_TAG
|
167
|
+
return value, remainder
|
168
168
|
end
|
169
|
-
|
169
|
+
|
170
170
|
def decode_ip_address(data)
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
171
|
+
tag, value, remainder = decode_tlv(data)
|
172
|
+
raise InvalidTag, tag.to_s if tag != IpAddress_TAG
|
173
|
+
raise InvalidLength, tag.to_s if value.length != 4
|
174
|
+
return value, remainder
|
175
175
|
end
|
176
|
-
|
176
|
+
|
177
177
|
#
|
178
178
|
# Decode TLV data for an ASN.1 sequence.
|
179
179
|
#
|
180
180
|
# Throws an InvalidTag exception if the tag is incorrect.
|
181
181
|
#
|
182
|
-
# Returns a tuple containing the sequence data and any remaining
|
182
|
+
# Returns a tuple containing the sequence data and any remaining
|
183
183
|
# unprocessed data that follows the sequence.
|
184
184
|
#
|
185
185
|
def decode_sequence(data)
|
186
|
-
|
187
|
-
|
188
|
-
|
186
|
+
tag, value, remainder = decode_tlv(data)
|
187
|
+
raise InvalidTag, tag.to_s if tag != SEQUENCE_TAG
|
188
|
+
return value, remainder
|
189
189
|
end
|
190
|
-
|
190
|
+
|
191
191
|
#
|
192
192
|
# Unwrap TLV data for an ASN.1 object identifier. This method extracts
|
193
193
|
# the OID value as a character string but does not decode it further.
|
@@ -199,155 +199,154 @@ module BER #:nodoc:all
|
|
199
199
|
# of integers.
|
200
200
|
#
|
201
201
|
def decode_object_id(data)
|
202
|
-
|
203
|
-
|
204
|
-
|
202
|
+
tag, value, remainder = decode_tlv(data)
|
203
|
+
raise InvalidTag, tag.to_s if tag != OBJECT_IDENTIFIER_TAG
|
204
|
+
return decode_object_id_value(value), remainder
|
205
205
|
end
|
206
|
-
|
206
|
+
|
207
207
|
def decode_object_id_value(value)
|
208
|
-
|
209
|
-
|
208
|
+
if value.length == 0
|
209
|
+
object_id = []
|
210
|
+
else
|
211
|
+
value0 = value[0].ord
|
212
|
+
if value0 == 0x2b
|
213
|
+
object_id = [1,3]
|
210
214
|
else
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
215
|
+
second = value0 % 40
|
216
|
+
first = (value0 - second) / 40
|
217
|
+
raise InvalidObjectId, value.to_s if first > 2
|
218
|
+
object_id = [first, second]
|
219
|
+
end
|
220
|
+
n = 0
|
221
|
+
for i in 1...value.length
|
222
|
+
n = (n<<7) + (value[i].ord & 0x7f)
|
223
|
+
if value[i].ord < 0x80
|
224
|
+
object_id << n
|
220
225
|
n = 0
|
221
|
-
|
222
|
-
n = (n<<7) + (value[i].ord & 0x7f)
|
223
|
-
if value[i].ord < 0x80
|
224
|
-
object_id << n
|
225
|
-
n = 0
|
226
|
-
end
|
227
|
-
end
|
226
|
+
end
|
228
227
|
end
|
229
|
-
|
228
|
+
end
|
229
|
+
return object_id
|
230
230
|
end
|
231
|
-
|
231
|
+
|
232
232
|
#
|
233
233
|
# Encode the length field for TLV data. Returns the length octets
|
234
234
|
# as a string.
|
235
235
|
#
|
236
236
|
def encode_length(length)
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
237
|
+
raise InvalidLength, length.to_s if length < 0
|
238
|
+
if length < 0x80
|
239
|
+
length.chr
|
240
|
+
else
|
241
|
+
data = integer_to_octets(length)
|
242
|
+
(data.size | 0x80).chr << data
|
243
|
+
end
|
244
244
|
end
|
245
245
|
|
246
246
|
#
|
247
247
|
# Encode integer
|
248
248
|
#
|
249
249
|
def encode_integer(value)
|
250
|
-
|
250
|
+
encode_tagged_integer(INTEGER_TAG, value)
|
251
251
|
end
|
252
|
-
|
252
|
+
|
253
253
|
def encode_tagged_integer(tag, value)
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
end
|
254
|
+
if value > 0 && value < 0x80
|
255
|
+
data = value.chr
|
256
|
+
else
|
257
|
+
data = integer_to_octets(value)
|
258
|
+
if value > 0 && data[0].ord > 0x7f
|
259
|
+
data = "\000" << data
|
260
|
+
elsif value < 0 && data[0].ord < 0x80
|
261
|
+
data = "\377" << data
|
263
262
|
end
|
264
|
-
|
263
|
+
end
|
264
|
+
encode_tlv(tag, data)
|
265
265
|
end
|
266
|
-
|
266
|
+
|
267
267
|
#
|
268
268
|
# Helper method for encoding integer-like things.
|
269
269
|
#
|
270
270
|
def integer_to_octets(i)
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
271
|
+
if i >= 0
|
272
|
+
done = 0
|
273
|
+
else
|
274
|
+
done = -1
|
275
|
+
end
|
276
|
+
octets = ""
|
277
|
+
begin
|
278
|
+
octets = (i & 0xff).chr << octets
|
279
|
+
i = i >> 8
|
280
|
+
end until i == done
|
281
|
+
octets
|
282
282
|
end
|
283
|
-
|
283
|
+
|
284
284
|
def encode_null
|
285
|
-
|
285
|
+
NULL_TAG.chr << "\000"
|
286
286
|
end
|
287
|
-
|
287
|
+
|
288
288
|
#
|
289
289
|
# Encode an exception. The encoding is simply the exception tag with
|
290
290
|
# no data, similar to NULL.
|
291
291
|
#
|
292
292
|
def encode_exception(tag)
|
293
|
-
|
293
|
+
tag.chr << "\000"
|
294
294
|
end
|
295
|
-
|
295
|
+
|
296
296
|
#
|
297
297
|
# Wraps value in a tag and length. This method expects an
|
298
298
|
# integer tag and a string value.
|
299
299
|
#
|
300
300
|
def encode_tlv(tag, value)
|
301
|
-
|
302
|
-
|
303
|
-
|
301
|
+
data = tag.chr << encode_length(value.length)
|
302
|
+
data = data << value if value.length > 0
|
303
|
+
data
|
304
304
|
end
|
305
|
-
|
305
|
+
|
306
306
|
#
|
307
307
|
# Wrap string in a octet string tag and length.
|
308
308
|
#
|
309
309
|
def encode_octet_string(value)
|
310
|
-
|
310
|
+
encode_tlv(OCTET_STRING_TAG, value)
|
311
311
|
end
|
312
|
-
|
312
|
+
|
313
313
|
#
|
314
314
|
# Wrap value in a sequence tag and length.
|
315
315
|
#
|
316
316
|
def encode_sequence(value)
|
317
|
-
|
317
|
+
encode_tlv(SEQUENCE_TAG, value)
|
318
318
|
end
|
319
|
-
|
319
|
+
|
320
320
|
#
|
321
321
|
# Encode an object id. The input is assumed to be an array of integers
|
322
322
|
# representing the object id.
|
323
323
|
#
|
324
324
|
def encode_object_id(value)
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
end
|
345
|
-
elsif (value.length == 1)
|
346
|
-
data << (40 * value[0]).chr
|
325
|
+
raise InvalidObjectId, value.to_s if value.length < 1
|
326
|
+
raise InvalidObjectId, value.to_s if value[0] > 2
|
327
|
+
data = ""
|
328
|
+
if (value.length > 1)
|
329
|
+
raise InvalidObjectId if value[0] < 2 && value[1] > 40
|
330
|
+
data << (40 * value[0] + value[1]).chr
|
331
|
+
for i in 2...value.length
|
332
|
+
if value[i] < 0x80
|
333
|
+
data << value[i].chr
|
334
|
+
else
|
335
|
+
octets = ""
|
336
|
+
n = value[i]
|
337
|
+
begin
|
338
|
+
octets = (n & 0x7f | 0x80).chr << octets
|
339
|
+
n = n >> 7
|
340
|
+
end until n == 0
|
341
|
+
octets[-1] = (octets[-1].ord & 0x7f).chr
|
342
|
+
data << octets
|
343
|
+
end
|
347
344
|
end
|
348
|
-
|
345
|
+
elsif (value.length == 1)
|
346
|
+
data << (40 * value[0]).chr
|
347
|
+
end
|
348
|
+
encode_tlv(OBJECT_IDENTIFIER_TAG, data)
|
349
349
|
end
|
350
|
-
|
351
|
-
end
|
352
|
-
end
|
353
350
|
|
351
|
+
end
|
352
|
+
end
|