Smarts SAM: How to I get to all the notification attributes in perl/shell script notify adapter
search cancel

Smarts SAM: How to I get to all the notification attributes in perl/shell script notify adapter

book

Article ID: 303704

calendar_today

Updated On:

Products

VMware Smart Assurance

Environment

VMware Smart Assurance - SMARTS

Resolution

Smarts SAM: How to I get to all the notification attributes in perl/shell script notify adapter?



Notification attributes are passed to script notifier as parameters and not as environment variables.

Additional Information

The following is from the EMC Smarts Service Assurance Manager Notification Adapters User's Guide.

Script Notifier Adapter Versus sm_adapter Automated Tools:

* Parameters to automate Service Assurance actions are passed as environment variables, pre-configured (hard-coded) by EMC Corporation; parameters to Script Notifier Adapter actions are passed from the script-custom.asl, and are user configurable. 

Therefore, for script adapters the attributes are passed as parameters of the script.

Example
The following appears in the sm_notify log file when --debug is enabled (<BASEDIR>/SAM/smarts/bin/sm_notify --debug --output script):

Run script:

SM_SITEMOD/actions/myPerlScript.pl "1168891736" "NOTIFY" "INCHARGE-AM-PM"

"Router" "moto-gw" "DOWN" "100" "" "" "" ""

Returned status: 0

Output: *************** STARTING myPerlScript.pl**************
1168891736
NOTIFY
INCHARGE-AM-PM
Router
moto-gw
DOWN
100
*************** ENDING myPerlScript.pl************** 

This is how the event is sent:

<BASEDIR>/SAM/smarts/bin/sm_ems -s INCHARGE-SA notify Router moto-gw DOWN INCHARGE-AM-PM durable 10 Severity=1

This is a sample  myPerlScript.pl in <BASEDIR>/SAM/smarts/local/action/:

#!/usr/bin/perl
print("*************** STARTING myPerlScript.pl**************\n");
foreach $arg (@ARGV) {
print($arg."\n");
}
print("*************** ENDING myPerlScript.pl**************\n");

The arguments passed to the script is controlled by

<BASEDIR>/SAM/smarts/rules/notifier/script-custom.asl