VMWare Smart Assurance: How can I launch a Unix command or external script during a VMWare Smart Assurance domain startup?
search cancel

VMWare Smart Assurance: How can I launch a Unix command or external script during a VMWare Smart Assurance domain startup?

book

Article ID: 331790

calendar_today

Updated On:

Products

VMware Smart Assurance

Issue/Introduction

How can I launch a Unix command during the VMWare Smart Assurance domain startup?
How can I launch a Unix command during the VMWare Smart Assurance Service Assurance Manager (SAM) domain  startup?

How can I launch an external script during the VMWare Smart Assurance domain startup?

Environment

VMware Smart Assurance - SMARTS

Resolution

You can have any VMWare Smart Assurance domain manager such as SAM or IP launch a Unix command or external script during startup by editing the ics-init.asl file that the domain server calls during startup. The following shows how this could be done for an Ionix/Smarts SAM domain server:

  1. Open the ics-init.asl file for editing using sm_edit. This file is located in the following directory:

    <BASEDIR>/smarts/rules/ics
     

    IMPORTANT! When modifying this file, you must use sm_edit so you make edits on a local copy of the file and leave the original intact.

  2. Add the "INVOKE_UNIX" code to the ics-init.asl file where indicated by bold text in the following:

    IMPORTANT! The myscript.sh script file must be located in  your smarts/actions directory before you implement the following code.

.
.
.
    { INITIALIZE_CONFMAPS " SHUTDOWN }
    { MAINTENANCE_HANDLER " SHUTDOWN }
    { INVOKE_UNIX " SHUTDOWN }

}

INVOKE_UNIX
do {
   script = self->create("ACT_Script", "ACT-Script-unix") ? LOG,STOP;
   script->scriptName = "myscript.sh";
   script->run();

}

SHUTDOWN
do {
    smsystem->logWarning("ICS_ESHUTTINGDOWN", aslName);
    quit();
}
.
.
.