forked from gosnmp/gosnmp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
snmp-notes.txt
71 lines (59 loc) · 1.86 KB
/
snmp-notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
install:
$ sudo apt-get install snmp-mibs-downloader snmp snmpd
$ sudo download-mibs
#
# USAGE: snmptranslate [OPTIONS] OID [OID]... for example
# from /usr/share/mibs/ietf/SNMPv2-MIB
# http://net-snmp.sourceforge.net/wiki/index.php/TUT:snmptranslate
#
$ snmptranslate -Tp -IR system # for SNMPv2-MIB
# https://l3net.wordpress.com/2013/05/12/installing-net-snmp-mibs-on-ubuntu-and-debian/
# for gui MIB browser
#
# http://stackoverflow.com/questions/19947680/what-is-the-correct-snmptrap-command-format
$ sudo diff ~/snmpd.conf /etc/snmp/snmpd.conf
15c15
< agentAddress udp:127.0.0.1:161
---
> # agentAddress udp:127.0.0.1:161
17c17
< #agentAddress udp:161,udp6:[::1]:161
---
> agentAddress udp:161,udp6:[::1]:161
51c51
< rocommunity public default -V systemonly
---
> rocommunity public 10.0.0.0/16
126c126
< trapsink localhost public
---
> #trapsink localhost public
128c128
< #trap2sink localhost public
---
> trap2sink localhost public
/etc/snmp/snmp.conf:
mibs +ALL
$ sudo /etc/init.d/snmpd restart
snmptrap:
The TYPE is a single character, one of:
i INTEGER INTEGER
u UNSIGNED
c COUNTER32
s STRING DisplayString
x HEX STRING
d DECIMAL STRING
n NULLOBJ
o OBJID OBJECT IDENTIFIER
t TIMETICKS
a IPADDRESS
b BITS
/usr/share/mibs/ietf/SNMPv2-MIB
line:77 sysDescr
line: 146 sysServices
line: 88 sysObjectID
snmptrap -v 2c -c public 192.168.1.10 '' SNMPv2-MIB::system SNMPv2-MIB::sysDescr.0 s "red laptop" SNMPv2-MIB::sysServices.0 i "5" SNMPv2-MIB::sysObjectID o "1.3.6.1.4.1.2.3.4.5"
# also https://l3net.wordpress.com/2013/05/12/installing-net-snmp-mibs-on-ubuntu-and-debian/
# for gui MIB browser
# also https://l3net.wordpress.com/2013/05/12/installing-net-snmp-mibs-on-ubuntu-and-debian/
# for gui MIB browser