AlarmNotifier get attr MAC-Address $SANM_0x110df and display it in same OneClick attribute format
search cancel

AlarmNotifier get attr MAC-Address $SANM_0x110df and display it in same OneClick attribute format

book

Article ID: 235132

calendar_today

Updated On:

Products

CA Spectrum

Issue/Introduction

How get the MAC_Address in alarmnotifier.

The MAC_Address atrtribute 0x110df can be passed as EXTRA_ATTRS_AS_ENVVARS in .alarmrc configuration file and it can then referenced as $SANM_0x110df variable.

The issue is that the attribute 0x110df is displayed in OneClick in the format like:

 

while in the alarmnotifier log it appears like:

4.5B.A.98.C0.22

that is the same format it appears in CLI command show attributes:

 

How to get it in the same OneClick format (6 two hex chars separated by colon ":" ) ?

 

Environment

Release : any

Component :

Resolution

In the alarmnotifier SetScript, you can code:

MACADDRESS=`echo "."$SANM_0X110df"."|tr 'A-Z' 'a-z'|tr '.' ':'|sed -e 's/:0:/:00:/g'|sed -e 's/:1:/:01:/g'|sed -e 's/:2:/:02:/g'|sed -e 's/:3:/:03:/g'|sed -e 's/:4:/:04:/g'|sed -e 's/:5:/:05:/g'|sed -e 's/:6:/:06:/g'|sed -e 's/:7:/:07:/g'|sed -e 's/:8:/:08:/g'|sed -e 's/:9:/:09:/g'|sed -e 's/:a:/:0a:/g'|sed -e 's/:b:/:0b:/g'|sed -e 's/:c:/:0c:/g'|sed -e 's/:d:/:0d:/g'|sed -e 's/:e:/:0e:/g'|sed -e 's/:f:/:0f:/g'|sed 's/^.\(.*\).$/\1/'` 

to then use the $MACADDRESS variable.