Linux-Bulgaria.ORG
навигация

 

начало

пощенски списък

архив на групата

семинари ...

документи

как да ...

 

 

Предишно писмо Следващо писмо Предишно по тема Следващо по тема По Дата По тема (thread)

Re: lug-bg: Pomosht malko za edna "glupost"


  • Subject: Re: lug-bg: Pomosht malko za edna "glupost"
  • From: i.kolemanov@xxxxxxxx (ISM Kolemanov, Ivan)
  • Date: Tue, 2 Jul 2002 17:18:40 +0200



ajde stiga s toq thread,
prikachil sam nqkakav kod deto sam se upraznqval
za obsd e taka che naglasi si komandite
zapishi go primerno kato stats.php

i cheti, cheti, cheti

<?php

$posix_uname = posix_uname ();
$sysname     = $posix_uname['sysname'];
$nodename    = $posix_uname['nodename'];
$release     = $posix_uname['release'];
$version     = $posix_uname['version'];
$machine     = $posix_uname['machine'];
$domainname  = $posix_uname['domainname'];

$posix_times = posix_times ();
$uptime = $posix_times ['ticks'];

echo "<p><b> $sysname $release $version $machine $nodename $domainname
</b><hr> \n";

    if ($HTTP_SERVER_VARS["HTTP_X_FORWARDED_FOR"] != ""){
        $IP = $HTTP_SERVER_VARS["HTTP_X_FORWARDED_FOR"];
        $proxy = $HTTP_SERVER_VARS["REMOTE_ADDR"];
        $host =
@gethostbyaddr($HTTP_SERVER_VARS["HTTP_X_FORWARDED_FOR"]);
    }else{
        $IP = $HTTP_SERVER_VARS["REMOTE_ADDR"];
        $host = @gethostbyaddr($HTTP_SERVER_VARS["REMOTE_ADDR"]);
    }

echo "<p>$HTTP_USER_AGENT Connected from: $host \n";

$today = getdate();
$month =   $today['month']; $mday =    $today['mday'];    $year =
$today['year'];
$hours =   $today['hours']; $minutes = $today['minutes']; $seconds =
$today['seconds'];
$weekday = $today['weekday'];

echo "<p> $mday $month $year $weekday $hours:$minutes:$seconds \n";

//uptime
exec("uptime", $output);
// format each line of output
 print "<pre>";
while (list(,$val) = each($output)) :
 print "$val<br>";
endwhile;
 print "</pre><hr>";

//who -uH /var/log/wtmp
exec("who -uH /var/log/wtmp", $output);
// format each line of output
 print "<pre>";
while (list(,$val) = each($output)) :
 print "$val<br>";
endwhile;
 print "</pre><hr>";

// df
exec("df -h", $output);
// format each line of output
 print "<pre>";
while (list(,$val) = each($output)) :
 print "$val<br>";
endwhile;
 print "</pre><hr>";

// swapctl -lk
exec("swapctl -lk", $output);
// format each line of output
 print "<pre>";
while (list(,$val) = each($output)) :
 print "$val<br>";
endwhile;
 print "</pre><hr>";

// vmstat
exec("vmstat", $output);
// format each line of output
 print "<pre>";
while (list(,$val) = each($output)) :

 print "$val<br>";
endwhile;
 print "</pre><hr>";
exec("vmstat -i", $output);
// format each line of output
 print "<pre>";
while (list(,$val) = each($output)) :
 print "$val<br>";
endwhile;
 print "</pre><hr>";

//netstat  -s -ib -r -q -d
//netstat -f encap -r -q -d
exec("netstat  -s -ib -r -q -d ", $output);
 print "<pre>";
while (list(,$val) = each($output)) :
 print "$val<br>";
endwhile;
exec("netstat -f encap -r -q -d ", $output);
while (list(,$val) = each($output)) :
 print "$val<br>";
endwhile;
 print "</pre><hr>";

// ps -axu -ww -S -m
exec("ps -axu -ww -S ", $output);
// format each line of output
 print "<pre>";
while (list(,$val) = each($output)) :
 print "$val<br>";
endwhile;
 print "</pre><hr>";

$STAT_PAGE = "<html><body>$Output</body></html>";

print $STAT_PAGE;

?>
============================================================================
A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers).
http://www.linux-bulgaria.org - Hosted by Internet Group Ltd. - Stara Zagora
To unsubscribe: http://www.linux-bulgaria.org/public/mail_list.html
============================================================================



 

наши приятели

 

линукс за българи
http://linux-bg.org

FSA-BG
http://fsa-bg.org

OpenFest
http://openfest.org

FreeBSD BG
http://bg-freebsd.org

KDE-BG
http://kde.fsa-bg.org/

Gnome-BG
http://gnome.cult.bg/

проект OpenFMI
http://openfmi.net

NetField Forum
http://netField.ludost.net/forum/

 

 

Linux-Bulgaria.ORG

Mailing list messages are © Copyright their authors.