#!/usr/bin/perl if ($> != 0) { print "You must run this command as root.\n"; exit(1); } if ($#ARGV < 0) { print "Syntax: $0 $basepath-$commandwithoutwhitespace") || die("Could not create $basepath-$commandwithoutwhitespace"); print TMP `$command`; close(TMP); push(@created,"$basepath-$commandwithoutwhitespace"); } sub generate_html_index { my $index = "\n\n

$basepath

\n"; foreach my $file (@created) { $index .= "$file

\n"; } $index .= "Generated: " . `date "+%Y-%m-%d %H:%M:%S %z"` . " on " . `hostname`; $index .= "\n\n"; open(TMP,">$basepath-index.html"); print TMP $index; close(TMP); } sub upload { return if (!$upload); `scp -C -p -P$port $basepath-* $user\@$server:$spath`; print "$baseurl/$basepath-index.html\n"; } &run("uname -a"); &run("cat /etc/lsb-release"); &run("dmesg"); &run("lspci"); &run("lspci -vvvvvxxxxxx"); &run("cat /proc/cpuinfo"); &run("cat /proc/meminfo"); &run("cat /proc/interrupts"); &run("cat /proc/mtrr"); &run("cat /proc/ioports"); &run("cat /proc/iomem"); &run("acpidump"); &generate_html_index(); &upload();