lib_nmstools — Library for NMSTOOLS common functions
require '%%NMSTOOLS_HOME%%/lib/lib_nmstools.pl';
nms_readconfig( "devlogin" );
my $nodelist = $nms_config{'env'}{'DATA'} . '/atm/nodelist';
$hostname .= '.' . $nms_config{'devlogin'}{'DEVDOMAINNAME'};
nms_enumnodes( $nodelistfile, \&callback );
my $telnet = nms_opentelnet( $hostname );
if( $telnet )
{
print $telnet "show version\r";
print $telnet "exit\r";
$telnet->close();
}
else
{
print STDERR "Cannot connect to $hostname";
}
my $namestring = nms_interfaceref( $hostname, $interface );
These library routines are used for establishing the telnet connections to the network devices.
Configuration options initialized by nms_readconfig(). It's a two-dimensional hash array, with the first hash pointing to the configuration filename, and the second hash referencing the configuration options. Also the NMSTOOLS environment variables are initialized into the array as follows:
| $nms_config{'env'}{'HOME'} |
| $nms_config{'env'}{'DATA'} |
| $nms_config{'env'}{'HTML'} |