#!/usr/bin/perl
 
$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`;
$df =~ m|/dev/hda1\s+[0-9]+\s+([0-9]+)\s+([0-9]+)|;
$hda1u = $1; $hda1f = $2;
$df =~ m|/dev/hda3\s+[0-9]+\s+([0-9]+)\s+([0-9]+)|;
$hda3u = $1; $hda3f = $2;
$df =~ m|/dev/hdc1\s+[0-9]+\s+([0-9]+)\s+([0-9]+)|;
$hdc1u = $1; $hdc1f = $2;

$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";