From f8f895e5b1160ab3816974cc67272dd63e2bcd55 Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Fri, 26 Feb 2016 08:04:38 -0600 Subject: [PATCH] Make sure port_assoc_mode is an int before inserting a device into the db. fixes #3090 --- includes/functions.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/functions.php b/includes/functions.php index 9eb9f2ee99..37fb4201cf 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -582,6 +582,11 @@ function createHost($host, $community = NULL, $snmpver, $port = 161, $transport $poller_group=getpollergroup($poller_group); + /* Get port_assoc_mode id if neccessary + * We can work with names of IDs here */ + if (! is_int ($port_assoc_mode)) + $port_assoc_mode = get_port_assoc_mode_id ($port_assoc_mode); + $device = array('hostname' => $host, 'sysName' => $host, 'community' => $community,