beautypg.com

Snmp_gettable, Mp_gettable – Visara Master Console Center Scripting Guide User Manual

Page 186

background image

Chapter 5 Script Commands

Scripting Guide

186

SNMP_GETTABLE

Syntax:

SNMP_GETTABLE( $Alias, $MIBOID, $TableArray[, $Delimiter]) ==>
%ReturnCode

Description:

Retrieves a complete table of information from the MIB on the specified

agent.

Action:

Given an OID that points to a table-type piece of data, this function

returns the SNMP MIB table in the TableArray parameter. Each row

in the MIB table will be stored as one element in the array with the
columns separated by the Delimiter parameter.

Parameters:

$Alias. String expression. The NMS alias to get the MIB object values
from. The specified alias must not be a group alias. Refer to NMS

Alias on page 31 for more information.
$MIBOID. String expression. The MIB object ID for which to get the
values. Refer to MIB OID on page 31 for more information.
$TableArray. Associative string array. The array that will be
populated with the table data.
$Delimiter. String expression. Optional. A string of separator
characters to be used to separate columns in each array element. This

is the character(s) used by the SPLIT() command to break the data

apart into fields. If not specified, it defaults to “^|^” (a very unique
sequence of characters).

Returns:

Numeric value, as listed below:
Return Code

Description

0

Success

-1

Agent not defined in SNMP Setup

-2

Invalid

Argument

-3

Agent

not

found

-5

Unable to open configuration file

-6

Internal memory allocation error. Contact

Visara Technical Support immediately

-7

Bad

MIB

-8

Configuration

file

error

Notes:

1. Do not use SNMP_GETTABLE() to retrieve an entire MIB, as this

may overwhelm the MCC. Instead, use SNMP_GETTABLE() to
retrieve specific branches and leaves from the MIB.

2. For information on error checking of SNMP_GETTABLE (), refer

to the SNMP_GETTABLE() command.

3. The associative array includes an element called "_header_" that

can be used to specify the name of each column (field) in the table
to retrieve. The header must exist in the MIB.