Академический Документы
Профессиональный Документы
Культура Документы
com
Eric Anderson
BMC Software Developer Connection
SNMP - Overview
Network
protocols
Transport
layer (UDP/IP)
Message protocol (ASN.1)
Versions
SNMPv1
SNMPv2
SNMPv3
OSI
CMIP
- CMOT
unsecure
No authentication on transport layer
No verification of origin (message spoofing)
No integrity (message can be tampered with)
Encoding Rules
TLV (Type, Length, Value) encoding
Management Operations
Get,
for
Get
listens
Lookup
of OID in memory
Agent sends get response
request
ID
OID
error
status + index
value
Similar
returns
Trap sending
SNMP Agent determines when
7 predefined Generic trap types (0-6)
6=enterpriseSpecfic
Send
: /snmp/piV1m_list
MIB file
textual
SMI
Support
NAMING in MIB
1 iso
Naming hierarchy
unique identifier, down to the 3 org
instance of any object
6 dod
1.3.6.1.4.1.1031 is the OID of
1 internet
the BMC Software subtree
2
4 private
mgmt
1 enterprises
enterpriseID
442
peer 1031 Company X
BMC
Whatever you like
10
11
12
(SNMP Multiplexer)
AgentX - Agent Extensibility (rfc 2741)
Emanate (proprietary SNMP Research)
Sub agent
Master
Agent
Sub agent
161
Sub agent
13
SNMPv3
New
14
SNMP References
SNMP v1 RFCs
1155
SMI
1157
protocol
1212
Concise MIB
1213
MIB2
1215
traps
SNMP v2 RFCs
historical
See also : The Simple Web
http://snmp.cs.utwente.nl/
15
www.bmc.com
16
Management Station
Port 161
Port 8161
Applications
Applications
Uses Windows
SNMP API
Applications
Uses Windows
SNMP API
Applications
Uses Windows
SNMP API
Uses Windows SNMP API
17
Snmpget()
SMUX
Port 191
PATROL Agent
With
SNMP Sub Agent
Access
Method
SNMP
Runtime
Application
Encapsulator
process
Management Station
Port 161
Port 8161
Snmpget()
Applications
Applications
Uses Windows
SNMP API
Applications
Uses Windows
SNMP API
Applications
Uses Windows
SNMP API
Dynamically loaded into
Agent space
18
PATROL Agent
With
SNMP Sub Agent
Access
Method
SNMP
Runtime
Application
Encapsulator
process
19
traps
Getting information from other SNMP agents
No Master Agent is needed for this !
20
21
"/snmp/support" = { REPLACE="yes" },
"/snmp/agent_auto_start" = { REPLACE="yes" },
"/snmp/default_port"
= { REPLACE="161" },
"/snmp/master_agent_port" = { REPLACE="1161" },
"/snmp/trap_port" = { REPLACE="162" },
"/snmp/sysName" = { REPLACE = "unknown" },
"/snmp/sysContact" = { REPLACE = "http://www.bmc.com" },
"/snmp/sysLocation" = { REPLACE = "BMC Software Inc." },
"/snmp/piV1m_list" = { REPLACE="" },
22
file ./lib/snmpmagt.cfg
UNIX
No
23
24
MANAGER
manager
[SEND [ALL | NO ] TRAPS
[TO PORT <#>]
[WITH COMMUNITY <name>]]
COMMUNITY
<name>
ALLOW op [,op]* [OPERATIONS]
[USE encrypt ENCRYPTION]
[MEMBERS
<manager> [,<manager>]* ]
manager ::=
<hostname> | ipaddr
where: hostname is defined in /etc/hosts
ipaddr ::=
op ::=
encrypt ::=
<a.b.c.d>
ALL | GET | SET | TRAP
NO
COMMUNITY public
ALLOW ALL OPERATIONS
USE NO ENCRYPTION
TRANSPORT ordinary SNMP
OVER UDP SOCKET
AT PORT 1161
to send traps
Has an accessible MIB
To access MIB, the master agent must be set up
correctly
25
Sending traps
Automatically
From
event catalogs
Trap destinations : piV1m_List ( + /snmp/trapMibTable=yes)
Filter possibility (see config.default for filter options)
From
PSL
snmp_trap_send
: full control
snmp_trap_raise_std_trap : uses piV1m_List
26
www.bmc.com
27
28
Column Index
Row Index
29
OID
1.3.6.1.4.1.1031.1.1.1.6.1.1.0
1.3.6.1.4.1.1031.1.1.1.6.1.1.1
1.3.6.1.4.1.1031.1.1.1.6.1.1.2
1.3.6.1.4.1.1031.1.1.1.6.1.1.3
1.3.6.1.4.1.1031.1.1.1.6.1.1.4
1.3.6.1.4.1.1031.1.1.1.6.1.1.5
1.3.6.1.4.1.1031.1.1.1.6.1.1.6
1.3.6.1.4.1.1031.1.1.1.6.1.1.7
1.3.6.1.4.1.1031.1.1.1.6.1.1.8
1.3.6.1.4.1.1031.1.1.1.6.1.1.9
1.3.6.1.4.1.1031.1.1.1.6.1.1.10
1.3.6.1.4.1.1031.1.1.1.6.1.1.11
1.3.6.1.4.1.1031.1.1.1.6.1.1.12
1.3.6.1.4.1.1031.1.1.1.6.1.1.13
1.3.6.1.4.1.1031.1.1.1.6.1.1.14
1.3.6.1.4.1.1031.1.1.1.6.1.1.15
1.3.6.1.4.1.1031.1.1.1.6.1.1.16
1.3.6.1.4.1.1031.1.1.1.6.1.1.17
1.3.6.1.4.1.1031.1.1.1.6.1.1.18
StrLen
2
11
9
10
3
4
10
6
6
7
3
6
7
7
8
3
4
5
3
Type
string
string
string
string
string
string
string
string
string
string
string
string
string
string
string
string
string
string
string
applicationName
HP
PATROLAGENT
SNMP_Test
COLLECTORS
CPU
DISK
FILESYSTEM
KERNEL
MEMORY
NETWORK
NFS
PATROL
PRINTER
PROCESS
SECURITY
SMP
SWAP
USERS
LOG
Objects Table
bmc (1031)
patrolMIB (1)
patrolAgent (1)
patrolObjects (1)
objectsMask (1) r/w
patrolTraps (2)
agentExecuteCommand (3)
patrolConsole (2)
objectsEntry (1) na
variablesTable (5)
objectName (1) r
applicationsTable (6)
objectDescr (3) r
applInstTable (7)
objectRowStatus (4) r/w
parametersTable (8)
30
for
Go
example /
get
Read
get
Problem
31
variable agentExecuteCommand
Agent will execute immediately
Fail/Success from return value of snmp_set()
32
Variables Table
bmc (1031)
patrolMIB (1)
patrolAgent (1)
patrolObjects (1)
objectsMask (1)
objectsCwd (2)
objectsTable (3)
variablesTable(5) na
patrolTraps (2)
VariablesEntry (1) na
variableName (2) r
agentExecuteCommand(3)
patrolConsole (2)
variableType (3) r
variableValue (4) r/w
variableDesr (5) r/w
33
on OID of :
.variablesTable.variableEntry.variableValue
Need conversion of namespace variable
<length>
Simply
get : bmc.1.1.1.5.1.4.<len>.<conv>
Result :
Fastest
Namespace access
not useful for namespace discovery
Not walk-able
34
Applications Table
bmc (1031)
patrolMIB (1)
patrolAgent (1)
patrolObjects (1)
variablesTable(5)
applicationsTable(6) na
applicationsEntry(1) na
applicationName(1) r
patrolTraps (2)
applicationState (2) r
applWorstInst (3) r
agentExecuteCommand(3)
applMasterVersion(4) r
applMinorRevision (5) r
patrolConsole (2)
applicationRowStatus (6) r
applicationOid (7) na
35
36
Applications Example
applicationsTable
applicationsEntry (index)
applicationName
OS>%PSL print(snmp_walk("sess47", "1.3.6.1.4.1.1031.1.1.1.6.1.1")."\n");
20000207121727 1.3.6.1.4.1.1031.1.1.1.6.1.1.
20000207121727 1.3.6.1.4.1.1031.1.1.1.6.1.1.1
20000207121727 1.3.6.1.4.1.1031.1.1.1.6.1.1.2
2
11
9
string
string
string
HP
PATROLAGENT
SNMP_Test
20000207121727 1.3.6.1.4.1.1031.1.1.1.6.1.1.3
20000207121727 1.3.6.1.4.1.1031.1.1.1.6.1.1.4
20000207121727 1.3.6.1.4.1.1031.1.1.1.6.1.1.5
10
string
string
string
COLLECTORS
CPU
DISK
20000207121727
20000207121727
20000207121727
20000207121727
20000207121727
20000207121727
1.3.6.1.4.1.1031.1.1.1.6.1.1.6
1.3.6.1.4.1.1031.1.1.1.6.1.1.7
1.3.6.1.4.1.1031.1.1.1.6.1.1.8
1.3.6.1.4.1.1031.1.1.1.6.1.1.9
1.3.6.1.4.1.1031.1.1.1.6.1.1.10
1.3.6.1.4.1.1031.1.1.1.6.1.1.11
10
6
6
7
3
6
string
FILESYSTEM
KERNEL
MEMORY
NETWORK
NFS
PATROL
20000207121727
20000207121727
20000207121727
20000207121727
20000207121727
20000207121727
20000207121727
1.3.6.1.4.1.1031.1.1.1.6.1.1.12
1.3.6.1.4.1.1031.1.1.1.6.1.1.13
1.3.6.1.4.1.1031.1.1.1.6.1.1.14
1.3.6.1.4.1.1031.1.1.1.6.1.1.15
1.3.6.1.4.1.1031.1.1.1.6.1.1.16
1.3.6.1.4.1.1031.1.1.1.6.1.1.17
1.3.6.1.4.1.1031.1.1.1.6.1.1.18
7
7
8
3
4
5
3
string
string
string
string
string
string
string
PRINTER
3
4
Application ID
String Length
Type
Application Name
37
string
string
string
string
string
PROCESS
SECURITY
SMP
SWAP
USERS
LOG
Instances Table
patrolObjects (1)
variablesTable(5)
applicationsTable(6)
applInstTable(7) na
applInstEntry (1) na
applInstName (1) r
applInstRuleState (2) r
applInstStatus (3) r
applInstWorstParam (4) r
applInstCreateIcon (5) r
applInstRowStatus (6) r
applInstOid (7) na
applInstPApplOid (8) r
applInstPInstOid (9) r
38
Instances Example
20000207121727 1.3.6.1.4.1.1031.1.1.1.6.1.1.9
string
NETWORK
20000207121727 1.3.6.1.4.1.1031.1.1.1.6.1.1.10
string
NFS
20000207121727 1.3.6.1.4.1.1031.1.1.1.6.1.1.11
string
PATROL
20000207121727 1.3.6.1.4.1.1031.1.1.1.6.1.1.12
string
PRINTER
20000207121727 1.3.6.1.4.1.1031.1.1.1.6.1.1.13
string
PROCESS
20000207121727 1.3.6.1.4.1.1031.1.1.1.6.1.1.14
string
SECURITY
applInstTable
applInstEntry (index)
applInstName
OS>%PSL print(snmp_walk("sess47", "1.3.6.1.4.1.1031.1.1.1.7.1.1.12")."\n");
20000207121828 1.3.6.1.4.1.1031.1.1.1.7.1.1.12.
816
1.3.6.1.4.1.1031.1.1.1.7.1.1.12.836
string
lj4mv
20000207121828
220000207121828 1.3.6.1.4.1.1031.1.1.1.7.1.1.12.844
20000207121828 1.3.6.1.4.1.1031.1.1.1.7.1.1.12.860
3
8
14
string
string
string
lp
sweetlip
Nutria_HPLaser
Application ID
Application Instance ID
Application Name
39
Parameters Table
parametersTable(8) na
parametersEntry (1) na
parameterName (1) r
parameterAutoScale (8) r
parameterState (2) r
parameterYaxisMin (9) r
parameterCurrentTime (3) r
parameterYaxisMax (10) r
parameterCurrentValue (4) r
parameterPollingInt (5) r
parameterObjId (12) na
parameterRetries (6) r
parameterIntValue (13) r
parameterOutputMode (7) r
40
Parameters Example
20000207121727 1.3.6.1.4.1.1031.1.1.1.6.1.1.11
string
PATROL
20000207121727 1.3.6.1.4.1.1031.1.1.1.6.1.1.12
string
PRINTER
20000207121727 1.3.6.1.4.1.1031.1.1.1.6.1.1.13
string
PROCESS
lj4mv
lp
sweetlip
Nutria_HPLaser
parametersTable
parametersEntry (index)
parameterName
applicationName
applInstName
OS>%PSL print(snmp_walk("sess47", "1.3.6.1.4.1.1031.1.1.1.8.1.1.12.816")."\n");
12.816.818
20000207121938 1.3.6.1.4.1.1031.1.1.1.8.1.1.
Application ID
Application Instance ID
Parameter ID
10
string
parameterIntValue
41
PRNQLengthOS
Value
Trap Table
bmc (1031)
patrolMIB (1)
patrolAgent (1)
patrolObjects (1)
patrolTraps (2)
patrolTrapText (1) r
patrolTrapOrigin (2) r
patrolTrapExtra (3) r
piV1mTable (10) na
piV1mIp (10) na
piV1mPort (10) na
piV1mCommunity (10) na
piV1mRowStatus (10) r/w
agentExecuteCommand(3)
patrolConsole (2)
42
Enterprise Traps
Standard Traps
patrolTraps (2)
patrolTrapWarmStart (1)
patrolTrapText (1)
patrolTrapOrigin (2)
patrolTrapExtra (3)
piV1mTable (10)
piV1mIp (10)
piV1mPort (10)
piV1mCommunity (10)
piV1mRowStatus (10)
43
patrolTrapV1StateChanged (11)
OBJECTS{patrolTrapText}
A patrolTrapV1StateChanged is sent when Patrol Agent changes
state of one of the discovered application instances.
Trap Example
patrolAlarm (5)
========== SNMP Trap Received =============
From: 172.19.204.16 (1.3.6.1.4.1.1031.1.1.2) Enterprise Specific (5) Uptime: 0 day(s) 23:34:55 (8489554)
1.3.6.1.4.1.1031.1.1.2.1.0
84
string
Alarm #2 of global parameter 'NFSSNull' triggered on
'NFS.NFS'. 50 <= 100.00 <= 100
patrolTrapText
1.3.6.1.4.1.1031.1.1.2.2.0
17
string
/NFS/NFS/NFSSNull
1.3.6.1.4.1.1031.1.1.2.3.0
0
string
patrolTrapOrigin
========== End SNMP Trap Received =============
patrolTrapExtra
Source IP address
patrolChangeStatus (2)
========== SNMP Trap Received =============
From: 172.19.204.16 (1.3.6.1.4.1.1031.1.1.2) Enterprise Specific (2) Uptime: 0 day(s) 23:37:56 (8507631)
1.3.6.1.4.1.1031.1.1.2.1.0
99
string
Alert on 'NFS.NFS.NFSSNull' from global parameter
'NFSSNull' cancelled; exception no longer exists.
1.3.6.1.4.1.1031.1.1.2.2.0
17
string
/NFS/NFS/NFSSNull
1.3.6.1.4.1.1031.1.1.2.3.0
0
string
========== End SNMP Trap Received =============
patrolWarning (4)
========== SNMP Trap Received =============
From: 172.19.204.16 (1.3.6.1.4.1.1031.1.1.2) Enterprise Specific (4) Uptime: 0 day(s) 23:40:56 (8525616)
1.3.6.1.4.1.1031.1.1.2.1.0
85
string
Alarm #1 of global parameter 'NFSSReadDir' triggered on
'NFS.NFS'. 18 <= 19.19 <= 30
1.3.6.1.4.1.1031.1.1.2.2.0
20
string
/NFS/NFS/NFSSReadDir
1.3.6.1.4.1.1031.1.1.2.3.0
0
string
========== End SNMP Trap Received =============
44
www.bmc.com
45
SNMP support
snmp_agent_stop()
stops
SNMP support
snmp_agent_config()
tells
46
Plus
snmp_walk
47
String
OID
gauge,
OID
integer, oid,
OID
48
ipAddress
Receiving traps
PSL functions
snmp_trap_ignore
Functionality
49
No
50