Hi Klaus,
Please find the below files.alarmrc setscript sms.pl
------------------------------------------------.alarmrc--------------------------------------------------------------
VNM_MAIL_TIMEOUT=600000
VNM_CONNECT_TIME_LIMIT=60000
KEEP_ALIVE_TIMEOUT=30000
KEEP_ALIVE_INTERVAL=60000
GET_GRAY_INITIAL_ALARMS=false
GET_EXISTING_ALARMS=true
UPDATE_EXISTING_ALARMS=false
USE_DEVICE_NETWORK_ADDRESS=true
SEND_EVENT_UPDATES=true
USE_NEW_INTERFACE=true
EXTRA_ATTRS_AS_ENVVARS=
EXTRA_ATTRS_AS_ARGS=0x0023000e
UPDATE_ATTRS=
GET_PROBABLE_CAUSES=true
GET_EVENTS=true
SHOW_ALL_EVENTS=false
SHOW_ONLY_ORIGINATING_EVENT=false
ENABLE_CORRELATION=false
SHOW_SYMPTOM_ALARMS=false
MSG_TIMESTAMP_FORMAT=%X %x
LANDSCAPE=4
SEND_ALARM_DELAY=1000
SET_SCRIPT=C:/win32app/Spectrum/Notifier/SetScript
CLEAR_SCRIPT=C:/win32app/Spectrum/Notifier/ClearScript
UPDATE_SCRIPT=C:/win32app/Spectrum/Notifier/UpdateScript
APPLICATION=AlarmNotifier
GET_LOCATIONS=true
GET_FLASH_GREEN=true
POLICY_LANDSCAPE=
===============================================================================================================
------------------------------------------------setscript--------------------------------------------------------------
#!/bin/sh
#
#
# CA Technologies, Inc.
# One CA Plaza
# Islandia, NY 11749 USA
#
# Copyright (c) 2002 CA Technologies, Inc.
# All rights reserved.
#
# IN NO EVENT SHALL CA TECHNOLOGIES INCORPORATED BE LIABLE FOR
# ANY INCIDENTAL, INDIRECT, SPECIAL, OR CONSEQUENTIAL DAMAGES
# WHATSOEVER (INCLUDING BUT NOT LIMITED TO LOST PROFITS) ARISING OUT
# OF OR RELATED TO THIS SOFTWARE, EVEN IF CA TECHNOLOGIES INCORPORATED
# HAS BEEN ADVISED OF, KNOWN, OR SHOULD HAVE KNOWN, THE POSSIBILITY OF
# SUCH DAMAGES.
#
#
###############################################################################
#
# SetScript - default script executed by AlarmNotifier for an alarm set.
#
###############################################################################
###############################################################################
#
# MAIL Facility
#
# If a user wishes to send a mail message for the alarm then set SENDMAIL to
# "True" and set VARFORMAIL to "RepairPerson" or "NotificationData" (or
# "Both") depending on who you want the mail sent to.
#
# Note: You can only send mail to users listed in $NOTIFDATA if the
# SPECTRUM Alarm Notification Manager (SANM) is enabled. If VARFORMAIL is
# set to "NotificationData" and SANM is not enabled then mail is not sent.
#
# Note: The argument $REPAIRPERSON( actually $TROUBLE_SHOOTER_EMAIL ) and/or
# $NOTIFDATA MUST be valid Login IDS and email addresses respectively
# in order for the script to send mail them.
#
# Note: Ensure Mail is configured as described in the AlarmNotifier User
# Guide if you are running AlarmNotifier on Windows with mail enabled.
#
##############################################################################
SENDMAIL=True #True or False
VARFORMAIL=NotificationData #RepairPerson, NotificationData, or Both
case `/bin/uname` in
"Windows_NT") MAIL="mail";;
"Linux") MAIL="mail";;
"SunOS") MAIL="mailx";;
esac
DATE=$1
TIME=$2
MTYPE=$3
# use quotes to avoid mis-interpreting special chars - like '
# If model name isn't correct when passed as an arg, you can also
# try using $SANM_MODEL_NAME to avoid issues with shell escape
# characters.
# This has been see on Windows where C:\ is changed to C:\\
MNAME="$4"
AID=$5
SEV=$6
CAUSE=$7
REPAIRPERSON="$8"
if [ "$USE_NEW_INTERFACE" = "TRUE" ]
then
# ALARMSTATUS now being passed via environment variable
shift 8
else
STATUS=$9
shift 9
fi
SERVER=$1
LANDSCAPE=$2
MHANDLE=$3
MTHANDLE=$4
IPADDRESS=$5
SECSTR=$6
ALARMSTATE=$7
ACKD=$8
CLEARABLE=$9
shift 9
#FLASH_GREEN=$1
if [ "$USE_NEW_INTERFACE" = "TRUE" ]
then
# PCAUSE and EVENTMSG now passed via environment variables
LOCATION="$2"
AGE=$3
NOTIFDATA=$4
PID=$5
SANM=$6
shift 6
else
PCAUSE=`echo "$2" | tr '\350' '\012' | tr '\351' '"'`
LOCATION="$3"
AGE=$4
NOTIFDATA=$5
EVENTMSG=`echo "$6" | tr '\350' '\012' | tr '\351' '"'`
PID=$7
SANM=$8
shift 8
fi
# Information on specifying additional attributes, which requires
# USE_NEW_INTERFACE=true :
# Two ways have been added that allows the specification of additional
# attributes for AlarmNotifier. You have the option of passing the
# attributes as environment variables or as arguments, which is reflected
# in the two new config parameters:
#
# EXTRA_ATTRS_AS_ENVVARS and EXTRA_ATTRS_AS_ARGS
#
# For most attributes, either method is acceptable, but for multi-line text
# attributes or for very long attribute values it is recommended to specify
# these as EXTRA_ATTRS_AS_ENVVARS because of command-line length limitations
# and Windows behavior that truncates the command-line at the first newline
# character.
# If EXTRA_ATTRS_AS_ENVVARS have been specified, they can be just referenced
# by prepending # SANM_ to the value in the config file, ie:
#
# EXTRA_ATTRS_AS_ENVVARS=0x100c5,0x11f84 means that
#
# $SANM_0x100c5 and $SANM_0x11f84 environment variables to be set, which
# can be then be referenced in this script like:
#
# IFDESC=$SANM_0x100c5
# IFALIAS=$SANM_0x11f84
#
# Note: Windows will uppercase these variables, so they need to be referenced
# that way - ie. $SANM_0X100C5 and $SANM_0X11F84.
#
# Alternatively, if EXTRA_ATTRS_AS_ARGS have been specified, they will be
# added to the command-line. For example:
#
# EXTRA_ATTRS_AS_ARGS=0x100c5,0x11f84 means that
#
# the values of these attributes will be added to be argument list passed
# to this script, and can be referenced like this:
#
# IFDESC=$1
# IFALIAS=$2
DTYPE="$1"
echo_info()
{
echo ""
echo "============================================================"
echo " "
echo "Alarm Notification from SPECTRUM"
echo " "
#echo "Alarm SET:"
echo ""
echo "Date: " $DATE
echo "Time: " $TIME
#echo "DeviceType: " $DTYPE
#echo "Mtype: " $MTYPE
echo "ModelName: " $MNAME
#echo "AlarmID: " $AID
# If you wish to see the global alarm ID printed out you need to set
# ENABLE_CORRELATION to "true" and USE_NEW_INTERFACE to "true" in the
# configuration file.
if [ "$ENABLE_CORRELATION" = "TRUE" ] && [ "$USE_NEW_INTERFACE" = "TRUE" ]
then
echo "Global AlarmID: " $GLOBAL_ALARM_ID
fi
# If you wish to see correlation related information, you need to set
# ENABLE_CORRELATION to "true" and SHOW_SYMPTOM_ALARMS to "true" in
# the configuration file.
if [ "$SYMPTOM_ALARM_LIST" ]
then
echo "CorrelationAlarmType: " CAUSE
echo "SYMPTOMGlobalAlarmIDList: " $SYMPTOM_ALARM_LIST
fi
if [ "$CAUSE_ALARM_LIST" ]
then
echo "CorrelationAlarmType: " SYMPTOM
echo "CAUSEGlobalAlarmIDList: " $CAUSE_ALARM_LIST
fi
# If you wish to see the UNIX alarm time printed out you need to set
# USE_NEW_INTERFACE to true in the configuration file and uncomment
# the following line.
#echo "Raw Alarm Time: " $RAW_ALARM_TIME
echo "Severity: " $SEV
#echo "ProbableCauseID: " $CAUSE
#echo "RepairPerson: " $REPAIRPERSON
#echo "AlarmStatus: " $STATUS
#echo "SpectroSERVER: " $SERVER
#echo "Landscape: " $LANDSCAPE
#echo "ModelHandle: " $MHANDLE
#echo "ModelTypeHandle: " $MTHANDLE
echo "IPAddress: " $IPADDRESS
#echo "SecurityString: " $SECSTR
#echo "AlarmState: " $ALARMSTATE
#echo "Acknowledged: " $ACKD
#echo "UserClearable: " $CLEARABLE
###########################################################################
# When notifying on management lost (0x12dc7), customer (0x12bf6) and/or
# service (0x12bf7) impact attributes please pass them as environment variables
# and print in quotes, as they will usually contain multiple
# lines:
#
# echo "ManagementImpactLost: $SANM_0x12dc7"
# echo "ServiceImpact: $SANM_0x12bf7"
# echo "CustomerImpact: $SANM_0x12bf6"
#
# Or on Windows:
#
# echo "ManagementImpactLost: $SANM_0X12DC7"
# echo "ServiceImpact: $SANM_0X12BF7"
# echo "CustomerImpact: $SANM_0X12BF6"
###########################################################################
###########################################################################
# The following parameters contain values only when
# the SPECTRUM Alarm Notification Manager is enabled.
###########################################################################
if [ "$SANM" ]
then
#echo "Location: " $LOCATION
#echo "AlarmAge: " $AGE
echo "NotificationData:" $NOTIFDATA
echo "" # insert blank line
fi
# This variable has substituted placeholder chars, echo them inside quotes
echo "ProbableCause: $PCAUSE"
echo "" # insert blank line
# This variable has substituted placeholder chars, echo them inside quotes
echo "EventMessage: $EVENTMSG"
echo ""
echo "============================================================"
}
parse_notifdata()
{
LIST=`echo "$NOTIFDATA" | tr ',:' ' '`
SKIP=false
for ITEM in $LIST
do
if [ "$ITEM" = "or" ]
then
SKIP=true
else
if [ "$SKIP" = "false" ]
then
OUTLIST="$OUTLIST $ITEM"
else
SKIP=false
fi
fi
done
echo $OUTLIST
}
# Below NCMAUTOREPAIR must set to TRUE to call auto remediation for NCM
# SPECTRUM_USER must be user which spectrum is installed
NCMAUTOREPAIR=FALSE
SPECTRUM_USER="spectrum"
if [ "$NCMAUTOREPAIR" = "TRUE" ]
then
if [ "$MTYPE" = "NCM_Policy" ] && [ "$MTHANDLE" = "0x82000b" ]
then
echo "*******************************************************************"
echo "NCM Auto Repair Policy Model Handle" $MHANDLE
$SPECROOT/java/jre/bin/java -jar $SPECROOT/lib/ncmautorepair.jar $SERVER $SPECTRUM_USER $MHANDLE
echo "*******************************************************************"
fi
fi
if [ "$SENDMAIL" = "True" ]
then
RECIPIENTS=$VARFORMAIL
if [ "$VARFORMAIL" = "NotificationData" ]
then
RCVRS=`parse_notifdata`
fi
if [ "$VARFORMAIL" = "RepairPerson" ]
then
RCVRS="$TROUBLE_SHOOTER_EMAIL"
fi
if [ "$VARFORMAIL" = "Both" ]
then
RCVRS=`parse_notifdata`
RCVRS="$RCVRS $TROUBLE_SHOOTER_EMAIL"
RECIPIENTS="NotificationData/RepairPerson"
fi
if [ "$RCVRS" -a "$RCVRS" != " " ]
then
echo " "
echo "*******************************************************************"
echo "Sending mail to $RECIPIENTS:"
echo ""
echo "($RCVRS)"
echo "*******************************************************************"
echo_info | tee -i /tmp/set_alarm.$PID
$MAIL -s "A $SEV alarm has occurred on $IPADDRESS($MNAME)" $RCVRS < /tmp/set_alarm.$PID
rm -f /tmp/set_alarm.$PID
else
echo " "
echo "*****************************************************"
echo "NO $RECIPIENTS assigned - no mail sent"
echo "*****************************************************"
echo_info
fi
else
echo_info
fi
use utf8;
use strict;
use LWP::Simple;
my $username = "adg_ts";
my $password = "dspcctns@12";
my $send_from = "TSECOP";
my $send_to = "";
my $message_text = "";
my $URL = "http://msdgweb.mgov.gov.in/esms/sendsmsrequest/websms/webmsg?user=$adg_ts&pass=$dspcctns@12&sid=$send_from&mno=$send_to&type=1&esm=0&dcs=0&text=$message_text";
perl sms.pl $URL
====================================================================================================================
------------------------------------------------sms.pl--------------------------------------------------------------
############################################
#!/usr/bin/perl -w
use utf8;
use strict;
use LWP::Simple;
my $uri = $ARGV[0];
my $response = get $uri;
print "Response: $response\n";
#######################################################################