rendered paste body<? function Uptime_S($n){ if ($n != 1) return "s"; else return ""; } function Uptime_Hours($h){ $Hours = (int) $h . " Hour"; $Hours .= Uptime_S($h); return $Hours; } function Uptime_Mins($m){ $Mins = (int) $m . " Minute"; $Mins .= Uptime_S($m); return $Mins; } function Uptime(){ $tmp = split(" ", str_replace(" ", " ", trim(`/usr/bin/uptime`))); for ($i = (int) 3; $i <= 5; $i++){ $t = strtolower(str_replace(",", "", $tmp[$i])); $t = str_replace("s", "", $t); if ($t == "day"){ $Days = (int) $tmp[$i - 1] . " Day"; $Days .= Uptime_S((int) $tmp[$i - 1]); } if ($t == "min"){ $Hours = "0 Hours"; $Mins = Uptime_Mins((int) $tmp[$i - 1]); } if (strpos($t, ":")){ $tm = split(":", $t); $Hours = Uptime_Hours((int) $tm[0]); $Mins = Uptime_Mins((int) $tm[1]); } } return (string) "$Days, $Hours, $Mins"; } echo exec("ifconfig eth0 | grep bytes | awk '{ print $1,$2,$3,$4,$5,$6,$7,$8}'");echo "<br>Mount /: " . round((disk_free_space("/") / 1024 /1024 /1024 ),2) . " GB free<br>" ;echo "Mount /www: ". round((disk_free_space("/www") / 1024 /1024 /1024 ),2) . " GB free<br>" ;echo "Mount /home: ". round((disk_free_space("/home") / 1024 /1024 /1024 ),2) . " GB free<br>" ;echo "Server Uptime :" . Uptime();//echo "<br>Session id:" . session_id();echo "<hr color=white><table width=100% padding=0 class=nav>";$a = explode(" ",snmpget("192.168.2.149", "public", "sysUpTime.0"));echo "<br>Switch Uptime $a[2] $a[3] $a[4]";$x=1;while ($x < 25){flush();$a = explode("(", snmpget("192.168.2.149", "public", "ifOperStatus.$x"));$b = explode(" ",$a[0]);$font = "<b><font color=#FF0000>";if (preg_match("/up/i", $b[1])) { $font = "<b><font color=#00FF00>";}$b[1]=strtoupper($b[1]);echo "<tr><td bgcolor=#333333 style='background: url(div_top.jpg) ;repeat-x;'>Port #: <font color=yellow><b>$x </td><td bgcolor=#333333 style='background: url(div_top.jpg) ;repeat-x;'>Link state: $font $b[1]</td></tr>";echo "<tr><td bgcolor=#777973>Rx stats</td><td bgcolor=#777973>Tx stats</td></tr>";$a = explode(" ",snmpget("192.168.2.149", "public", "mib-2.17.4.4.1.3.$x"));echo "<tr><td>Packets Σ: $a[1]</td>";$a = explode(" ",snmpget("192.168.2.149", "public", "mib-2.17.4.4.1.4.$x"));echo "<td>Packets Σ: $a[1]</td></tr>";$a = explode(" ",snmpget("192.168.2.149", "public", "ifInOctets.$x"));echo "<tr><td>Octets: $a[1]</td>";$a = explode(" ",snmpget("192.168.2.149", "public", "ifOutOctets.$x"));echo "<td>Octets: $a[1]</td></tr>";$a = explode(" ",snmpget("192.168.2.149", "public", "transmission.7.2.1.3.$x"));echo "<tr><td>FCS errors: $a[1]</td>";$a = explode(" ",snmpget("192.168.2.149", "public", "ifOutErrors.$x"));echo "<td>Collisions: $a[1]</td></tr>";$a = explode(" ",snmpget("192.168.2.149", "public", "transmission.7.2.1.2.$x"));echo "<tr><td>Frame errors: $a[1]</td>";$a = explode(" ",snmpget("192.168.2.149", "public", "mib-2.17.4.4.1.3.$x"));echo "<td></td></tr>";$a = explode(" ",snmpget("192.168.2.149", "public", "mib-2.16.1.1.1.9.$x"));echo "<tr><td>Undersized packets: $a[1]</td>";$a = explode(" ",snmpget("192.168.2.149", "public", "mib-2.17.4.4.1.3.$x"));echo "<td></td></tr>";$a = explode(" ",snmpget("192.168.2.149", "public", "mib-2.16.1.1.1.10.$x"));echo "<tr><td>Oversized packets: $a[1]</td>";$a = explode(" ",snmpget("192.168.2.149", "public", "mib-2.17.4.4.1.3.$x"));echo "<td></td></tr>";$a = explode(" ",snmpget("192.168.2.149", "public", "mib-2.17.4.4.1.5.$x"));echo "<tr><td>Filtered packets: $a[1]</td>";$a = explode(" ",snmpget("192.168.2.149", "public", "mib-2.17.4.4.1.3.$x"));echo "<td></td></tr>";$x++;}echo "</table>";?>