Ad Widget

Collapse

Varying thresholds using template macros. - Cisco IOS/IOSX

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dkgame
    Junior Member
    • Feb 2022
    • 6

    #1

    Varying thresholds using template macros. - Cisco IOS/IOSX

    I've noticed that in the default Cisco IOS by SNMP templated, there are two Macros

    {$TEMP_CRIT}
    {$TEMP_WARN}

    set at 70 and 60 degrees each

    What I also see is {$TEMP_CRIT:"CPU"} and a corresponding WARN threshold which is different (80 and 70) which I presume is a separate one so when a sensor named "CPU 1 Temperature" or similar is discovered, it's that threshold that applies.

    Now...

    On some Cisco gear there are other temperature sensors that have different thresholds - the HotSpot and the EARL (Environmental Alarm) sensors.

    I figured, therefore, that

    {$TEMP_CRIT:"EARL"} set to 125
    {$TEMP_CRIT:"HotSpot"} set to 90
    would then check the Sensor name and if it saw EARL or HotSpot in the name, then that threshold would apply. It doesn't - and the default (too low) threshold kicks in, and triggers alarms.

    How would I set up these macros correctly so that for something like "Chassis Module 2 EARL 1" would have the 125 threshold applied, or the "Switch 3 HotSpot Temperature Sensor" item would have the 90 threshold applied please?

    Is that RegEx after the colon/: or is there some other weird character combination I'd need to use?

    Thanks!
  • Answer selected by dkgame at 09-10-2024, 12:09.
    dkgame
    Junior Member
    • Feb 2022
    • 6

    Ah! Fixed it..

    {$TEMP_CRIT:regex:"(?:EARL)"}
    {$TEMP_CRIT:regex:"(?:HotSpot)"}

    is doing what I want

    Comment

    • dkgame
      Junior Member
      • Feb 2022
      • 6

      #2
      Ah! Fixed it..

      {$TEMP_CRIT:regex:"(?:EARL)"}
      {$TEMP_CRIT:regex:"(?:HotSpot)"}

      is doing what I want

      Comment

      Working...