8 my $poll_frequency = 60;
12 my $time = POSIX::ctime(time);
14 printf STDERR "[%s] %s\n", $time, $msg;
18 die("Error in arguments passed\n".
19 "./ssendfile.pl addr configfile\n");
22 my $conn = nms::switch_connect($ARGV[0]);
23 if (!defined($conn)) {
24 die("Could not connect to switch.\n");
27 open(CONFIG, $ARGV[1]);
31 print "Executing: `$cmd`\n";
32 # if ($cmd =~ /ip ifconfig swif0 (\d{1-3}\.\d{1-3}\.\d{1-3}\.\d{1-3})/) {
33 # print "New ip: $1\n";
34 # $conn->cmd( String => $cmd,
36 # $conn = nms::switch_connect($1);
37 # if (!defined($conn)) {
38 # die "Could not connect to new ip: $1\n";
42 my @data = nms::switch_exec($cmd, $conn);
43 foreach my $line (@data) {
44 $line =~ s/[\r\n]+//g;