Smarts SAM: How to Setup an Escalation Policy (EP)
search cancel

Smarts SAM: How to Setup an Escalation Policy (EP)

book

Article ID: 332145

calendar_today

Updated On:

Products

VMware Smart Assurance

Environment

VMware Smart Assurance - SMARTS

Resolution

  1. Create SAM domain.
    • In the Example, I have created AGG SAM and PRES SAM. You may choose to create only one SAM domain. In this example, my Escalation Policy is at the PRES SAM level
  2. If you choose to create two SAMs, subscribe the AGG SAM to PRES SAM
  3. Create Escalation Policy
    1. Open the Global Manager Admin Console
    2. Right Click  Escalation Policy , then select  New 
    3.  Policy Name:  <Test_ESC_P01>
      •   
    4. Click  Edit Filter  then create your notification filters for this Policy
      •  
    5. Click  OK 
  4. Now add Escalation Policy Path
    1. Click your Policy <Test_ESC_P01>
    2. Click  Add Path 
    3.  Path Name:   <Smarts Events Alerts>
      •  
    4. Click  Edit Filter  then create your notification filters for this Path
      •      
  5. Create a test shell script to invoke escalation action
    1. Via CLI, navigate to folder  <BASEDIR>/SAM/smarts/actions/server/ 
    2. Create file <touchFile.sh>
      •  
    3. The above file should create a file called:  Escalation_Policy.txt  in /tmp/ directory
      • Add the lines below into  touchFile.sh  file:
      • #!/bin/sh
        #touch /tmp/Escalation_Policy.txt
        #
        #The below line will touch a file called Escalation_Policy.txt under the /tmp/ directory.
        # "env" will write the environment information into the file Escalation_Policy.txt
        #When a notification matches EP filter, all of that notification's properties which
        #Smarts tool is passing to this script will be dumped into the file Escalation_Policy.txt
        #
        env > /tmp/Escalation_Policy.txt
    4. Make  touchFile.sh  executable
      • chmod +x touchFile.sh
      •  
  6. Return to Admin Console to insert  Level  in your EP Path
    1. Right Click your path <Smarts Events Alerts>
    2. Select  Level , then Click  Insert 
    3. Click  Tool Wizard , then enter  Automatic Tool  name <touchFile>
    4. Select your shell script  touchFile.sh  from  Program:   list
    5. Click  Finish 
    6. From  From Available Tools: , select <touchFile> tool and  Add 
      • Make sure <touchFile> is moved to  Invoked Tools 
      •  
    7. Click  OK 
    8. Right Click the path, then select  Path  and click  Enable 
    9. Click  Apply 
  7. From CLI smarts bin directory, send a sample notification to match your Escalation Policy
    1. Send notification: ./sm_ems -s Kevin-SAM-AGG1 notify Host Kevin Down
      •    
    2. Check the notification from SAM console to confirm that the notification is sent and reached our PRES SAM.
      •    
    3.  Check the PRES SAM audit logs to confirm the Escalation Policy worked and the script was invoked  
      •    
    4. Finally check /tmp/ directory to confirm the Escalation Policy action invoked the script and the script created the file  Escalation_Policy.txt  in this directory
      •   



Additional Information

touchFile.sh script is attached in this KB

#!/bin/sh
#touch /tmp/Escalation_Policy.txt
#
#The below line will touch a file called Escalation_Policy.txt under the /tmp/ directory.
# "env" will write the environment information into the file Escalation_Policy.txt
#When a notification matches EP filter, all of that notification's properties which
#Smarts tool is passing to this script will be dumped into the file Escalation_Policy.txt
#
env > /tmp/Escalation_Policy.txt


Sample Output of the txt file above when EP action is invoked:
-------------------
SM_OBJ_scheduledForNotify=false
SM_OBJ_ShouldInactiveAutoArchive=false
SM_OBJ_UserDefined14=
SM_OBJ_UserDefined15=
SM_LOG_ROLL_SIZE=200M
SM_OBJ_UserDefined16=
XDG_SESSION_ID=497
SM_OBJ_ShouldAutoAcknowledge=false
SM_OBJ_UserDefined17=
SM_OBJ_Impact=0
SM_OBJ_EventType=DURABLE
HOSTNAME=vm-smts-centos**********
SM_OBJ_UserDefined10=
SELINUX_ROLE_REQUESTED=
SM_ALLOW_LEGACY_CRYPTO=TRUE
SM_OBJ_IsAggregatedBy=false
SM_OBJ_FirstScheduledAutoAcknowledge=0
SM_OBJ_UserDefined11=
SM_REMOTE_HOST=vm-smts-centos*******
SM_OBJ_UserDefined12=
SM_OBJ_SourceEventType=UNKNOWN
TERM=xterm
SHELL=/bin/bash
SM_OBJ_UserDefined13=
SM_OBJ_ServiceName=
HISTSIZE=1000
SSH_CLIENT=x.x.x.x 63853 22
SM_OBJ_AcknowledgmentTime=0
SM_OBJ_Acknowledged=false
SM_POBJ_PATH=ICS-AutoAction-Path-Test_ESC_P01-Smarts Events Alerts
SM_OBJ_FirstScheduledAutoClear=0
SM_OBJ_IsProblem=false
SELINUX_USE_CURRENT_RANGE=
SM_OBJ_UserDefined18=
SM_RUNCMD_DEPTH=1
SM_TLS_PROTOCOLS=+TLSv1.1
SM_POBJ_POLICY=ICS-AutoAction-Policy-Test_ESC_P01
SM_OBJ_UserDefined19=
SM_OBJ_InMaintenance=false
.......
...........


Attachments

touchFile.sh get_app