Cisco QFP polling fixes (#14961)

* fix cisco-qfp Division by zero

* fix percentage calc

* linting

* another zero in RRD. the (int) might be consequential errors and should hurt...

* no float for average_package

* Update includes/polling/cisco-qfp.inc.php

Co-authored-by: Tony Murray <murraytony@gmail.com>

* Add floor

---------

Co-authored-by: Tony Murray <murraytony@gmail.com>
This commit is contained in:
Stef
2023-04-15 05:11:36 +02:00
committed by GitHub
parent b6572e0acc
commit 0430f6acb1
3 changed files with 4 additions and 3 deletions

View File

@@ -33,7 +33,7 @@ if ($width > '500') {
$descr = \LibreNMS\Data\Store\Rrd::fixedSafeDescr(short_hrDeviceDescr($components['name']), $descr_len);
$perc = $components['memory_used'] * 100 / $components['memory_total'];
$perc = \LibreNMS\Util\Number::calculatePercent((int) $components['memory_used'], (int) $tmp_component['memory_total']);
$background = \LibreNMS\Util\Color::percentage($perc, 75);