Front page | perl.beginners |
Postings from December 2002
Using ssh for uptime?
Thread Next
From:
Mark Weisman
Date:
December 7, 2002 09:09
Subject:
Using ssh for uptime?
Message ID:
B030C8F9120CCD43A1FC642851FB9FB46DB5@mavrick.outland
I've got a script that I'm working on that will use SSH to check the
uptime on servers within my domain. However, I'm unsure of how exactly
to do this this is what I have so far.
##!/usr/bin/perl
#My (@machines,$host,$user,$pass)
#Open(INFILE,"<machines.txt")
# or die "Error opening machines.txt.$!,stopped"
#@machines = <INFILE>;
#Close(INFILE);
#Foreach my $rec (@machines) {
# chomp($rec);
# ($host,$user,$pass) = split(/,/, $rec);
# open (OUTFILE, ">records.txt")
# or die "Error opening records.txt.$!,stopped";
# close(OUTFILE);
# open (OUTFILE, ">>records.txt")
# or die "Error opening records.txt.$!,stopped";
# print OUTFILE 'ssh -l $user $host "uptime"';
# close(OUTFILE);
#};
Without the hash marks of course. Where am I going wrong? Help please?
His Faithful Servant,
Mark-Nathaniel Weisman
President / CEO
Infinite Visions Educational Systems Inc.
Anchorage, Alaska
http://www.ivedsys.com
weismanm@ivedsys.com
Thread Next
-
Using ssh for uptime?
by Mark Weisman