CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Advanced: Re: [cuboidgraphix] Help with Telnet commands.: Edit Log

Veteran / Moderator

Jan 22, 2009, 7:42 AM

Views: 7037
Re: [cuboidgraphix] Help with Telnet commands.

# This file is the
# This is a script that will telnet into the BSM,
# and clear all SWERR and erase all cleared alarms.

use strict;
use warnings;
use Net::Telnet;
use Text::ParseWords;
use POSIX qw/strftime/;

my $date = strftime("%Y-%m-%d", localtime(time));
my $temp = "/home/bsm/data/temp.txt";
my $user = "USR";
my $pass = "PWD";
my $server = "HOST";
my $t = Net::Telnet->new(Prompt => '/login:/');

$t->login($user, $pass);

my ($data) = $t->waitfor('/>/');

foreach my $line (split /\n/, $data) {
my (undef, $index, $status, $activity, $datetime, $source, $severity, $faultname) = quotewords('\s+', 0, $line);

if ($faultname =~ /^SWERR/){
print $index, "\n";
print $faultname, "\n";
$t->print("cd $source;");
$t->print("action uploadlogsfromcc1;");

(This post was edited by FishMonger on Jan 22, 2009, 7:43 AM)

Edit Log:
Post edited by FishMonger (Veteran) on Jan 22, 2009, 7:43 AM

Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives