RIV module overview

The RIV module provides a variable, functions, and virtual methods that the Perl API application modules — RIV::Agent and RIV::App — use.

Perl API modules used with the RIV module

The following table identifies and briefly describes the Perl API modules used with the RIV module:

Perl API Module Description

RIV::Agent

Provides an interface for implementing Network Manager discovery agents.

RIV::App

Provides an interface for implementing other Network Manager client/server applications.

RIV::OQL

Provides an interface to communicate and perform operations on internal Network Manager databases.

RIV::Param

Provides an interface for parsing standard and Network Manager application-specific command line arguments.

RIV::Record

Provides a data structure to store the network entity. Typically, you use this data structure in conjunction with the RIV::Agent module to write discovery agents.

RIV::RecordCache

Provides an interface to access records that reside in a cache.

RIV::SnmpAccess

Provides an interface to perform SNMP-related operations on Network Manager MIB trees.

Note: Discovery agents in previous versions of the Perl API used this module to obtain SNMP information from network devices. Discovery agents implemented with this version of the Perl API should use the SNMP methods that the RIV::Agent module provides.

Types of applications

There are two types of applications that you can write using the Perl API:

  • Discovery agents — Use the RIV::Agent constructor and the ncp_disco_perl_agent binary to create discovery agent applications.
  • Other client/server applications — Use the RIV::App constructor and the ncp_perl binary to other client/server applications. Examples of these other client/server applications include those that access Network Manager databases.

These application objects are required for interaction with Network Manager components (through the virtual methods exported through the RIV module) and for instantiation of the other RIV modules. Application objects that the RIV::Agent and RIV::App constructors return are identical for the purpose of accessing other module functionality (for example, RIV::OQL).

RIV module functions

The following table identifies and briefly describes the functions that the RIV module provides for Network Manager discovery agents and other Network Manager client/server applications:

RIV module function Description

RIV::GetInput

This function has been deprecated. Use the RIV::GetResult function.

RIV::GetResult

Obtains input either directly or indirectly from message broker.

RIV::InputFilter

Binds the specified input function to input tags that match the specified regular expression.

RIV::InputQueueLength

Returns the number of items waiting in the application's input queue.

RIV::IsIpNotLoopBackOrMulticast

Determines whether the specified address is a valid IP address and not a loop back or multicast address.

RIV::IsIpValid

Determines whether the specified address is a valid IP address.

RIV::IsIpv4Valid

Determines whether the specified address is a valid IPv4 address.

RIV::IsIpv6Valid

Determines whether the specified address is a valid IPv6 address.

RIV::ReadDir

Returns a reference to an array of filenames contained in the specified directory.

RIV::RivDebug

Prints a list of debug message strings to the standard output.

RIV::RivMessage

Prints a list of log message strings to the standard output.

RIV::RivError

Displays error messages.

See RIV module reference for the reference (man) pages associated with these functions.

RIV module virtual methods

The following table identifies and briefly describes the virtual methods that the RIV module provides for Network Manager discovery agents and other Network Manager client/server applications:

RIV module virtual method Description

AddSubject

Binds the application to the specified message broker subject.

AddTimer

Creates a single-shot or repeating timer.

DebugLevel

Provides access to the global Network Manager debug setting through the RIV::DebugLevel variable.

DecryptPassword

Decrypts a password that was previously encrypted in a previous call to the EncryptPassword RIV module virtual method.

EncryptPassword

Returns an encrypted representation of the specified password.

Latency

Retrieves the timeout for queries.

PostInput

Adds a message to the queue.

PublishMessage

Publishes the specified message string.

PublishMessage

Encodes the hash reference into a message broker string.

RetryLimit

Sets the retry limit for queries or returns the maximum number of retries for queries.

See RIV module reference for the reference (man) pages associated with these functions.