Вы находитесь на странице: 1из 50

www.bmc.

com

Integrating PATROL with


SNMP
(Simple Network Management Protocol)

Eric Anderson
BMC Software Developer Connection

1999 BMC SOFTWARE, INC.


3/17/99

SNMP - Overview
Network

protocols

Transport

layer (UDP/IP)
Message protocol (ASN.1)

Versions
SNMPv1
SNMPv2
SNMPv3

OSI

network management implementation

CMIP

- CMOT

1999 BMC SOFTWARE, INC. 3/17/99

SNMP : Underlying Transport


UDP/IP implications (unsafe)
unreliable
no confirmation or guarantee
order uncertain
may duplicate

unsecure
No authentication on transport layer
No verification of origin (message spoofing)
No integrity (message can be tampered with)

1999 BMC SOFTWARE, INC. 3/17/99

SNMP message protocol


ASN.1 (iso 8824 - abstract notation one)
Does

information exchange with well defined syntax


comparable in functionality with XML

BER (iso 8825)


Basic

Encoding Rules
TLV (Type, Length, Value) encoding

1999 BMC SOFTWARE, INC. 3/17/99

Management Operations
Get,
for

Get Next, Set


SNMPv1

Get

Bulk (for SNMPv2)


Unsolicited Traps from Agent (v1)
Informs (v3 and v3)

1999 BMC SOFTWARE, INC. 3/17/99

Get Request handling


Agent

gets request from mgr

listens

on specific port : typically 161


receives PDU : request ID + OID

Lookup

of OID in memory
Agent sends get response
request

ID

OID
error

status + index

value

Similar

for get-next operation

returns

next OID in tree

1999 BMC SOFTWARE, INC. 3/17/99

Trap sending
SNMP Agent determines when
7 predefined Generic trap types (0-6)
6=enterpriseSpecfic

Send

via to port 162 on trap receiving machine


Trap destinations has to be configured
Patrol

: /snmp/piV1m_list

1999 BMC SOFTWARE, INC. 3/17/99

Listening for traps


Only one process can listen on a port
That means only one trap listener per system !
Solution :
PATROL : trap demultiplexer (Dietmar Hildebrand)
No PATROL : (DIY= write your own)

1999 BMC SOFTWARE, INC. 3/17/99

MIB (Management Information Base)


The

MIB file

textual

description of MIB layout


Written in SMI : Structure of Managment Information

SMI

(the MIB definition language)

Support

for multiple datatypes


Support for data definitions : indexed tables, structures,
values,...

1999 BMC SOFTWARE, INC. 3/17/99

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

1999 BMC SOFTWARE, INC. 3/17/99

The SNMP Manager


What is an SNMP manager ?
Components :
present

MIB info (display MIB files)


send requests
listen for traps

11

1999 BMC SOFTWARE, INC. 3/17/99

The SNMP Agent


What is an SNMP agent ?
Components :
MIB

(the MIB in memory)


request handling
trap sending

12

1999 BMC SOFTWARE, INC. 3/17/99

Multiple SNMP Agents on 1 system


Conflict : only 1 process can listen on a port
Solutions :
SMUX

(SNMP Multiplexer)
AgentX - Agent Extensibility (rfc 2741)
Emanate (proprietary SNMP Research)

Sub agent
Master
Agent

Sub agent

161
Sub agent
13

1999 BMC SOFTWARE, INC. 3/17/99

SNMPv3
New

standardization effort for v2 with enhanced


Security
User

14

Based security model (rfc 2574)

1999 BMC SOFTWARE, INC. 3/17/99

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

1999 BMC SOFTWARE, INC. 3/17/99

SNMP v2C RFCs


1902-1907
SNMP v3 RFCs
1905-1907
2571-2575
2578-2580
http://www.ietf.org

www.bmc.com

PATROL & SNMP

16

1999 BMC SOFTWARE, INC.


3/17/99

PATROL SNMP Windows NT


PATROL Console

Management Station

Port 161

SNMP Agent (Master)


Windows Service

Port 8161

