#!/opt/bin/perl -w

use lib '/pub/rrd/lib';
use OwfsSensors;

my $rokgas  = OwfsSensors::temp("rokgas");
my $stigare = OwfsSensors::temp("stigare");
my $msg     = "Rökgastemperatur: $rokgas\nStigaretemperatur: $stigare";

if (($rokgas < 50) && ($stigare < 25)) {
  system("echo \"$msg\" \| mail -s \"PX21 is down!\" XXX\@YYY.com");
}