fix awplus ntp polling bug (#14521)

tries to count an integer :/
This commit is contained in:
Tony Murray
2022-10-26 20:47:46 +02:00
committed by GitHub
parent 0470b03456
commit 0dd183f1e1
+2 -3
View File
@@ -20,13 +20,12 @@ $options = [];
$options['filter']['type'] = ['=', $tmp_module];
$options['filter']['disabled'] = ['=', 0];
$options['filter']['ignore'] = ['=', 0];
$components = $component->getComponents($device['device_id'], $options);
// We only care about our device id.
$components = $components[$device['device_id']];
$components = $component->getComponents($device['device_id'], $options)[$device['device_id']] ?? null;
// Only collect SNMP data if we have enabled components
if (count($components > 0)) {
if ($components) {
// Let's gather the stats..
$atNtpAssociationEntry = snmpwalk_group($device, 'atNtpAssociationEntry', 'AT-NTP-MIB');