mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
Plugin unifi_api: handle missing error fields in response
It seems to be possible, that the response lacks the values for `rx_errors` and `tx_errors`. This should not result in warnings due to undefined values. Thanks, kboenke! Closes: #1095
This commit is contained in:
parent
83737c4fe0
commit
bd1302c3f2
1 changed files with 2 additions and 2 deletions
|
@ -1033,7 +1033,7 @@ sub make_data {
|
|||
'label' => $label . '-' . $thisDevice->{'name'},
|
||||
'pckt' => $_->{$name . '-rx_packets'} + $_->{$name . '-tx_packets'},
|
||||
'dret' => $_->{$name . '-rx_dropped'} + $_->{$name . '-tx_retries'} + $_->{$name . '-tx_dropped'},
|
||||
'err' => $_->{$name . '-rx_errors'} + $_->{$name . '-tx_errors'},
|
||||
'err' => ($_->{$name . '-rx_errors'} || 0) + ($_->{$name . '-tx_errors'} || 0),
|
||||
'type' => $label
|
||||
};
|
||||
}
|
||||
|
@ -1209,4 +1209,4 @@ sub env_default_bool_true {
|
|||
}
|
||||
|
||||
# Quick 2 digit zero pad
|
||||
sub zPad { return sprintf("%02d", $_[0]); }
|
||||
sub zPad { return sprintf("%02d", $_[0]); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue