mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Couple more mysql strict fixes
This commit is contained in:
@@ -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 ";
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user