#!/usr/bin/perl -W

$datetime = `date -u '+%Y%m%d.%H:%M:%S'`;
chomp $datetime;

$sensors = `sensors`;
$sensors =~ /SYS Temp: +([+-][0-9.]+)/;
$sys = $1;
$sensors =~ /CPU Temp: +([+-][0-9.]+)/;
$cpu = $1;

$df = `df -k`;
$hda1u = $hda1f = $hda3u = $hda3f = $hdc1u = $hdc1f = '-';
($hda1u, $hda1f) = ($1, $2) if $df =~ m|/dev/hda1\s+[0-9]+\s+([0-9]+)\s+([0-9]+)|;
($hda3u, $hda3f) = ($1, $2) if $df =~ m|/dev/hda3\s+[0-9]+\s+([0-9]+)\s+([0-9]+)|;
($hdc1u, $hdc1f) = ($1, $2) if $df =~ m|/dev/hdc1\s+[0-9]+\s+([0-9]+)\s+([0-9]+)|;

$ip = `ip -s -o link show eth0`;
$ip =~ /RX:.*?([0-9]+)/;
$rx = $1;
$ip =~ /TX:.*?([0-9]+)/;
$tx = $1;

print "$datetime $sys $cpu $hda1u $hda1f $hda3u $hda3f $hdc1u $hdc1f $rx $tx\n";