mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Updated function name for blahdeblah
This commit is contained in:
@@ -243,7 +243,7 @@ function addHost($host, $snmpver, $port = '161', $transport = 'udp', $quiet = '0
|
|||||||
|
|
||||||
list($hostshort) = explode(".", $host);
|
list($hostshort) = explode(".", $host);
|
||||||
// Test Database Exists
|
// Test Database Exists
|
||||||
if (dup_host_check($host) === false) {
|
if (host_exists($host) === false) {
|
||||||
if ($config['addhost_alwayscheckip'] === TRUE) {
|
if ($config['addhost_alwayscheckip'] === TRUE) {
|
||||||
$ip = gethostbyname($host);
|
$ip = gethostbyname($host);
|
||||||
} else {
|
} else {
|
||||||
@@ -583,7 +583,7 @@ function createHost($host, $community = NULL, $snmpver, $port = 161, $transport
|
|||||||
|
|
||||||
if ($device['os']) {
|
if ($device['os']) {
|
||||||
|
|
||||||
if (dup_host_check($host) === false) {
|
if (host_exists($host) === false) {
|
||||||
$device_id = dbInsert($device, 'devices');
|
$device_id = dbInsert($device, 'devices');
|
||||||
if ($device_id) {
|
if ($device_id) {
|
||||||
return($device_id);
|
return($device_id);
|
||||||
@@ -1269,7 +1269,7 @@ function snmpTransportToAddressFamily($transport) {
|
|||||||
* @return bool true if hostname already exists
|
* @return bool true if hostname already exists
|
||||||
* false if hostname doesn't exist
|
* false if hostname doesn't exist
|
||||||
**/
|
**/
|
||||||
function dup_host_check($hostname) {
|
function host_exists($hostname) {
|
||||||
$count = dbFetchCell("SELECT COUNT(*) FROM `devices` WHERE `hostname` = ?", array($hostname));
|
$count = dbFetchCell("SELECT COUNT(*) FROM `devices` WHERE `hostname` = ?", array($hostname));
|
||||||
if ($count > 0) {
|
if ($count > 0) {
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user