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
============================================================================

Reply via email to