diff --git a/includes/alerts.inc.php b/includes/alerts.inc.php index f223b5991b..1d5c5c91ce 100644 --- a/includes/alerts.inc.php +++ b/includes/alerts.inc.php @@ -261,7 +261,7 @@ function RunRules($device) { $extra = gzcompress(json_encode(array('contacts' => GetContacts($qry), 'rule'=>$qry)),9); if( dbInsert(array('state' => 1, 'device_id' => $device, 'rule_id' => $rule['id'], 'details' => $extra),'alert_log') ) { if( !dbUpdate(array('state' => 1, 'open' => 1),'alerts','device_id = ? && rule_id = ?', array($device,$rule['id'])) ) { - dbInsert(array('state' => 1, 'device_id' => $device, 'rule_id' => $rule['id'], 'open' => 1),'alerts'); + dbInsert(array('state' => 1, 'device_id' => $device, 'rule_id' => $rule['id'], 'open' => 1,'alerted' => 0),'alerts'); } echo " ALERT "; } @@ -274,7 +274,7 @@ function RunRules($device) { else { if( dbInsert(array('state' => 0, 'device_id' => $device, 'rule_id' => $rule['id']),'alert_log') ){ if( !dbUpdate(array('state' => 0, 'open' => 1),'alerts','device_id = ? && rule_id = ?', array($device,$rule['id'])) ) { - dbInsert(array('state' => 0, 'device_id' => $device, 'rule_id' => $rule['id'], 'open' => 1),'alerts'); + dbInsert(array('state' => 0, 'device_id' => $device, 'rule_id' => $rule['id'], 'open' => 1, 'alerted' => 0),'alerts'); } echo " OK "; } diff --git a/includes/functions.php b/includes/functions.php index 13498595b4..10499c0864 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -583,7 +583,8 @@ function createHost($host, $community = NULL, $snmpver, $port = 161, $transport 'transport' => $transport, 'status' => '1', 'snmpver' => $snmpver, - 'poller_group' => $poller_group + 'poller_group' => $poller_group, + 'status_reason' => '', ); $device = array_merge($device, $v3);