CMM Scripting

 

CMM Scripting

18

18.1CLI Scripting

In addition to calling the CLI directly, commands can easily be called through scripts using “bash” shell scripting. These scripts could be tailored to create a single command from several CLI commands or to give more detailed information. For example, you may want to display all of the fans and their speeds on the server. A script could be written that would first call the CLI to find out what fan trays are present. Next it would find out what fan sensors are in each fan tray. Finally it would call the CLI to get the current speeds of each of the fans.

Scripts can be written directly on the CMM and should be saved on the CMM as a file in flash in the /home/scripts directory.

Script files need to have execute permissions set.

18.1.1Script Synchronization

Script files are not synchronized automatically when changed (by deleting, renaming, altering its chown/chmod/chgrp permissions, etc) in the /home/scripts directory on the active CMM. The Linux “touch” command should be issued to the /home/scripts directory on the active CMM to synchronize the scripts.

Scripts are automatically synchronized on any full synchronization (chassis power up, insertion of a new CMM) as well as when they are edited (e.g., using vi and writing the file) or copied.

Scripts need to be deleted from both CMMs manually. Deleting a script on the active CMM does not automatically delete the script on the standby.

Note: Scripts are always synchronized from the active CMM to the standby CMM, not standby to active. Adding, editing, or modifying scripts on the standby CMM should be done with caution, and will need to be manually copied to the active CMM.

18.2Event Scripting

Health events triggered on the CMM can be used to execute scripts stored locally in the /home/ scripts directory. Any level of an event can be used as a trigger: normal, minor, major, and critical. The CLI command for associating a script with an event is:

cmmset –l [location] –t [target] –d [action type] –v [script]

Location is the component in the chassis that the health event is associated with.

Target is the sensor to be triggered on.

Action type is NormalAction, MinorAction, MajorAction, or CriticalAction, based upon the severity of the event to be triggered on.

164MPCMM0001 Chassis Management Module Software Technical Product Specification

Page 164
Image 164
Intel MPCMM0001 manual CMM Scripting, CLI Scripting, Script Synchronization, Event Scripting