当我尝试编程我的snmp然后应用于CodeIgniter框架时,我无法显示它
wx.ListCtrls
控制器中文件夹的内容
this is my code
<?php foreach($monitor as $mnt){ ?>
<?php
// Set Variables:
mysql_connect("localhost","root","") or die (mysql_error());
mysql_select_db("monitor") or die (mysql_error());
$hasil = mysql_query("SELECT * FROM device") or die (mysl_error());
$row = mysql_fetch_array($hasil);
// Clean output function - Removes the extras given by SNMP
function clean_output($string) {
$clean_output = preg_replace("/[A-Za-z]*:[ ]/", "", $string);
$clean_output = preg_replace("/[(][0-9]*[)][ ]/", "", $clean_output);
$clean_output = str_replace("Gauge32", "", $clean_output);
$clean_output = str_replace("Counter32", "", $clean_output);
$clean_output = preg_replace("/[(][0-9][)]/", "", $clean_output);
return $clean_output;
}
// Create specific OIDs
$sysUptime = "1.3.6.1.2.1.1.3.0";
# Check that we are able to contact the system, If we are then run the rest of the SNMP gets.
$oo8 = clean_output(snmpget($row['host'],$row['comm'],$sysUptime));
if($oo8 != "") {
// Now we know that we can contact the device, run the other SNMP gets.
$oo8 = clean_output(snmpget($row['host'],$row['comm'],$sysUptime));
}
// Show the System stats at the start of the table.
echo "<center><br><b>Uptime:</b></br></center><center> $oo8</center>";
?>
<?php } ?>