mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Don't update ospf stats if there are none. (#9133)
Also fixes fatal error ->count() on null.
This commit is contained in:
committed by
Neil Lathwood
parent
30790bafd1
commit
0f0ae34d77
@@ -142,6 +142,7 @@ foreach ($vrfs_lite_cisco as $vrf_lite) {
|
|||||||
|
|
||||||
unset($device['context_name'], $vrfs_lite_cisco, $vrf_lite);
|
unset($device['context_name'], $vrfs_lite_cisco, $vrf_lite);
|
||||||
|
|
||||||
|
if ($instance_count) {
|
||||||
// Create device-wide statistics RRD
|
// Create device-wide statistics RRD
|
||||||
$rrd_def = RrdDefinition::make()
|
$rrd_def = RrdDefinition::make()
|
||||||
->addDataset('instances', 'GAUGE', 0, 1000000)
|
->addDataset('instances', 'GAUGE', 0, 1000000)
|
||||||
@@ -158,6 +159,7 @@ $fields = [
|
|||||||
|
|
||||||
$tags = compact('rrd_def');
|
$tags = compact('rrd_def');
|
||||||
data_update($device, 'ospf-statistics', $tags, $fields);
|
data_update($device, 'ospf-statistics', $tags, $fields);
|
||||||
|
}
|
||||||
|
|
||||||
echo PHP_EOL;
|
echo PHP_EOL;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user