Skip to content

Bug: SNMP warning/normal trap flags inverted — fires opposite of config #743

@somethingwithproof

Description

@somethingwithproof

Summary

In thold_functions.php (lines 2269-2270), the SNMP warning and normal trap flags use != instead of ==:

$thold_snmp_warning_traps = (read_config_option('thold_alert_snmp_warning') != 'on');
$thold_snmp_normal_traps  = (read_config_option('thold_alert_snmp_normal')  != 'on');

!= 'on' means both flags are true when the option is disabled and false when enabled. Every if ($thold_snmp_traps && $thold_snmp_warning_traps) gate fires when the admin turned warnings off, and does not fire when they turned it on.

The main alert flag $thold_snmp_traps uses == 'on' correctly. This is a copy-paste inversion.

Fix

Change != to == for both lines.

Impact

All three threshold type branches. Every installation using SNMP traps for warning/normal events.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions