mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Juniper Netscreen additons
git-svn-id: http://www.observium.org/svn/observer/trunk@172 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -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)");
|
||||
|
Reference in New Issue
Block a user