in reply to getuptime script
my @fcping_lines = `fcping $port`; for (@fcping_lines) { if (/\s+ and \s+ (.*?) \s+/x) { my $unsucces = $1; if ($unsucces eq "0") { print "Network Issue\n"; } else { print "Check HBA Status\n"; } } }
Make sure to use strict; use warnings and declare all you variables with my.
It may also be useful to check the success of your fcping commands, by checking the $? special variable.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: getuptime script
by deepupower123 (Initiate) on Oct 30, 2008 at 18:13 UTC |