I'm running 8.1 on Linux, but the same probably applies to Windows
installations as well.
In your SPECTRUM/Notifier directory, you should see two scripts that you
are interested in - SetScript and ClearScript. SetScript is where you
place code that you want to run when new alarms happen, and ClearScript
runs when alarms are cleared. In order for these to be active, you must
have AlarmNotifier running. You can modify these scripts to look for
specific Probable Cause, Model Type, or even right down to a specific
Model Handle, if you want.
At the bottom of the script, you should be able to insert your own logic
to run external scripts when various things happen. Here's an example
we used previously. This code looked for alarms for FoundryIron models,
and if it got two specific PCauses, it would run a PHP script that sent
an email, passing the Cause, Alarm ID, Model Name, PCause, and Event
Message via the command line. The "echo" line is commented out, but was
just used so that we could see the command line options that it was
passing, to make sure it worked as expected. We could see these in the
window where AlarmNotifier was running (if we manually started it
without it running in the background).
# MType FoundryIron used for (ServerIron Models)
if [ "$MTYPE" = "FoundryIron" ] # Alarm for a ServerIron
then
if [ "$CAUSE" = "10f03" ] # ProbableCauseID: 10f03 HIGH CPU
UTILIZATION
then
#echo /usr/bin/php
/local/spectrumScripts/serverIron/serverIronEmail_ITSLB.php setalarm
$CAUSE $AID $MNAME $PCAUSE $EVENTMSG
/usr/bin/php
/local/spectrumScripts/serverIron/serverIronEmail_ITSLB.php setalarm
$CAUSE $AID $MNAME $PCAUSE $EVENTMSG&
fi
if [ "$CAUSE" = "10f06" ] # ProbableCause: 10f06 HIGH
MEMORY UTILIZATION
then
#echo /usr/bin/php
/local/spectrumScripts/serverIron/serverIronEmail_ITSLB.php setalarm
$CAUSE $AID $MNAME $PCAUSE $EVENTMSG
/usr/bin/php
/local/spectrumScripts/serverIron/serverIronEmail_ITSLB.php setalarm
$CAUSE $AID $MNAME $PCAUSE $EVENTMSG&
fi
fi
From: Tadysak, Dan E [mailto:[email protected]]
Sent: Thursday, May 24, 2012 9:59 AM
To: spectrum
Subject: [spectrum] Ca Spectrum Automatic Action
I know this has probably been asked before but I cannot find any
examples when searching my mail from our forum. Does anyone have an
example of an automatic action that is run when an alarm is detected. I
am not sure of how to setup a script to be launched when a certain alarm
occurs. Does anyone have an example they can share. I want the ability
to pass parameters from the alarm to the script.
Thanks,
* --To unsubscribe from spectrum, send email to [email protected]
with the body: unsubscribe spectrum [email protected]
---
To unsubscribe from spectrum, send email to [email protected] with the body:
unsubscribe spectrum [email protected]