Applications
Applications
Uses Windows
SNMP API
Applications
Uses Windows
SNMP API
Applications
Uses Windows
SNMP API
Uses Windows SNMP API

17

PATROL SNMP Master Agent

Snmpget()

1999 BMC SOFTWARE, INC. 3/17/99

SMUX
Port 191

PATROL Agent
With
SNMP Sub Agent

Access
Method

SNMP
Runtime

Application

Encapsulator
process

PATROL SNMP UNIX


PATROL Console

Management Station

Port 161

SNMP Agent (Master)

Port 8161
Snmpget()

PATROL SNMP Master Agent


SMUX
Port 191

Applications
Applications
Uses Windows
SNMP API
Applications
Uses Windows
SNMP API
Applications
Uses Windows
SNMP API
Dynamically loaded into
Agent space

18

1999 BMC SOFTWARE, INC. 3/17/99

PATROL Agent
With
SNMP Sub Agent

Access
Method

SNMP
Runtime

Application

Encapsulator
process

Master agent confusion


Only needed when accessing PATROL MIB
data !!
Not needed for :
receiving traps
sending traps
get/set/walk/... operations

19

1999 BMC SOFTWARE, INC. 3/17/99

PATROL Agent as SNMP Manager


Receiving

traps
Getting information from other SNMP agents
No Master Agent is needed for this !

20

1999 BMC SOFTWARE, INC. 3/17/99

Configuring PATROL for SNMP


Set the port number and community name for the PATROL SNMP
Master Agent
ThePATROLSNMPMasterAgent/SubAgentmodelisbasedonan
industrystandardknownasSMUXthatallowsoneormoreSNMPSub
AgentstoconnecttoasingleSNMPMasterAgentusingaTCPSMUX
port(TCPport199bydefault).
Turn on the SNMP support variable.
agent configuration variable /snmp/agent_auto_start is set to yes,
the PATROL Agent starts the SNMP Sub-Agent when the PATROL
Agent is started
Add the SNMP manager to the list of interested SNMPV1 managers.
TheSNMPmanagementconsoleneedstoknowhowtorecognize
PATROLtraps,andwhattodoaboutthem.Onsomeconsolesitinvolves
configurationofinternalrulesandtables.Inothersitmayinvolve
configuringthe"trapd.conf"configurationfile.
Configure events to send SNMP traps.

21

1999 BMC SOFTWARE, INC. 3/17/99

SNMP support variable(s)


TheSNMPStartparameterisdefinedwithineach<platform>.km.Theoutofboxdefaultsettingforthisparameteris
theactivestate.Ifactive,SNMPStartlaunchesthePATROLSNMPMasterAgent(snmpmagt)ifitisnotstarted
already.SNMPStartthenstartstheSNMPSubAgent.
TheconfigurationofthePATROLSNMPSubAgentiscontrolledbythevaluescontainedinthePATROL
configurationfile.
OnUNIX,itis$PATROL_HOME/lib/config.default
OnWindowsNT,itis%PATROL_HOME%\lib\config.default
Theimportantvariablesare:

"/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

1999 BMC SOFTWARE, INC. 3/17/99

Master agent configuration


See

file ./lib/snmpmagt.cfg

UNIX

: default port 1161, community public


NT : default port 1161, community public

No

need for BMC master agent if SMUX master


agent available (eg. AIX)
What about HP ?
They

use emanate master agent = proprietary


Run 2 master agents, one on 161 (default) and one on 1161
(Patrol)

23

1999 BMC SOFTWARE, INC. 3/17/99

PATROL SNMP Master Agent


TheconfigurationofthePATROLSNMPMasterAgentiscontrolledbythevaluescontainedinthe
PATROLSNMPMasterAgentconfigurationfile.
OnUNIX,itis$PATROL_HOME/lib/snmpmagt.cfg.
OnWindowsNT,itis%PATROL_HOME%\lib\snmpmagt.cfg.
# GRAMMAR:
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#

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

1999 BMC SOFTWARE, INC. 3/17/99

COMMUNITY public
ALLOW ALL OPERATIONS
USE NO ENCRYPTION
TRANSPORT ordinary SNMP
OVER UDP SOCKET
AT PORT 1161

