syslog ("warning", "pl_mom: Resetting slice $hog");
if (! $debug) {
slice_reset($hog);
}
syslog ("warning", "pl_mom: Sending mail to slice $hog");
syslog ("warning", "pl_mom: Resetting slice $hog");
if (! $debug) {
slice_reset($hog);
}
syslog ("warning", "pl_mom: Sending mail to slice $hog");
= localtime(time);
my $date = sprintf("%4d-%02d-%02d %02d:%02d:%02d",
$year+1900, $mon+1, $mday, $hour, $min, $sec);
= localtime(time);
my $date = sprintf("%4d-%02d-%02d %02d:%02d:%02d",
$year+1900, $mon+1, $mday, $hour, $min, $sec);
my $subject = "Subject: $proc rebooted $hostname\n";
my $msg ="Swap space was exhausted on $hostname and so $proc rebooted ".
"it.\n\nAs of $date, the node has successfully come back online.\n".
my $subject = "Subject: $proc rebooted $hostname\n";
my $msg ="Swap space was exhausted on $hostname and so $proc rebooted ".
"it.\n\nAs of $date, the node has successfully come back online.\n".
my $hog_mem = sprintf ("%0.f", $Slice{$hog}{pmem}/1000);
my $hog_pct = $Slice{$hog}{mem_pct};
my $hostname = hostname();
my $hog_mem = sprintf ("%0.f", $Slice{$hog}{pmem}/1000);
my $hog_pct = $Slice{$hog}{mem_pct};
my $hostname = hostname();
= localtime(time);
my $date = sprintf("%4d-%02d-%02d %02d:%02d:%02d",
$year+1900, $mon+1, $mday, $hour, $min, $sec);
= localtime(time);
my $date = sprintf("%4d-%02d-%02d %02d:%02d:%02d",
$year+1900, $mon+1, $mday, $hour, $min, $sec);
- my $to = "To: $alias\@planet-lab.org, $hog\@slices.planet-lab.org\n";
- my $from = "From: support\@planet-lab.org\n";
- my $subject = "Subject: $proc resetting slice $hog on $hostname\n";
+ my $to = "To: $alias_addr, $hog\@slices.planet-lab.org\n";
+ my $from = "From: $from_addr\n";
+ my $subject = "Subject: $proc reset slice $hog on $hostname\n";
my $msg = "As of $date, swap space is nearly exhausted on $hostname.\n\n".
"Slice $hog is being reset since it is the largest consumer ".
"of physical memory at ${hog_mem}MB ($hog_pct%).\n\n".
"Please reply to this message explaining the nature of your ".
"experiment, and what you are doing to address the problem.\n".
my $msg = "As of $date, swap space is nearly exhausted on $hostname.\n\n".
"Slice $hog is being reset since it is the largest consumer ".
"of physical memory at ${hog_mem}MB ($hog_pct%).\n\n".
"Please reply to this message explaining the nature of your ".
"experiment, and what you are doing to address the problem.\n".
$year+1900, $mon+1, $mday, $hour, $min, $sec);
if ($hog =~ /^root$/) {
$year+1900, $mon+1, $mday, $hour, $min, $sec);
if ($hog =~ /^root$/) {
my $subject = "Subject: $proc may reset slice $hog on $hostname\n";
my $msg = "As of $date, swap space is over $log_thresh% full on ".
"$hostname.\n\nSlice $hog is the largest consumer ".
my $subject = "Subject: $proc may reset slice $hog on $hostname\n";
my $msg = "As of $date, swap space is over $log_thresh% full on ".
"$hostname.\n\nSlice $hog is the largest consumer ".
$year+1900, $mon+1, $mday, $hour, $min, $sec);
if ($hog =~ /^root$/) {
$year+1900, $mon+1, $mday, $hour, $min, $sec);
if ($hog =~ /^root$/) {
my $subject = "Subject: $proc: alarm for slice $hog on $hostname\n";
my $msg = "As of $date, swap space is over $log_thresh% full on ".
"$hostname.\n\nSlice $hog is the largest consumer ".
my $subject = "Subject: $proc: alarm for slice $hog on $hostname\n";
my $msg = "As of $date, swap space is over $log_thresh% full on ".
"$hostname.\n\nSlice $hog is the largest consumer ".