mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +02:00
hostadding stuff
git-svn-id: http://www.observium.org/svn/observer/trunk@187 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -14,7 +14,6 @@ include("cisco-entities.php");
|
||||
function rrdtool_update($rrdfile, $rrdupdate) {
|
||||
global $rrdtool;
|
||||
return `$rrdtool update $rrdfile $rrdupdate`;
|
||||
|
||||
}
|
||||
|
||||
function getHostOS($hostname, $community, $snmpver) {
|
||||
@@ -551,9 +550,11 @@ function createHost ($host, $community, $snmpver){
|
||||
$host_os = getHostOS($host, $community, $snmpver);
|
||||
if($host_os) {
|
||||
$sql = mysql_query("INSERT INTO `devices` (`hostname`, `community`, `os`, `status`) VALUES ('$host', '$community', '$host_os', '1')");
|
||||
return("Created host : $host ($host_os)");
|
||||
if(mysql_affected_rows()) {
|
||||
return("Created host : $host ($host_os)");
|
||||
} else { return FALSE; }
|
||||
} else {
|
||||
return("Not added bad host : $host");
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user