Juniper Netscreen additons

git-svn-id: http://www.observium.org/svn/observer/trunk@172 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2008-03-19 19:16:16 +00:00
parent c2298401a3
commit 5e925ef03f
55 changed files with 19743 additions and 20 deletions

View File

@@ -19,6 +19,8 @@ function rrdtool_update($rrdfile, $rrdupdate) {
function getHostOS($hostname, $community, $snmpver) {
global $config;
$sysDescr_cmd = "snmpget -O qv -" . $snmpver . " -c " . $community . " " . $hostname . " sysDescr.0";
$sysDescr = str_replace("\"", "", trim(`$sysDescr_cmd`));
$dir_handle = @opendir("includes/osdiscovery") or die("Unable to open $path");
@@ -567,13 +569,13 @@ function createHost ($host, $community, $snmpver){
$host = trim(strtolower($host));
$host_os = getHostOS($host, $community, $snmpver);
global $valid_os;
$nullhost = 1;
#$nullhost = 1;
#echo("$host -> $host_os<br />");
foreach($valid_os as $os) {
if ($os == $host_os) {
#foreach($valid_os as $os) {
# if ($os == $host_os) {
$nullhost = '0';
}
}
# }
#}
if($nullhost == '0' && $host_os) {
$sql = mysql_query("INSERT INTO `devices` (`hostname`, `community`, `os`, `status`) VALUES ('$host', '$community', '$host_os', '1')");
return("Created host : $host ($host_os)");