Regex in snmptd probe not working as expected
search cancel

Regex in snmptd probe not working as expected

book

Article ID: 44056

calendar_today

Updated On:

Products

DX Unified Infrastructure Management (Nimsoft / UIM)

Issue/Introduction

I am trying to generate an alarm when a PDU Variable Comparison Rule, within a snmptd profile, is matched using the Regex operator.

When the trap is received, the alarm is not generated even if I’m expecting the variable condition is met.

 

 

Environment

Release: UIM 8.x or later

snmptd any version

Cause

The regex does not match the variable.

Resolution

Ensure you enclose the regex between “/” and “/”

 

Example:

 

-          Alarm comes in with variable “New alarm”

 

Bad Regex:

New.*

 

Good Regex:

/New.*/

 

Additional Information

Regex tested and debugger (online free tool): https://regex101.com/