Devmon exception template to alarm only if ifAliasBox contains string "uplink" (for Xymon)

0

to monitor my network I use Xymon with Devmon SNMP crawler. Devmon is a perl program for extracting and interpreting data received from SMNP capable devices. Therefor templates are used for each device type/switch model. Can you please help me to form a exception template for cisco switches? I'm looking for a template which should show all interfaces in the list (if_stat column), but xymon should only trigger alerts, if one of the uplink interfaces goes down. All other ports are client access ports and if someone powers off his computer, the port should not become red in Xymon.

I tried a lot of regex, but had no success. Unfortunately I'm not very familiar with those expressions, so I'm forced to approach using trial an error. So here is, what comes next to that, what i want, but as mentioned, it does not work:

ifAliasBox : alarm : .*uplink.*
ifAliasBox : noalarm : ((?!uplink).)*
ifName : ignore : Nu.+|Vl.+|Fa.+

A bonus feature would be, if the exclude statement could be multiple values, e.g.:

ifAliasBox : noalarm : ((?!uplink|Stack).)*

These are my tries which did not work:

ifAliasBox : noalarm : ((?!uplink).)*
ifAliasBox : noalarm : .*((?!uplink).)*
ifAliasBox : noalarm : .*((?!uplink).).*
ifAliasBox : noalarm : (?:(?!uplink).)*
ifAliasBox : noalarm : ^((?!uplink).)*$
ifAliasBox : noalarm : ^(?:(?!uplink).)*$
ifAliasBox : noalarm : ^(.(?!" + uplink + "))*$
ifAliasBox : noalarm : ^(.*(?!" + uplink + "))*$

Thank you for your help!

Oliver R.

Posted 2016-07-20T07:28:39.220

Reputation: 188

Answers

0

Making "snowflake" devmon templates can be onerous to manage but if you want.. In the devmon template use below To alarm on a specific alias that includes the string use

ifAliasBox : alarm  : .+uplink.+

If you only want to display the interfaces that include the string

ifAliasBox : only : .+uplink.+

Better to use the XYMON hosts.cfg file for customizations.  In the XYMON hosts.cfg for the device use below

DEVMON:except(if_stat;ifAliasBox;ao:.+uplink.+|uplink.+),tests(if_stat)

Brian

Posted 2016-07-20T07:28:39.220

Reputation: 1