Sample PERL scripts for managing PortServer TS units without user interaction.

Perl scripts can be used to perform tasks on the PortServer TS units without the need for user interaction. Such scripts can be configured to execute automatically in the evening/off hours on various operating systems.

To install the Net::Telnet module:

perl -MCPAN -e "intalll Net::Telnet"

A sample script:

#!/usr/bin/perl

use Net::Telnet;
$telnet = new Net::Telnet ( Timeout=>10,
Errmode=>'die'); $telnet->open('199.86.2.39'); 
$telnet->login(root, dbps); @lines = $telnet->cmd("who"); print @lines;

To flush the arp table, for example:

#!/usr/bin/perl

use Net::Telnet; 

$telnet = new Net::Telnet ( Timeout=>10,

                             Errmode=>'die');  $telnet->open('199.86.2.39');

  $telnet->login(root, dbps);  @lines = $telnet->cmd("set arp");  print @lines;

  @lines = $telnet->cmd("remove arp");  @lines = $telnet->cmd("set arp");  print @lines;
Last updated: Jan 01, 2024

Filed Under

Network

Recently Viewed

No recently viewed articles

Did you find this article helpful?