Compaq AAR04BCTE Uživatelský manuál

Procházejte online nebo si stáhněte Uživatelský manuál pro Hardware Compaq AAR04BCTE. Compaq AAR04BCTE User Manual Uživatelská příručka

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 132
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 0
Compaq TCP/IP Services for
OpenVMS
SNMP Programming and
Reference
Order Number: AA–R04BC–TE
January 2001
Revision/Update Information: This manual supersedes the DIGITAL
TCP/IP Services for OpenVMS eSNMP
Programming and Reference, Version
5.0.
Software Version: Compaq TCP/IP Services for OpenVMS
Version 5.1
Operating Systems: OpenVMS Alpha Versions 7.1, 7.2-1
OpenVMS VAX Versions 7.1, 7.2
Compaq Computer Corporation
Houston, Texas
Zobrazit stránku 0
1 2 3 4 5 6 ... 131 132

Shrnutí obsahu

Strany 1 - Reference

Compaq TCP/IP Services forOpenVMSSNMP Programming andReferenceOrder Number: AA–R04BC–TEJanuary 2001Revision/Update Information: This manual supersedes

Strany 2

The following conventions are used in this manual. In addition, please note thatall IP addresses are fictitious.Ctrl/x A sequence such as Ctrl/x indica

Strany 3 - Contents

eSNMP API Routinesoid2instanceoid2instanceExtracts the instance values from an OID structure and copies them to thespecified array of integers. The rou

Strany 4 - 5 eSNMP API Routines

eSNMP API Routinesoid2instanceExample#include <esnmp.h>OID *incoming = &method->varbind->name;OBJECT *object = method->object;int i

Strany 5

