mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix: update any IP fields using inet6_ntop() #5207
This commit is contained in:
committed by
Neil Lathwood
parent
c257332ef8
commit
8352a3a000
@ -185,6 +185,13 @@ function RunFollowUp()
|
||||
$alert['query'] = GenSQL($alert['rule']);
|
||||
}
|
||||
$chk = dbFetchRows($alert['query'], array($alert['device_id']));
|
||||
//make sure we can json_encode all the datas later
|
||||
$cnt = count($chk);
|
||||
for ($i = 0; $i < $cnt; $i++) {
|
||||
if (isset($chk[$i]['ip'])) {
|
||||
$chk[$i]['ip'] = inet6_ntop($chk[$i]['ip']);
|
||||
}
|
||||
}
|
||||
$o = sizeof($alert['details']['rule']);
|
||||
$n = sizeof($chk);
|
||||
$ret = 'Alert #'.$alert['id'];
|
||||
|
@ -171,8 +171,11 @@ function RunRules($device)
|
||||
}
|
||||
$sql = $rule['query'];
|
||||
$qry = dbFetchRows($sql, array($device));
|
||||
if (isset($qry[0]['ip'])) {
|
||||
$qry[0]['ip'] = inet6_ntop($qry[0]['ip']);
|
||||
$cnt = count($qry);
|
||||
for ($i = 0; $i < $cnt; $i++) {
|
||||
if (isset($qry[$i]['ip'])) {
|
||||
$qry[$i]['ip'] = inet6_ntop($qry[$i]['ip']);
|
||||
}
|
||||
}
|
||||
$s = sizeof($qry);
|
||||
if ($s == 0 && $inv === false) {
|
||||
|
Reference in New Issue
Block a user