← Back to team overview

sslug-teknik team mailing list archive

Er du bare lidt nysgerrig over hvad din server laver?

 

Hej,

Jeg er jo lidt af den nysgerrige type der gerne vil vide hvad min maskine laver. Derfor har jeg lavet et lille script som i allesammen gerne må hapse.

Ideen er at hurtigt at få et overblik over systemets status ligemeget hvor i verdenen du er sammen med din browser...

I kan allesammen se på min maskine på  adressen:
http://sweetie.lostinlove.dk/status/
login: test
pass: 1234

Linie ombrydningen i denne mail vil nok fucke lidt i scriptet - men brude lige være nemt at rette tilbage.. :-)

Mvh Stefan
--cut--
#!/usr/bin/perl
print "content-type: text/html\n\n";
print "<html><pre>";
 
 
 
 
print "\n\n\n<a name=\"system\"><h1>System</h1></a><hr>";
 
system("w > /tmp/w.tmp");
system("cat /proc/meminfo > /tmp/free.tmp");
system("df > /tmp/df.tmp");
system("ps -axf > /tmp/ps.tmp");
 
print "<a name=\"sys-w\">"; $fil = "/tmp/w.tmp"; open(fil, "$fil");
print <fil>; close(fil); print "</a><hr>";
print "<a name=\"sys-mem\">"; $fil = "/tmp/free.tmp"; open(fil, "$fil"); print <
fil>; close(fil); print "</a><hr>";
print "<a name=\"sys-dis\">";$fil = "/tmp/df.tmp"; open(fil, "$fil"); print <fil
>; close(fil); print "</a><hr>";
print "<a name=\"sys-pro\">";$fil = "/tmp/ps.tmp"; open(fil, "$fil"); print <fil
>; close(fil); print "</a><hr>";
 
print "\n\n\n<a name=\"network\"><h1>Netværk Status</h1></a><hr>";
 
system("ifconfig > /tmp/ifconfig.tmp");
print "<a name=\"net-ifc\">";$fil = "/tmp/ifconfig.tmp"; open(fil, "$fil"); prin
t <fil>; close(fil); print "</a><hr>";
 
system("netstat > /tmp/netstat.tmp");
print "<a name=\"net-sta\">";$fil = "/tmp/netstat.tmp"; open(fil, "$fil"); print
 <fil>; close(fil); print "</a><hr>";
 
system("netstat -s -N > /tmp/netstat.tmp");
print "<a name=\"net-st2\">";$fil = "/tmp/netstat.tmp"; open(fil, "$fil"); print
 <fil>; close(fil); print "</a><hr>";
 
print "\n\n<hr><a name=\"printer\"><h1>Printer status</h1></a>";
system("lpc status > /tmp/lpc.tmp");
print "<a name=\"prn-lpc\">";$fil = "/tmp/lpc.tmp"; open(fil, "$fil"); print <fi
l>; close(fil); print "<hr>";
 
print "</html></pre>";
 





Follow ups