Location: PHPKode > projects > Network Asset Management Archive > nama/uptimes.php
<?php
$now = date("m/j/y h:i:s",time());
include "connect.php";
$stmt = "Select * FROM routers order by IP_ADDRESS;";
$sth = ibase_query($dbh, $stmt);
while ($row = ibase_fetch_object($sth)) {
//$myjunk = snmpwalk($row->IP_ADDRESS, "nonpub",".1.3.6.1.2.1.4.22.1.2");

$host = $row->IP_ADDRESS;
$community = "nonpub";
$sysDescr = snmpget("$host","$community","system.sysDescr.0");
$ifDescr = snmpwalk("$host","$community","interfaces.ifTable.ifEntry.ifDescr");
$ifIndex = snmpwalk("$host","$community","interfaces.ifTable.ifEntry.ifIndex");
$ifAdminStatus = snmpwalk("$host","$community","interfaces.ifTable.ifEntry.ifAdminStatus");
$ifOperStatus = snmpwalk("$host","$community","interfaces.ifTable.ifEntry.ifOperStatus");
$ifLastChange = snmpwalk("$host","$community","interfaces.ifTable.ifEntry.ifLastChange");
print '<body bgcolor="#FFFFCC" text="#000000">';                                         
print "<table border=1 bgcolor=#ffffcc><tr><td><b>$row->ROUTER</b></td><td>$host</td>";
print "<td>$sysDescr</td></tr></table>";
print "<table border=1 bgcolor=#ffffcc>";
print "<tr> 
       <td>ifIndex</td>
       <td>ifDescr</td>
       <td>ifAdminStatus</td>
       <td>ifOperStatus</td>
       <td>ifLastChange</td>
       </tr>";
            
for ($i=0; $i<count($ifIndex); $i++) {
       print "<tr>";
       print "<td>$ifIndex[$i]</td>";
       print "<td>$ifDescr[$i]</td>";
       print "<td>$ifAdminStatus[$i]</td>";
       print "<td>$ifOperStatus[$i]</td>";
       print "<td>$ifLastChange[$i]</td>";
       print "</tr>";
}            
print "</table>";

}
ibase_free_result($sth);
ibase_close($dbh);
?>

Return current item: Network Asset Management Archive