#!/usr/bin/perl
#
$machine="server.aconus.com";
# ホスト名
$smart=`/usr/sbin/smartctl -a /dev/hda`; # ATA(IDE)用smartctlコマンド
#$smart=`/usr/sbin/smartctl -i -d ata -a /dev/hda`; # SATA用smartctlコマンド
@smart = split(/\n/, $smart);
foreach $data (@smart){
if($data =~ /Temperature_Celsius(.*?)0x(\d+)(.*?)(\d+)(.*?)(\d+)(.*?)(\d+)(.*?)(\d+)/){
$temp = $10;
}
}
$utime = `uptime`;
$utime =~ /up(.*?),/;
$uptime = $1;
$uptime =~ s/^\s*//g;
print "$temp\n";
print "$temp\n";
# Print uptime
print "$uptime\n";
# Print machine name for mrtg
print "$machine\n";
exit;