mirror of
https://github.com/librenms/librenms.git
synced 2024-09-21 10:28:13 +00:00
port_error_perc macro (#15016)
* port_error_perc * Update macros.json * Update macros.json * Update querybuilder.json * Revert * Update macros.json * Change macro names so they match usage_perc * Try *100.0 * Attempt 2 - Encapsulate in parenthesis * Undo Parenthesis * Trying laf's suggestions * Update QueryBuilderFilter.php
This commit is contained in:
parent
c030b0c00e
commit
90b16bab81
@ -70,7 +70,7 @@ class QueryBuilderFilter implements \JsonSerializable
|
||||
continue; // don't include the time based macros, they don't work like that
|
||||
}
|
||||
|
||||
if (Str::endsWith($key, '_usage_perc') || Str::startsWith($key, 'packet_loss_')) {
|
||||
if (Str::endsWith($key, '_perc') || Str::startsWith($key, 'packet_loss_')) {
|
||||
$this->filter[$field] = [
|
||||
'id' => $field,
|
||||
'type' => 'integer',
|
||||
|
@ -20,6 +20,8 @@
|
||||
"past_30m": "DATE_SUB(NOW(),INTERVAL 30 MINUTE)",
|
||||
"past_60m": "DATE_SUB(NOW(),INTERVAL 60 MINUTE)",
|
||||
"port": "(%ports.deleted = 0 && %ports.ignore = 0 && %ports.disabled = 0)",
|
||||
"port_out_error_perc": "((%ports.ifOutErrors_rate) \/ %ports.ifOutUcastPkts_rate)*100",
|
||||
"port_in_error_perc": "((%ports.ifInErrors_rate) \/ %ports.ifInUcastPkts_rate)*100",
|
||||
"port_down": "(%ports.ifOperStatus = \"down\" && %ports.ifAdminStatus != \"down\" && %macros.port)",
|
||||
"port_up": "(%ports.ifOperStatus = \"up\" && %ports.ifAdminStatus = \"up\" && %macros.port)",
|
||||
"port_usage_perc": "((SELECT IF(%ports.ifOutOctets_rate>%ports.ifInOctets_rate, %ports.ifOutOctets_rate, %ports.ifInOctets_rate)*8) \/ %ports.ifSpeed)*100",
|
||||
|
Loading…
Reference in New Issue
Block a user