Switch Version Check - String transformation

Started by anw, January 24, 2016, 04:47:53 PM

Previous topic - Next topic

anw

Hi
i want to monitor my Switch OS Versions.
Could you help me transform the Value i get after doing snmp check
the value i get is:
Juniper Networks, Inc. ex2200-c-12t-2g Ethernet Switch, kernel JUNOS 12.3R11.2, Build date: 2015-09-24 11:55:10 UTC Copyright (c) 1996-2015 Juniper Networks, Inc.

how can i transform this to only check the "JUNOS 12.3R11.2" part  , and setup notifications if its not version XXX

thanks

tomaskir

#1
You can use a transformation script like this:

foundMatch = $1 ~= "Juniper Networks, Inc\. .* kernel (.*), Build date: .*";

return foundMatch ? $1 : "Unknown";


Then set threshold on the DCI to "Operation" "!= : not equal to" and the version you want to have on your devices into "Value".

This will generate SYS_THRESHOLD_REACHED events (by default, feel free to generate different event if you want) when the version is invalid.
Handle the event in EPP as you wish to generate Alarms / notifications (by default it will already create an Alarm in NetXMS).

anw

awesome thank you

i created a new event, and setup EPP notification to send me an email.

how can forward the actual Kernel Version to the notification?
so i get an email like: "JUNOS is out of date, running Version XXX"

thanks!

tomaskir

Here is general info on how to setup emails (I guess you already have that working tho):
https://wiki.netxms.org/wiki/How_to_send_e-mail_notification_when_disk_space_is_low

In the "Send E-Mail" action, you have access to all parameters of the event.
See this link for how they are formatted:
https://wiki.netxms.org/wiki/UM:Event_Processing#Macros_for_Event_Processing

Threshold violation events are all modeled by the "SYS_THRESHOLD_REACHED" event.
Which means that %4 is the current value of the DCI.
For list of all parameters and what numbers they are see the "SYS_THRESHOLD_REACHED" event template (Configuration > Event configuration).

anw