hostadding stuff

git-svn-id: http://www.observium.org/svn/observer/trunk@187 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2008-03-22 15:18:15 +00:00
parent 18accc6541
commit f77d294b6c
2 changed files with 6 additions and 4 deletions
+4 -3
View File
@@ -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;
}
}