PATROL Agent as SNMP sub agent


Ability

to send traps
Has an accessible MIB
To access MIB, the master agent must be set up
correctly

25

1999 BMC SOFTWARE, INC. 3/17/99

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

1999 BMC SOFTWARE, INC. 3/17/99

www.bmc.com

The PATROL MIB

27

1999 BMC SOFTWARE, INC.


3/17/99

MIB Object Groups


iso (1)
org (3)
dod (6)
internet (1)
mgmt (2)
Mib-2 (1)
system (1)
private (4)
enterprises (1)
bmc (1031)

28

1999 BMC SOFTWARE, INC. 3/17/99

MIB Tables Indexing a Table


OS>%PSL print(snmp_walk("sess47", "1.3.6.1.4.1.1031.1.1.1.6.1.1")."\n");
Table

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

1999 BMC SOFTWARE, INC. 3/17/99

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)

objectsCwd (2) r/w


objectsTable (3) na

patrolConsole (2)

objectsEntry (1) na
variablesTable (5)
objectName (1) r
applicationsTable (6)
objectDescr (3) r
applInstTable (7)
objectRowStatus (4) r/w
parametersTable (8)

30

1999 BMC SOFTWARE, INC. 3/17/99

Browsing PATROL namespace - 1


Set

objectCwd to the tree you want to inspect

for

Go

example /

to the desired node

get

the objectsTable, you see NT_CPU


set objectCwd to /CPU pick inst from objectsTable
set objectCwd to /CPU/CPU pick param from objectsTable
set objectCwd to /CPU/CPU/CPUCpuUtil

Read
get

the wanted values

the variablesTable to find all the attributes

Problem

: No way to enforce a session, your set of


objectCwd might have been overwritten !

31

1999 BMC SOFTWARE, INC. 3/17/99

Execute PSL through SNMP


Set

variable agentExecuteCommand
Agent will execute immediately
Fail/Success from return value of snmp_set()

32

1999 BMC SOFTWARE, INC. 3/17/99

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

1999 BMC SOFTWARE, INC. 3/17/99

variableRowStatus (6) r/w

Direct namespace access Variables Table


Hooked

on OID of :
.variablesTable.variableEntry.variableValue
Need conversion of namespace variable
<length>

= length of namespace variable


<conv> = ascii to value conversion of namespace variable
for example : /CPU = 47.67.80.85

Simply

get : bmc.1.1.1.5.1.4.<len>.<conv>
Result :
Fastest

Namespace access
not useful for namespace discovery
Not walk-able

34

1999 BMC SOFTWARE, INC. 3/17/99

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

1999 BMC SOFTWARE, INC. 3/17/99

Browsing PATROL namespace - 2


Look

for the application in applicationTable


Use that index to get the instances from the
application in applInstTable
Use both indexes to get the parameters from the
parametersTable
Get the required attribute from your parameter
This method is safe but requires some
processing

36

1999 BMC SOFTWARE, INC. 3/17/99

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

1999 BMC SOFTWARE, INC. 3/17/99

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

1999 BMC SOFTWARE, INC. 3/17/99

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

1999 BMC SOFTWARE, INC. 3/17/99

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

parameterRowStatus (11) r/w

parameterPollingInt (5) r

parameterObjId (12) na

parameterRetries (6) r

parameterIntValue (13) r

parameterOutputMode (7) r

parameterActiveStat (14) r/w


parameterRunningStat (15) r/w

40

1999 BMC SOFTWARE, INC. 3/17/99

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

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
5
string
20000207121828 1.3.6.1.4.1.1031.1.1.1.7.1.1.12.836
3
string
220000207121828 1.3.6.1.4.1.1031.1.1.1.7.1.1.12.844
8
string
20000207121828 1.3.6.1.4.1.1031.1.1.1.7.1.1.12.860
14
string

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

>%PSL print(snmp_walk("sess47", "1.3.6.1.4.1.1031.1.1.1.8.1.13.12.816")."\n");


20000207122103 1.3.6.1.4.1.1031.1.1.1.8.1.13.12.816.818
integer
0

41

