NAME
Cisco::SNMP::Line - Line Interface for Cisco Management
SYNOPSIS
use Cisco::SNMP::Line;
DESCRIPTION
The following methods are for line management. Lines on Cisco devices refer to console, auxillary and terminal lines for user interaction. These methods implement the OLD-CISCO-TS-MIB
which is not available on some newer forms of IOS.
METHODS
new() - create a new Cisco::SNMP::Line object
my $cm = Cisco::SNMP::Line->new([OPTIONS]);
Create a new Cisco::SNMP::Line object with OPTIONS as optional parameters. See Cisco::SNMP for options.
lineOIDs() - return OID names
my @lineOIDs = $cm->lineOIDs();
Return list of Line MIB object ID names.
sessOIDs() - return OID names
my @sessOIDs = $cm->sessOIDs();
Return list of Session MIB object ID names.
line_clear() - clear connection to line
my $line = $cm->line_clear([OPTIONS]);
Clear the line (disconnect interactive session). Called with no arguments, clear all lines. Called with one argument, interpreted as the lines to clear.
Option Description Default
------ ----------- -------
-lines Line or range of lines (, and -) (all)
To specify individual lines, provide their number:
my $line = $cm->line_clear(2);
Clear line 2. To specify a range of lines, provide a range:
my $line = $cm->line_clear('2-4,6,9-11');
Clear lines 2 3 4 6 9 10 11.
If successful, returns a pointer to an array containing the lines cleared.
line_info() - return line info
my $lineinfo = $cm->line_info();
Populate a data structure with line information. If successful, returns a pointer to a hash containing line information.
$lineinfo->{0}->{'Number', 'TimeActive', ...}
$lineinfo->{1}->{'Number', 'TimeActive', ...}
...
$lineinfo->{n}->{'Number', 'TimeActive', ...}
Allows the following accessors to be called.
lineActive() - return line active
$lineinfo->lineActive([#]);
Return the active of the line at index '#'. Defaults to 0.
lineType() - return line type
$lineinfo->lineType([#]);
Return the type of the line at index '#'. Defaults to 0.
lineAutobaud() - return line autobaud
$lineinfo->lineAutobaud([#]);
Return the autobaud of the line at index '#'. Defaults to 0.
lineSpeedIn() - return line speedin
$lineinfo->lineSpeedIn([#]);
Return the speedin of the line at index '#'. Defaults to 0.
lineSpeedOut() - return line speedout
$lineinfo->lineSpeedOut([#]);
Return the speedout of the line at index '#'. Defaults to 0.
lineFlow() - return line flow
$lineinfo->lineFlow([#]);
Return the flow of the line at index '#'. Defaults to 0.
lineModem() - return line modem
$lineinfo->lineModem([#]);
Return the modem of the line at index '#'. Defaults to 0.
lineLocation() - return line location
$lineinfo->lineLocation([#]);
Return the location of the line at index '#'. Defaults to 0.
lineTerm() - return line term
$lineinfo->lineTerm([#]);
Return the term of the line at index '#'. Defaults to 0.
lineScrLen() - return line scrlen
$lineinfo->lineScrLen([#]);
Return the scrlen of the line at index '#'. Defaults to 0.
lineScrWid() - return line scrwid
$lineinfo->lineScrWid([#]);
Return the scrwid of the line at index '#'. Defaults to 0.
lineEsc() - return line esc
$lineinfo->lineEsc([#]);
Return the esc of the line at index '#'. Defaults to 0.
lineTmo() - return line tmo
$lineinfo->lineTmo([#]);
Return the tmo of the line at index '#'. Defaults to 0.
lineSestmo() - return line sestmo
$lineinfo->lineSestmo([#]);
Return the sestmo of the line at index '#'. Defaults to 0.
lineRotary() - return line rotary
$lineinfo->lineRotary([#]);
Return the rotary of the line at index '#'. Defaults to 0.
lineUses() - return line uses
$lineinfo->lineUses([#]);
Return the uses of the line at index '#'. Defaults to 0.
lineNses() - return line number of sessions
$lineinfo->lineNses([#]);
Return the number of sessions of the line at index '#'. Defaults to 0.
lineUser() - return line user
$lineinfo->lineUser([#]);
Return the user of the line at index '#'. Defaults to 0.
lineNoise() - return line noise
$lineinfo->lineNoise([#]);
Return the noise of the line at index '#'. Defaults to 0.
lineNumber() - return line number
$lineinfo->lineNumber([#]);
Return the number of the line at index '#'. Defaults to 0.
lineTimeActive() - return line timeactive
$lineinfo->lineTimeActive([#]);
Return the timeactive of the line at index '#'. Defaults to 0.
line_sessions() - return session info for lines
my $session = $cm->line_sessions();
Populate a data structure with the session information per line. If successful, returns a pointer to a hash containing session information.
$sessions->{1}->[0]->{'Session', 'Type', 'Dir' ...}
[1]->{'Session', 'Type', 'Dir' ...}
...
...
$sessions->{n}->[0]->{'Session', 'Type', 'Dir' ...}
First hash value is the line number, next array is the list of current sessions per the line number.
Allows the following accessors to be called.
sessType() - return session type
$sessions->sessType([$line[,$sess]]);
Return the type of the session on line $line, session index $sess. Defaults to 0.
sessDirection() - return session direction
$sessions->sessDirection([$line[,$sess]]);
Return the direction of the session on line $line, session index $sess. Defaults to 0.
sessAddress() - return session address
$sessions->sessAddress([$line[,$sess]]);
Return the address of the session on line $line, session index $sess. Defaults to 0.
sessName() - return session name
$sessions->sessName([$line[,$sess]]);
Return the name of the session on line $line, session index $sess. Defaults to 0.
sessCurrent() - return session current
$sessions->sessCurrent([$line[,$sess]]);
Return the current of the session on line $line, session index $sess. Defaults to 0.
sessIdle() - return session idle
$sessions->sessIdle([$line[,$sess]]);
Return the idle of the session on line $line, session index $sess. Defaults to 0.
sessLine() - return session line
$sessions->sessLine([$line[,$sess]]);
Return the line of the session on line $line, session index $sess. Defaults to 0.
line_message() - send message to line
my $line = $cm->line_message([OPTIONS]);
Send a message to the line. With no arguments, a "Test Message" is sent to all lines. If 1 argument is provided, interpreted as the message to send to all lines. Valid options are:
Option Description Default
------ ----------- -------
-lines Line or range of lines (, and -) (all)
-message Double-quote delimited string "Test Message"
If successful, returns a pointer to an array containing the lines messaged.
line_numberof() - return number of lines
my $line = $cm->line_numberof();
If successful, returns the number of lines on the device.
DIRECT ACCESS METHODS
The following methods can be called on the Cisco::SNMP::Line object directly to access the values directly.
- get_lineActive (#)
- get_lineType (#)
- get_lineAutobaud (#)
- get_lineSpeedIn (#)
- get_lineSpeedOut (#)
- get_lineFlow (#)
- get_lineModem (#)
- get_lineLocation (#)
- get_lineTerm (#)
- get_lineScrLen (#)
- get_lineScrWid (#)
- get_lineEsc (#)
- get_lineTmo (#)
- get_lineSestmo (#)
- get_lineRotary (#)
- get_lineUses (#)
- get_lineNses (#)
- get_lineUser (#)
- get_lineNoise (#)
- get_lineNumber (#)
- get_lineTimeActive (#)
-
Get Line OIDs where (#) is the OID instance, not the index from
line_info
. If (#) not provided, uses 0. - get_sessType (l,s)
- get_sessDirection (l,s)
- get_sessAddress (l,s)
- get_sessName (l,s)
- get_sessCurrent (l,s)
- get_sessIdle (l,s)
- get_sessLine (l,s)
-
Get Session OIDs where (l) is the OID instance of the line and (s) is the OID instance of the session on that line. If (l,s) not provided, uses 0.
INHERITED METHODS
The following are inherited methods. See Cisco::SNMP for more information.
- close
- error
- session
EXPORT
None by default.
EXAMPLES
This distribution comes with several scripts (installed to the default bin
install directory) that not only demonstrate example uses but also provide functional execution.
LICENSE
This software is released under the same terms as Perl itself. If you don't know what that means visit http://perl.com/.
AUTHOR
Copyright (C) Michael Vincent 2015
All rights reserved