eSNMP API Routinesinst2ipinst2ipReturns an IP address derived from an OID instance.Formatint inst2ip ( unsigned int *instance,int *length,unsigned int

Strany 6

eSNMP API Routinesinst2ipDescriptionUse the EXACT mode for evaluating an instance forGetandSetoperations. ForGetNextandGetBulkoperations, use the NEXT

Strany 7 - Document Structure

eSNMP API Routinesinst2ipThe search key consists of a number and two ipaddr values. These arerepresented in the instance part of the OID as n.A.A.A.A.

Strany 8 - Related Documents

eSNMP API Routinescmp_oidcmp_oidCompares two OID structures.Formatint cmp_oid ( oid *q,oid *p );DescriptionThis routine does an element-by-element com

Strany 9 - Conventions

eSNMP API Routinescmp_oid_prefixcmp_oid_prefixCompares an OID against a prefix.Formatint cmp_oid_prefix ( oid *q,oid *prefix );DescriptionA prefix could be

Strany 10

eSNMP API Routinesclone_oidclone_oidMakes a copy of the OID. This routine does not allocate an OID structure.Formatoid clone_oid ( oid *new,oid *oid )

Strany 11 - Monospace text

eSNMP API Routinesfree_oidfree_oidFrees the OID structure’s buffer. This routine does not deallocate the OIDstructure itself; it deallocates the eleme

Strany 12

eSNMP API Routinesclone_bufclone_bufDuplicates a buffer in a dynamically allocated space.Formatchar clone_buf ( char *str,int *len );ArgumentsstrA poi

Strany 13 - Overview

Monospace textMonospace type indicates code examples and interactive screendisplays.This typeface indicates UNIX system output or user input,commands,

Strany 14 - 1.2 Request Handling

eSNMP API Routinesmem2octmem2octConverts a string (a buffer and length) to anoctstructure with the new buffer’saddress and length.Formatoct *mem2oct (

Strany 15

eSNMP API Routinescmp_octcmp_octCompares two octet strings.Formatint cmp_oct ( oct *oct1,oct *oct2 );Argumentsoct1Pointer to the first octet string.oct

Strany 16

eSNMP API Routinesclone_octclone_octMakes a copy of the data in anoctstructure. This routine does not allocate anoctstructure; it allocates the buffer

Strany 17 - 1.4 Writing an eSNMP Subagent

eSNMP API Routinesfree_octfree_octFrees the buffer attached to anoctstructure. This routine does not deallocatetheoctstructure; it deallocates the buf

Strany 18 - 1.5 The eSNMP API

eSNMP API Routinesfree_varbind_datafree_varbind_dataFrees the dynamically allocated fields in the VARBIND structure. However, thisroutine does not deal

Strany 19 - 1.6 The MIB Compiler

eSNMP API Routinesset_debug_levelset_debug_levelSets the logging level, which dictates what log messages are generated. Theprogram or module calls the

Strany 20 - 1.7 SNMP Versions

eSNMP API Routinesis_debug_levelis_debug_levelTests the logging level to see whether the specified logging level is set. You cantest the logging levels

Strany 21 - 1.8 For More Information

eSNMP API RoutinesESNMP_LOGESNMP_LOGThis is an error declaration C macro defined in the ESNMP.H header file. Itgathers the information that it can obtai

Strany 22

eSNMP API Routines__print_varbind__print_varbindDisplays the VARBIND and its contents. This routine is used for debuggingpurposes. To use this routine

Strany 23

eSNMP API Routinesset_select_limitset_select_limitSets the eSNMP select error limit. For more information, see Section 6.1.Formatset_select_limit ( ch

Strany 25

eSNMP API Routines__set_progname__set_prognameSpecifies the program name that will be displayed in log messages. This routineshould be called from the

Strany 26

eSNMP API Routines__restore_progname__restore_prognameRestores the program name from the second application of the set. This routineshould be called o

Strany 27 - 2.2 Overview of MIB II

eSNMP API Routines__parse_progname__parse_prognameParses the full file specification to extract only the file name and file extension.Format_ _parse_progn

Strany 28

eSNMP API Routinesesnmp_cleanupesnmp_cleanupCloses open sockets that are used by the subagent for communicating with themaster agent.Formatesnmp_clean

Strany 30

6Troubleshooting eSNMP ProblemsThe eSNMP modules provided with TCP/IP Services include troubleshootingfeatures that are useful in controlling the way

Strany 31

Troubleshooting eSNMP Problems6.2 Modifying the Subagent TimeoutThe TCPIP$ESNMP_DEFAULT_TIMEOUT value is from 0 to 60 seconds. (Youshould use 0 only f

Strany 32 - 3.2.2 MIB Subtrees

Troubleshooting eSNMP Problems6.3 Log FilesTCP/IP Services does not support writing log files to locations other than theSYS$SYSDEVICE:[TCPIP$SNMP] dir

Strany 34

IndexAAgentX protocol, 1–2API functionality, 1–6ASN.1 files, 3–5CC compiler, 3–1Chess exampletree structure, 3–4clone_bufsupport routine, 5–51clone_oct

Strany 35

1OverviewThe Simple Network Management Protocol (SNMP) is the de facto industrystandard for managing TCP/IP networks. The protocol defines the role of

Strany 36

MManagement information base (MIB), 1–1Master agent, 1–1mem2octsupport routine, 5–52method routinesroutine reference, 5–19 to 5–24MIB browser, 4–1comm

Strany 37

Trap sender (cont’d)command parameters, 4–9running, 4–9Troubleshooting features, 6–1UUNIX utilities, 3–7WWriting subagentscompiling, 3–5creating sourc

Strany 39

Overview1.1 SNMP ArchitectureFigure 1–1 SNMP ArchitectureMaster AgentSNMP/ASN.1LibraryeSNMP APIAgentX (TCP/IP V5.1)Subagent 1 Subagent 2 Subagent nTCP

Strany 40

Overview1.2 Request HandlingFigure 1–2 eSNMP Data FlowVM-0705A-AIClientTrapclientMaster AgentSubagent 1Subagent 2Subagent 1ClientMaster AgentSubagent

Strany 41

Overview1.2 Request HandlingThe network management station sends an SNMP request to the masteragent running on the host, using port 161. An SNMP reque

Strany 42 - Procedures

Overview1.3 TCP/IP Services Components for SNMPTable 1–1 (Cont.) SNMP Component FilesFile Location FunctionTCPIP$SNMP_TRAPRCV.EXE SYS$SYSTEM Utility f

Strany 43

Overview1.4 Writing an eSNMP SubagentTable 1–2 Files for Building a SubagentFile DescriptionESNMP.H Header file used to create a subagent. Located inTC

Strany 44

Overview1.5 The eSNMP APIInterface routines handle the basic subagent operations, such as:• Subagent initialization and termination• Registration• Pol

Strany 45 - Using the SNMP Utilities

© 2001 Compaq Computer CorporationCOMPAQ, VAX, VMS, and the Compaq logo Registered in U.S. Patent and Trademark Office.OpenVMS and Tru64 are trademarks

Strany 46 - 4.1.2 MIB Browser Flags

Overview1.6 The MIB Compiler• Method routine function prototypesThe subtree_TBL.C file is an object file that contains the following:• An array of integ

Strany 47

Overview1.7 SNMP VersionsIf you have problems running images linked against an older version ofUCX$ESNMP_SHR.EXE, verify that the version in SYS$SHARE

Strany 49 - 4.1.3 MIB Browser Data Types

2MIBs Provided with TCP/IP ServicesThis chapter describes how MIBs are implemented on OpenVMS. The MIBsprovided with TCP/IP Services are:• The Host Re

Strany 50

MIBs Provided with TCP/IP Services2.1 Overview of the Host Resources MIBTable 2–1 (Cont.) Host Resources MIB ObjectsObject Name RFC Description OpenVM

Strany 51

MIBs Provided with TCP/IP Services2.1 Overview of the Host Resources MIBTable 2–1 (Cont.) Host Resources MIB ObjectsObject Name RFC Description OpenVM

Strany 52

MIBs Provided with TCP/IP Services2.1 Overview of the Host Resources MIBhrFSLastFullBackupDatehrFSLastPartialBackupDatehrStorageSizehrSWRunStatushrSys

Strany 53

MIBs Provided with TCP/IP Services2.1 Overview of the Host Resources MIBTCPIP$SNMP_REQUEST.EXE responds with no output and returns directlyto the DCL

Strany 54

MIBs Provided with TCP/IP Services2.2 Overview of MIB II2.2.1 MIB II Implemented GroupsA group is a subdivision of a MIB that defines a subtree. SNMP a

Strany 55

MIBs Provided with TCP/IP Services2.2 Overview of MIB IIWhen both the TCPIP$OS_MIBS and TCPIP$HR_MIB subagents arerunning, agetrequest on thesysORTabl

Strany 56

ContentsPreface ... vii1 Overview1.1 SNMP Architecture . . ...

Strany 58

3Creating a Subagent Using the eSNMP APIThis chapter describes how to use the eSNMP API to create a MIB subagent thatmanages entities or applications.

Strany 59 - 5.1 Interface Routines

Creating a Subagent Using the eSNMP API3.2 The Structure of Management Information3.2.1 Assigning Object Identification CodesEach object in a MIB is as

Strany 60 - 5–2 eSNMP API Routines

Creating a Subagent Using the eSNMP API3.2 The Structure of Management InformationFigure 3–1 MIB II in SMI Tree StructureVM-0721A-AIiso (1)org (3)dod

Strany 61

Creating a Subagent Using the eSNMP API3.2 The Structure of Management InformationFor example, the chess MIB provided with the sample code in the[TCPI

Strany 62

Creating a Subagent Using the eSNMP API3.2 The Structure of Management InformationNormally, it is the nonleaf nodes that are registered as a subtree w

Strany 63

Creating a Subagent Using the eSNMP API3.3 Creating a MIB Source FileThe parameters and qualifiers for the MIBCOMP command are as follows:Parameter or

Strany 64 - 5–6 eSNMP API Routines

Creating a Subagent Using the eSNMP API3.3 Creating a MIB Source Fileenum: complete 1enum: underway 2enum: delete 3moveTable 1.3.6.1.4.1.36.2.15.2.99.

Strany 65

Creating a Subagent Using the eSNMP API3.3 Creating a MIB Source File1. Declaration SectionThe first section of the subtree_TBL.H file is a declaration

Strany 66

Creating a Subagent Using the eSNMP API3.3 Creating a MIB Source Filetypedef struct _chess_type {OID ches;int chessMaxGames;int chessNumGames;char che

Strany 67

4 Using the SNMP Utilities4.1 Using the MIB Browser ... 4–14.1.1 MIB Browser Parameters. . . ...

Strany 68 - 5–10 eSNMP API Routines

Creating a Subagent Using the eSNMP API3.3 Creating a MIB Source File2. Array of OBJECT Structures SectionThe second section of the subtree_TBL.C file

Strany 69

Creating a Subagent Using the eSNMP API3.3 Creating a MIB Source File3. Initialized Subtree Structure SectionThe third section of the subtree_TBL.C fil

Strany 70

Creating a Subagent Using the eSNMP API3.4 Including the Routines and Building the SubagentDepending on the version of the Compaq C compiler you are u

Strany 71

Creating a Subagent Using the eSNMP API3.5 Including Extension Subagents in the Startup and Shutdown ProceduresFile Name Edit RequiredTCPIP$EXTENSION_

Strany 73

4Using the SNMP UtilitiesTCP/IP Services includes the following programs, which are useful for testingapplications and for analyzing SNMP problems:• T

Strany 74 - 5–16 eSNMP API Routines

Using the SNMP Utilities4.1 Using the MIB BrowserTable 4–1 (Cont.) snmp_request Command ParametersParameter Function"community"The community

Strany 75

Using the SNMP Utilities4.1 Using the MIB BrowserTable 4–2 Flags for the snmp_request CommandFlag Description-dSpecifies hexadecimal dump mode. Before

Strany 76 - 5–18 eSNMP API Routines

Using the SNMP Utilities4.1 Using the MIB BrowserTable 4–2 (Cont.) Flags for the snmp_request CommandFlag Description-lSpecifies loop mode. Note that t

Strany 77 - 5.2 Method Routines

Using the SNMP Utilities4.1 Using the MIB BrowserTable 4–2 (Cont.) Flags for the snmp_request CommandFlag Description-s sleep_intervalSpecifies the num

Strany 78 - *_get Routine

cmp_oid_prefix ... 5–48clone_oid . . ... 5–49free_oid . . . ...

Strany 79

Using the SNMP Utilities4.1 Using the MIB BrowserNoteExcept for-l(Counter64), the data types are case sensitive. To preserveuppercase for display stri

Strany 80 - *_set Routine

Using the SNMP Utilities4.1 Using the MIB Browser$ snmp_request marley.dec.com "public" get 1.3.6.1.2.1.2.2.1.2.1 -_$ 1.3.6.1.2.1.25.1.1.01.

Strany 81

Using the SNMP Utilities4.1 Using the MIB Browser6. The following example uses the same command as in example 5, but itspecifies the-tflag instead of th

Strany 82

Using the SNMP Utilities4.2 Using the Trap Sender and Trap Receiver ProgramsBy default, these programs use UDP port 162. However, you can specify anot

Strany 83

Using the SNMP Utilities4.2 Using the Trap Sender and Trap Receiver ProgramsTable 4–4 Parameters for the snmp_trapsnd CommandParameter Descriptionente

Strany 84

Using the SNMP Utilities4.2 Using the Trap Sender and Trap Receiver ProgramsTable 4–5 (Cont.) Flags for the snmp_trapsnd CommandFlag Description-h hos

Strany 85 - 5.2.3 Value Representation

Using the SNMP Utilities4.2 Using the Trap Sender and Trap Receiver Programsenterprise - 1.2.3agent address - 6.20.208.53trap type - Enterprise-specif

Strany 86

Using the SNMP Utilities4.2 Using the Trap Sender and Trap Receiver Programsaccount that has SYSPRV privilege. Note that the port number must be great

Strany 88 - 5.3 Support Routines

5eSNMP API RoutinesThis chapter provides reference information about the following types ofapplication programming interface (API) routines in the eSN

Strany 90 - 5–32 eSNMP API Routines

eSNMP API Routinesesnmp_initesnmp_initInitializes the Extensible SNMP (eSNMP) subagent and initiates communicationwith the master agent.Formatint esnm

Strany 91

eSNMP API Routinesesnmp_registeresnmp_registerRequests local registration of a single MIB subtree. This indicates to the masteragent that the subagent

Strany 92 - 5–34 eSNMP API Routines

eSNMP API Routinesesnmp_registerA subtree is identified by the base MIB name and the correspondingOIDnumberof the node that is the parent of all MIB va

Strany 93

eSNMP API Routinesesnmp_registerstatus = esnmp_register( &ipRouteEntry_subtree,RESPONSE_TIMEOUT,REGISTRATION_PRIORITY );if (status != ESNMP_LIB_OK

Strany 94 - 5–36 eSNMP API Routines

eSNMP API Routinesesnmp_unregisteresnmp_unregisterCancels registration of a MIB subtree previously registered with the masteragent.Formatint esnmp_unr

Strany 95

eSNMP API Routinesesnmp_register2esnmp_register2Requests registration of a single MIB subtree. This indicates to the master agentthat the subagent ins

Strany 96 - 5–38 eSNMP API Routines

eSNMP API Routinesesnmp_register2Field Name Descriptionrange_upper_bound An integer value that, with a nonzero range_subidfield, specifies a range inste

Strany 97

eSNMP API Routinesesnmp_register2When restarting the eSNMP protocol by callingesnmp_init, all MIB subtreeregistrations are cleared. All MIB subtrees m

Strany 98 - 5–40 eSNMP API Routines

eSNMP API Routinesesnmp_register2Example#include <esnmp.h>#define RESPONSE_TIMEOUT 0 /* use the default time setin esnmp_init message */#define

Strany 99

eSNMP API Routinesesnmp_unregister2esnmp_unregister2Cancels registration of a MIB subtree previously established with the masteragent. Use this routin

Strany 100 - 5–42 eSNMP API Routines

PrefaceThe Compaq TCP/IP Services for OpenVMS product is the Compaqimplementation of the TCP/IP networking protocol suite and internet servicesfor Ope

Strany 101

eSNMP API Routinesesnmp_capabilitiesesnmp_capabilitiesAdds a subagent’s capabilities to the master agent’ssysORTable. ThesysORTableis a conceptual tab

Strany 102 - Arguments

eSNMP API Routinesesnmp_uncapabilitiesesnmp_uncapabilitiesRemoves a subagent’s capabilities from the master agent’ssysORTable.Formatvoid esnmp_uncapab

Strany 103 - Examples

eSNMP API Routinesesnmp_pollesnmp_pollProcesses a pending message that was sent by the master agent.Formatint esnmp_poll ( )DescriptionThis routine is

Strany 104 - 5–46 eSNMP API Routines

eSNMP API Routinesesnmp_are_you_thereesnmp_are_you_thereRequests the master agent to report immediately that it is up and functioning.Formatint esnmp_

Strany 105

eSNMP API Routinesesnmp_trapesnmp_trapSends a trap message to the master agent.Formatint esnmp_trap ( int *generic_trap,int specific_trap,char *enterpr

Strany 106 - 5–48 eSNMP API Routines

eSNMP API Routinesesnmp_termesnmp_termSends a close message to the master agent and shuts down the subagent.Formatvoid esnmp_term (void) ;DescriptionS

Strany 107

eSNMP API Routinesesnmp_sysuptimeesnmp_sysuptimeConverts UNIX system time obtained fromgettimeofdayinto a value with thesame time base assysUpTime.For

Strany 108

eSNMP API Routines5.2 Method Routines5.2 Method RoutinesSNMP requests may contain many encoded MIB variables. Thelibsnmpcodeexecuting in a subagent ma

Strany 109

eSNMP API Routines*_get Routine*_get RoutineThe *_get routine is a method routine for the specified MIB item, which istypically a MIB group (for exampl

Strany 110 - 5–52 eSNMP API Routines

eSNMP API Routines*_get RoutineField Name Descriptionobject A pointer to the object table entry forthe MIB variable being referenced. Themethod->ob

Strany 111

Related DocumentsTable 1 lists the documents available with this version of TCP/IP Services.Table 1 TCP/IP Services DocumentationManual ContentsDIGITA

Strany 112 - 5–54 eSNMP API Routines

eSNMP API Routines*_set Routine*_set RoutineThe*_setmethod routine for a specified MIB item, which is typically a MIBgroup (for example,systemin MIB II

Strany 113

eSNMP API Routines*_set RoutineField Name Descriptionrow A pointer to a ROW_CONTEXT structure(defined in the ESNMP.H header file). AllSetrequests to the

Strany 114

eSNMP API Routines*_set RoutineReturn ValuesESNMP_MTHD_noError The routine completed successfully.ESNMP_MTHD_notWritable The requested object cannot b

Strany 115 - Level Meaning

eSNMP API Routines*_set RoutineIf any row reports failure, all rows that were successfully committed are toldto undo the phase. This is accomplished b

Strany 116

eSNMP API Routines*_set Routine• ESNMP_ACT_UNDOFor each conceptual row that was successfully committed, the same methodroutine is called with method-&

Strany 117 - ESNMP_LOG

eSNMP API Routines*_set Routine• Load the response OID back into the method routine’s VARBIND structure.Set the method->varbind field with the OID o

Strany 118 - __print_varbind

eSNMP API Routines*_set RoutineThe displaystring is different only in that the character array can beinterpreted as ASCII text, but the octetstring ca

Strany 119

eSNMP API Routines*_set Routine• ESNMP_TYPE_Integer32ESNMP_TYPE_Counter32ESNMP_TYPE_<Gauge32 (varbind->value.ul field)The 32-bit counter and 32-b

Strany 120 - __set_progname

eSNMP API Routines5.3 Support Routines5.3 Support RoutinesThe support routines are provided as a convenience for developers writing methodroutines tha

Strany 121 - __restore_progname

eSNMP API Routineso_integero_integerLoads an integer value into the VARBIND structure with the appropriate type.This function does not allocate the VA

Strany 122 - __parse_progname

Table 1 (Cont.) TCP/IP Services DocumentationManual ContentsCompaq TCP/IP Services for OpenVMSSockets API and System ServicesProgrammingThis manual de

Strany 123

eSNMP API Routineso_integerExample#include <esnmp.h>#include "ip_tbl.h" <-- for ipNetToMediaEntry_type definitionVARBIND *vb = meth

Strany 124

eSNMP API Routineso_octeto_octetLoads an octet value into the VARBIND structure with the appropriate type. Thisfunction does not allocate the VARBIND

Strany 125

eSNMP API Routineso_oido_oidLoads anOIDvalue into the VARBIND structure with the appropriate type. Thisfunction does not allocate the VARBIND structur

Strany 126 - 6.3 Log Files

eSNMP API Routineso_stringo_stringLoads a string value into the VARBIND structure with the appropriate type. Thisfunction does not allocate the VARBIN

Strany 127

eSNMP API Routineso_stringExample#include <esnmp.h>#include "ip_tbl.h" <-- for ipNetToMediaEntry_type definitionVARBIND *vb = metho

Strany 128

eSNMP API Routineso_counter64o_counter64Loads a counter64 value into the VARBIND structure.Formatint o_counter64 ( VARBIND *vb,OBJECT *obj,uint64 valu

Strany 129

eSNMP API Routinesstr2oidstr2oidConverts a null-terminated stringOIDin dot notation to anOIDstructure. Thestr2oidroutine does not allocate anOIDstruct

Strany 130

eSNMP API RoutinessprintoidsprintoidConverts anOIDinto a null-terminated string.Formatchar *sprintoid ( char *buffer,oid *oid );DescriptionAnOIDcan ha

Strany 131

eSNMP API Routinesinstance2oidinstance2oidCopies the object’s base OID and appends a copy of the instance array to makea complete OID for a value. Thi

Strany 132

eSNMP API Routinesinstance2oidExample#include <esnmp.h>VARBIND *vb; <-- filled inOBJECT *object; <-- filled inunsigned int instance[6];--

Komentáře k této Příručce

Žádné komentáře