1999 BMC SOFTWARE, INC. 3/17/99

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

1999 BMC SOFTWARE, INC. 3/17/99

Enterprise Traps
Standard Traps

patrolTraps (2)

patrolTrapWarmStart (1)

patrolTrapText (1)
patrolTrapOrigin (2)
patrolTrapExtra (3)
piV1mTable (10)
piV1mIp (10)
piV1mPort (10)
piV1mCommunity (10)
piV1mRowStatus (10)

Enterprise Traps (6) [1031.1.1.2]


patrolInformation (1)
VARIABLES {patrolTrapText, patrolTrapOrigin, patrolTrapExtra}
A patrolInformation trap is sent when a corresponding
event which may cause to that trap occurred.
patrolChangeStatus (2)
VARIABLES {patrolTrapText,patrolTrapOrigin,patrolTrapExtra}
A patrolChangeStatus is sent when a corresponding
event which may cause to that trap occurred.
patrolError (3)
VARIABLES {patrolTrapText,patrolTrapOrigin,patrolTrapExtra}
A patrolError is sent when a corresponding event
which may cause to that trap occurred.
patrolWarning (4)
VARIABLES {patrolTrapText,patrolTrapOrigin, patrolTrapExtra}
A patrolWarning is sent when a corresponding
event which may cause to that trap occurred.
patrolAlarm (5)
VARIABLES {patrolTrapText,patrolTrapOrigin, patrolTrapExtra}
A patrolAlarm is sent when a corresponding event
which may cause to that trap occurred.
patrolTrapV1Raised (10)
OBJECTS{patrolTrapText}
A patrolTrapV2Raised trap is sent when one of the PSL scripts
calls snmp_trap()function.

43

Traps are sent to SNMP V1


entity according to
piV1mTable.

1999 BMC SOFTWARE, INC. 3/17/99

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

Enterprise Traps (6) [1031.1.1.2]

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

1999 BMC SOFTWARE, INC. 3/17/99

www.bmc.com

PSL SNMP Functions

45

1999 BMC SOFTWARE, INC.


3/17/99

1st step : Starting SNMP subsystem


PATROL SNMP functionality can be stopped
snmp_agent_start()
starts

SNMP support

snmp_agent_stop()
stops

SNMP support

snmp_agent_config()
tells

46

if SNMP support is active

1999 BMC SOFTWARE, INC. 3/17/99

PSL functions for SNMP managers


All SNMPv1 functions
snmp_(h_)get
snmp_(h_)get_next
snmp_(h_)set

Plus
snmp_walk

(just loop around get_next)


No support for v2(c), v3 !!
security,

47

bulk get, new datatypes

1999 BMC SOFTWARE, INC. 3/17/99

Return format of snmp_functions


If type is
String and first character printable
OID

<tab> [strlen] <tab> string <tab> [actual string]

String
OID

<tab> [strlen] <tab> string <tab> [series of hex]

gauge,
OID

and first character non-printable


timeticks

<tab> [type] <tab> [value] <tab> ([hex-value])

integer, oid,
OID

48

ipAddress

<tab> [type] <tab> [value]

1999 BMC SOFTWARE, INC. 3/17/99

Receiving traps
PSL functions

snmp_trap_ignore

: close all listeners (close socket)


snmp_trap_listen : start listening for traps (open socket)
starts accumulating traps
snmp_trap_receive : process incoming traps (block/poll based)
only 1 per agent

Functionality

is based on a gentlemen's agreement


Only one receiver for multiple KMs
Need for a trap dispatcher in PATROL ?

49

1999 BMC SOFTWARE, INC. 3/17/99

Getting info from other SNMP Agents


What is an SNMP session in PATROL ?
snmp_open()

: opens an SNMP session


snmp_close() : closes an SNMP session
snmp_config() : lists the SNMP sessions

No

real session (like TCP session) because


SNMP = connectionless / stateless
just a memory structure, so ...
Easier

for the developer open session once, reuse the


session with the session attributes !
Allows you to set timeouts/retries/port
Faster

50

1999 BMC SOFTWARE, INC. 3/17/99

Вам также может понравиться