Cisco-Accounting
view release on metacpan or search on metacpan
lib/Cisco/Accounting.pm view on Meta::CPAN
croak $@;
}
if ( ($disconnect > 0) && ($self->{'persistent'} <= 0) ) {
$self->_disconnect();
}
}
##
## Send a keepalive (new line character), do not do any error checking here
## Useful if 'persistent' is enabled, but still it's up to you to call the keepalive in time before session times out
##
sub keepalive() {
my ($self) = shift;
if ($self->{'session'}) {
eval {
$self->{'session'}->cmd(" ");
};
}
}
lib/Cisco/Accounting.pm view on Meta::CPAN
starttime timestamp of the first time do_accounting() was called
lastpolltime timestamp of the last time do_accounting() was called
totalpolls number of times do_accounting() was called
totalbytes total number of bytes seen for every time do_accounting() was called
totalpackets total number of packets seen for every time do_accounting() was called
totalpolledlines total number of lines that was parsed and aggregated
totalskippedlines total number of lines that were skipped (headers etc.)
uniquehostpairs total number of unique host pairs that were seen
=item keepalive()
If you have a persistent connection but you're only calling do_accounting() every 5 minutes for example then you might receive
a connection timeout.
This can be solved by sending a keepalive every 30 seconds for example.
The keepalive just sends a newline character to the remote host avoiding a connection timeout.
$acct->keepalive()
=back
=head1 SUPPORTED DEVICES
At the moment only telnet connections are supported, not SSH.
All Cisco routers and switches that support 'IP Accounting'. Make sure that you have enable permissions and in configure permissions in
case you're enabling or disabling IP Accounting on interfaces.
( run in 2.433 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )