To add an External Script:
$RTDIR/bin, create the folder ext_commands. Run:mkdir $RTDIR/bin/ext_commands$RTDIR/bin/ext_commands/ or in a folder under that location. The path and script name must not contain any spaces.chmod +x <script_filename>$RTDIR/bin/ext_commands/ directory. Use the relative path if needed. Do not specify the full path of $RTDIR/bin/ext_commands/.Guidelines for creating the script
To refer to the event in the script, define this environment variable:
EVENT=$(cat)
and use $EVENT
Use line editor commands like awk or sed to parse the event and refer to specific fields. You can print the $EVENT one time to see its format.
--------------------------------------------------------------------------------------------------
The format of the event content is a name-value set – a structured set of fields that have the form:
(name: value ;* );
where name is a string and value is either free text until a semicolon, or a nested name-value set.
The following is a sample event:
(Name: Check Point administrator credential guessing; RuleID: {F182D6BC-A0AA-444a-9F31-C0C22ACA2114}; Uuid: <42135c9c,00000000,2e1510ac,131c07b6>; NumOfUpdates: 0; IsLast: 0; StartTime: 16Feb2015 16:45:45; EndTime: Not Completed; DetectionTime: 16Feb2015 16:45:48; LastUpdateTime: 0; TimeInterval: 600; MaxNumOfConnections: 3; TotalNumOfConnections: 3; DetectedBy: 2886735150; Origin: (IP: 192.0.2.4; repetitions: 3; countryname: United States; hostname: theHost) ; ProductName: SmartDashboard; User: XYZ; Source: (hostname: theHost; repetitions: 3; IP: 192.0.2.4; countryname: United States) ; Severity: Critical; EventNumber: EN00000184; State: 0; NumOfRejectedConnections: 0; NumOfAcceptedConnections: 0) ;
--------------------------------------------------------------------------------------------------
If you need to refer to more fields, you can add them to the event: