Specifications
Chapter 8: Alerts
4. Select the action from the list.
<?xml version="1.0" encoding="UTF-8"?>
<manifest xmlns="http://www.hyper9.com/ws"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<enabled>true</enabled>
<type>ALERT</type>
<uniqueId>alert-test</uniqueId>
<name>Log Alert Summary</name>
<description>Logs a summary of this alert's firing details to a
file</description>
<command>perl</command>
<command>$MANIFEST_HOME/logAlert.pl</command>
<argumentPrefix>-</argumentPrefix>
<successCode>0</successCode>
<!--Optionally specify the directory to start from -->
<!--<workingDirectory></workingDirectory>-->
</manifest>
For this example, a script was customized to run as the command, called
logAlert.pl. There are two command elements. Use a new element for every
time you have white space in your arguments.
Save the following code in the same data/content/externalActions folder as
logAlert.pl. Because it is saved in the same folder as the manifest, the
$MANIFEST_HOME variable from the previous manifest is used to describe its path.
#!/usr/bin/perl
# Author: Ryan Kruse
#
# Description: Designed to be called through the Hyper9 external actions
framework,
# this script simply uses the SOAP API to retrieve an Alert and log its
values to a file
#
use strict;
use Hyper9::Client;
use Getopt::Long;
174