Restmon javascript fields not always working
search cancel

Restmon javascript fields not always working

book

Article ID: 431445

calendar_today

Updated On:

Products

DX OI SaaS

Issue/Introduction

I have recently updated our restmon schemas to include alarm_name and alarm_description fields, which we can then use in situations and notifications.

These fields are based on a javascript function:

                  "alarm_name" : "#function(){$alarmname = (root.alarm_name || root.alertcode || root.message); return $alarmname+' -- '+$alertid}();",

                  "alarm_description" : "#function(){$alarmname = (root.alarm_name || root.alertcode || root.message); return 'https://<URL>/'+$alarmname}();"

However, sometimes the alarm attributes contain the javascript rather than the desired content.

Resolution

Using root.alertid instead of $alertid in the javascript resolved the issue.