My apologies if this posts twice. My internet signal isn’t reliable right now. This is an experiment I put away a while ago but Sara’s lesson on language reminded me about it. I have a folder of code authored by my husband, John Buhrmann. He gave it to me for the purpose of using it to create whatever I could from it. Blackout and grayout does not show in this format so I used bold. The brief exercise prompted by Camus’ first line also shaped the tone:

Mother died today. She keeps dying. Every day, she dies. I resurrect her.

heartbeat.pl

 

#!/usr/bin/perl

#

# Script runs in cron to check for heartbeat syslog messages from Solarwinds

# Send alarm if no alerts in 15 mins

#

 

use Time::Piece;

use Time::Seconds;

 

#if (-e “/scripts/HBFAIL”) {

#exit;

#}

 

open (LOG, “>>/var/log/heartbeat”) or die;

 

#load last messages from syslog and check messages.0 for file rollover

my @msgs = `grep “nc-solar1 %OrionAlertEngine: Heartbeat” /var/log/messages`;

if ($#msgs < 1) {

@msgs = `grep “nc-solar1 %OrionAlertEngine: Heartbeat” /var/log/messages.0`;

}

my $last = pop(@msgs);

chomp $last;

#Sep 19 15:30:46 nc-solar Sep 19 2007 03:31:39 nc-solar %OrionAlertEngine: Heartbeat

#L: Oct  4 21:21:59 nc-solar Oct 04 2007 09:22:42 nc-solar %OrionAlertEngine: Heartbeat

#print “L: $lastn”;

if ($last =~ /^(S+s+d+s+S+)/) {

$sys = $1;

}

else {

$sys = “Jan 01 01:01:01”;

}

#print “Sys: $sysn”;

 

 

my $timenow = localtime(time);

my $yr = $timenow->year;

$sys = $sys . ” ” . $yr;

#print “Sys: $sysn”;

my $lastmsg = Time::Piece->strptime($sys, “%b %d %H:%M:%S %Y”);

#adjust lastmsg for timezone

 

#print “heren”;

$lastmsg = $lastmsg – $timenow->tzoffset;

 

#print “here2n”;

my $secs = $timenow – $lastmsg;

#print “SEC: $secsn”;

 

#print $timenow->epoch;

#print “n”;

#print $lastmsg->epoch;

#print “n”;

 

#print $timenow->strftime().”n”;

#print $timenow->tzoffset.”n”;

#print “$timenow, $lastmsgn”;

#print “Secs: $secsn”;

 

print LOG “############################################n”;

print LOG “Syslog: $lastn”;

print LOG “NOW: $timenow, SYS: $lastmsgn”;

print LOG “Seconds: $secsn”;

 

if ($secs > 900) {

print LOG “HEARTBEAT FAILEDn”;

system(‘echo “HEARTBEAT FAILED” | mail -s “HEARTBEAT FAILED” networkadmin@aicpa.org’);

system(touch /scripts/HBFAIL’);

}

 

close(LOG);

 

 

1 Comment

  1. Trent

    April –
    thanks for taking on a tough subject.
    This is is a novel kind of format, and shows us just how mechanical our surroundings tend to be – procedures, etc.
    The last section is quite effective.

Submit a Comment

Pin It on Pinterest