Compaq GS320 User Manual

Page 281

Advertising
background image

Compaq-Supplied Configuration Files for ConsoleWorks

D-9

print SOCK "DATA\n";

#

print SOCK "From: $fm\n";

#Note the error...

print SOCK "Subject: $subj\n";
print SOCK "To: $to\n";
print SOCK "\n";
print SOCK @msg;
print SOCK "\n.\n";
sleep(2);
print SOCK "QUIT\n";
sleep(2);
close (SOCK) || die "close: $!";

}
#
# Main ()
#
my ($whoami, $hostname, $mf, @tolist, $subj, $to, $domail);
$whoami

= "ConsoleWorks";

$hostname = `hostname`;
$mf

= "$whoami\@$hostname";

@tolist

= split /,/, $ARGV[4];

$domail

= 1;

#+
# Parse PCI/BPM SysEvents
# The 3 line entries look something like this, with the last
line changing
#

~E~ PCI3/PBM13 SysEvent

#

~E~ PBM13 Error:

#

~E~ FAN1 FAIL - POWEROFF IN 30 SECONDS

#-
if ( $ARGV[1] eq /GS_PCI_PBM_SYSEVENT/ ) {

open (SC, $ARGV[3]) ||

die "Can not open event context file - $ARGV[3] $!";

while (<SC>) {

if (/^CONTEXT_BEGIN:/) {last};

}
while (<SC>) {

if ($_ eq /^CONTEXT_END:/) {last};
if ($_ =~ /^~E~/) {

if ($_ =~ /^~E~ PCI.\/PBM.. SysEvent/) {next;}
if ($_ =~ /^~E~ PBM.. Error:/) {next;}

#+ # Here is the real parsing, you may take other than mail
actions
# or add other events than listed...
#-

if ($_ =~ /^~E~ FAN. FAIL - POWEROFF IN 30 SECONDS/)

{next;}

if ($_ =~ /^~E~ LM80 . TEMP FAIL/) {next;}
if ($_ =~ /^~E~ PS. POK DEASSERTED/) {next;}

#

Other events are just ignored...

$domail = 0;

Advertising