DX NetOps

Expand all | Collapse all

Using perl setscript for alarm notifier

  • 1.  Using perl setscript for alarm notifier

    Posted Dec 04, 2012 04:39 PM
    Hello

    I get the following errors when using a perl setscript


    d/Spectrum/Notifier/SetScript.pl: line 7: =: command not found
    d/Spectrum/Notifier/SetScript.pl: line 8: =: command not found
    d/Spectrum/Notifier/SetScript.pl: line 9: =: command not found
    d/Spectrum/Notifier/SetScript.pl: line 10: =: command not found
    d/Spectrum/Notifier/SetScript.pl: line 11: =: command not found
    d/Spectrum/Notifier/SetScript.pl: line 12: =: command not found
    d/Spectrum/Notifier/SetScript.pl: line 13: =: command not found
    d/Spectrum/Notifier/SetScript.pl: line 14: =: command not found
    d/Spectrum/Notifier/SetScript.pl: line 15: =: command not found
    d/Spectrum/Notifier/SetScript.pl: line 16: =: command not found
    d/Spectrum/Notifier/SetScript.pl: line 17: =: command not found
    d/Spectrum/Notifier/SetScript.pl: line 19: syntax error near unexpected token `{'
    d/Spectrum/Notifier/SetScript.pl: line 19: `if ( $ENV{SANM_0X12B4C} = '' ) {'

    It seems that it doesn't know that its a perl script
    Maybe is the .alarmrc file is incorrect
    Below is the perl script and .alarmrc
    ------------------------------------------------setscript.pl--------------------------------------------------------------
    #!/usr/bin/perl
    ###############################################################################
    #
    # SetScript.pl - Perl script executed by AlarmNotifier for an alarm set.
    #
    ###############################################################################
    $Date = $ARGV[0];
    $Time = $ARGV[1];
    $MType = $ARGV[2];
    $Device_name = $ARGV[3];
    $AID = $ARGV[4];
    $Sev = $ARGV[5];
    $Cause = $ARGV[6];
    $Ipaddress = $ARGV[12];
    $NotifyData = $ARGV[20];
    $PCause = $ENV{PCAUSE};
    $Eventmsg = "$ENV{EVENTMSG}";

    if ( $ENV{SANM_0X12B4C} = '' ) {
    $Alarm_Title = "$ENV{SANM_0X12B4C}"
    } else {
    $NEWPCAUSE = (split /\n/, $PCause)[0];

    $Alarm_Title = "$NEWPCAUSE";
    }

    $temp_file = $AID . "_tmp.txt";
    open(MSG, " > /d/tmp/$temp_file");
    print MSG "$Date";
    print MSG "$Time";
    print MSG "$MType";
    print MSG "$Cause";
    print MSG "$Device_name";
    print MSG "$Ipaddress";
    print MSG "$Alarm_Title";
    print MSG "$Eventmsg";
    close MSG;
    print "$Date";
    print "$Time";
    print "$MType";
    print "$Cause";
    print "$Device_name";
    print "$Ipaddress";
    print "$Alarm_Title";
    print "$Eventmsg";
    @Notifiers = split(/;/, $NotifyData);
    print "@Notifiers\n";
    -------------------------------------.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=false
    USE_NEW_INTERFACE=true
    EXTRA_ATTRS_AS_ENVVARS=0x12c0a,0x12b4c,0x11f7e,0x1134b
    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=20
    SEND_ALARM_DELAY=1000
    SET_SCRIPT=d:/Spectrum/Notifier/SetScript.pl
    CLEAR_SCRIPT=d:/Spectrum/Notifier/ClearScript
    UPDATE_SCRIPT=d:/Spectrum/Notifier/UpdateScript
    APPLICATION=AlarmNotifier
    GET_LOCATIONS=true
    GET_FLASH_GREEN=true
    POLICY_LANDSCAPE=


    Any help will be appreciated.
    Regards
    Klaus


  • 2.  RE: Using perl setscript for alarm notifier

    Posted Dec 05, 2012 05:55 AM
    Hi Klaus,

    To run any perl script, you need to have perl module installed on your server.

    If you are having SpectroSERVER on windows machine, perl is already installed with the Spectrum installation and is located at $SPECROOT/bin/ folder.

    So, you can run the mentioned script from this location.

    From the bash shell navigate to $SPECROOT/bin and execute the script.

    $SPECROOT/bin> perl <Script_file_name>

    You can try this.

    Hope this helps.


    Cheers...
    Rajashekar


  • 3.  RE: Using perl setscript for alarm notifier

    Posted Dec 05, 2012 09:57 AM
    Klaus,

    The way I have seen it done in the past is to convert the perl script to a binary .exe. Modify the .alarmrc file to use the .exe files for the scripts and add the "ALLOW_NOTIFICATION_BINARY=true" to the .alarmrc file.

    Rgards,

    Joe


  • 4.  RE: Using perl setscript for alarm notifier

    Posted Dec 05, 2012 10:35 AM
    Hey Joe,

    now that you mention it, what program do you use to convert a perl script into a binary exe??


    Thanks,
    Daniel


  • 5.  RE: Using perl setscript for alarm notifier

    Posted Dec 05, 2012 10:42 AM
    Daniel,

    I have not done this myself. I have worked with customers who have done it in their environments. A quick google on "convert perl to exe" produces a number of hits.

    Regards,

    Joe


  • 6.  RE: Using perl setscript for alarm notifier

    Posted Dec 05, 2012 11:09 AM
    We just let the default SetScript call the perl script SetScript.pl, and same for UpdateScript and ClearScript, works perfect on windows and linux.


  • 7.  RE: Using perl setscript for alarm notifier

    Posted Dec 05, 2012 01:18 PM

    abubakr wrote:

    We just let the default SetScript call the perl script SetScript.pl, and same for UpdateScript and ClearScript, works perfect on windows and linux.
    Below is the entry in the .alarmsrc and its not working.
    SET_SCRIPT=d:/Spectrum/Notifier/SetScript.pl

    I will try the perl executable.

    Thanks for the responses.

    Regards
    Klaus


  • 8.  RE: Using perl setscript for alarm notifier

    Posted Dec 05, 2012 02:43 PM

    klaus.lintz wrote:

    abubakr wrote:

    We just let the default SetScript call the perl script SetScript.pl, and same for UpdateScript and ClearScript, works perfect on windows and linux.
    Below is the entry in the .alarmsrc and its not working.
    SET_SCRIPT=d:/Spectrum/Notifier/SetScript.pl

    I will try the perl executable.

    Thanks for the responses.

    Regards
    Klaus
    Hi,

    We have:

    SET_SCRIPT=d:/Spectrum/Notifier/SetScript

    Then from in SetScript we call:

    ./$SPECTROO/Notifier/SetScript.pl $1 $2 ........

    Regards,


  • 9.  RE: Using perl setscript for alarm notifier

    Posted Dec 05, 2012 02:52 PM
    Ok.

    I assume that the arguments $1 $4 $6 .... must coinside with arguments called in the perl script.

    Thanks
    Klaus


  • 10.  RE: Using perl setscript for alarm notifier

    Posted Dec 13, 2012 07:00 AM

    klaus.lintz wrote:

    Ok.

    I assume that the arguments $1 $4 $6 .... must coinside with arguments called in the perl script.

    Thanks
    Klaus
    Yes, in some cases we pass the variables into a unique temp file for the perl script to pick it up.


  • 11.  RE: Using perl setscript for alarm notifier

    Posted Dec 13, 2012 07:00 AM

    klaus.lintz wrote:

    Ok.

    I assume that the arguments $1 $4 $6 .... must coinside with arguments called in the perl script.

    Thanks
    Klaus
    Yes, in some cases we pass the variables into a unique temp file for the perl script to pick it up.


  • 12.  Re: Using perl setscript for alarm notifier

    Posted Mar 06, 2018 02:33 AM

    Dear Klaus.lintz,

     

    We are using spectrum 10.2.2.i am trying to SMS notification configuration by using perl script.but i got error.

    are you runing notifier perl script in your enivernmet ???

    Please provide steps to run perl script to get SMS notification.

     

    Regards
    Siva.



  • 13.  Re: Using perl setscript for alarm notifier

    Posted Mar 06, 2018 03:39 AM

    Hi

    Yes. We use perl. 

    If you use windows ensure that you specify the perl.exe path in front of the perl script

    For example C:\perl\bin\perl.exe D:\spectrum\notifier\alarmscript.pl

     

    We call the standard setscript.

    We added the following line in the setscript that call a perl script and pass the variables:

     

    $SPECROOT/Notifier/AlarmScript.pl alarm.$AID "$DATE" "$TIME" "$M
    TYPE" "$MNAME" "$ALARM_TITLE" "$AID" "$SEV" "$CAUSE" "$REPAIRPERSON" "$SERVER" "
    $LANDSCAPE" "$MHANDLE" "$MTHANDLE" "$IPADDRESS" "$SECSTR" "$ALARMSTATE" "$ACKD"
    "$CLEARABLE" "$NOTIFDATA" "$LOCATION" "$ASSET_OWNER" "$MODEL_CLASS" "$DEVICE_TYP
    E" "$TOPOMODEL" "$COLLECTIONMODEL" "$IF_ALIAS" "$IF_DESCRIPTION" "$SYSUPTIME" "$
    SNMP_STRING" "$PCAUSE" "$EVENTMSG"

     

    In the perl script we set the following variables

    $date = $ARGV[1];
    $time = $ARGV[2];
    $model_type = $ARGV[3];
    $model_name = $ARGV[4];
    $alarm_title = $ARGV[5];
    $alarm_id = $ARGV[6];
    $severity = $ARGV[7];
    $cause = $ARGV[8];
    $repair_person = $ARGV[9];
    $server = $ARGV[10];
    $landscape = $ARGV[11];
    $model_handle = $ARGV[12];
    $model_type_handle = $ARGV[13];
    $ip_address = $ARGV[14];
    $security_string = $ARGV[15];
    $alarm_state = $ARGV[16];
    $acknowledged = $ARGV[17];
    $clearable = $ARGV[18];
    $notif_data = $ARGV[19];
    $location = $ARGV[20];
    $asset_owner = $ARGV[21];
    $model_class = $ARGV[22];
    $device_type = $ARGV[23];
    $TopologyModelNameString = $ARGV[24];
    $CollectionModelNameString = $ARGV[25];
    $if_alias = $ARGV[26];
    $if_description = $ARGV[27];
    $sys_uptime = $ARGV[28];
    $snmp_string = $ARGV[29];
    $pcause = $ARGV[30];
    $eventmsg = $ARGV[31];

     

    Then we call subroutine for notification to send email to email recipient which intern sends sms

    sub send_notification {
    $email_cmd = 'mail -s "' . $SUBJECT . '" ' . $email_to . ' <' . " /$Notifier/temp/email." . $alarm_id;
    print "EMAIL Standard Alert: $email_cmd\n";
    system $email_cmd;
    print LOGFILE "EMAIL Standard Alert: $email_cmd\n";
    if ($sms_to ne "") {
    $sms_cmd = 'mail -s "' . $SUBJECT . '" ' . $sms_to . ' <' . " /$Notifier/temp/sms." . $alarm_id;
    print "SMS Standard Alert: $sms_cmd\n";
    system $sms_cmd;
    print LOGFILE "SMS Standard Alert: $sms_cmd\n";
    }
    if ($standby eq "yes") {
    # Left in case we need it again to differentiate against office and not office hours
    if ( ((($week_day < 6) && ($hour > 16 || $hour < 8)) || ($week_day > 5)) && $CollectionModelNameString =~ "Class A" ) {
    $sms_cmd = 'mail -s "' . $SUBJECT . '" ' . $standby_phone . ' <' . " /$Notifier/temp/sms." . $alarm_id;
    print "SMS After Hours Class A Standby Alert: $sms_cmd\n";
    system $sms_cmd;
    print LOGFILE "SMS After Hours Class A Standby Alert: $sms_cmd\n";
    }
    # Same as above Left in case we need it again to differentiate alarms with during office and non office hours
    if ( ($week_day < 6 && ($hour < 16 && $hour > 8)) && $CollectionModelNameString =~ "Class A" ) {
    $sms_cmd = 'mail -s "' . $SUBJECT . '" ' . $standby_phone . ' <' . " /$Notifier/temp/sms." . $alarm_id;
    print "SMS Office Hours Standby Alert: $sms_cmd\n";
    system $sms_cmd;
    print LOGFILE "SMS Office Hours Standby Alert: $sms_cmd\n";
    }
    }
    }



  • 14.  Re: Using perl setscript for alarm notifier

    Posted Mar 07, 2018 01:35 AM

    Hi Klaus,

     

    I have tried what you suggested but i am getting below error .I want to get SMS notification in spectrum by using 3rd parity SMS getway CDAC(https://services.mgov.gov.in/ ).

     

    my spectrum version is 10.2.2(windows server 2008r2).

    I have configured email notification and it is working fine.but my client is asking SMS notification .i have triend everthing like emil notofication process but not getting.so i raised a question in ca communities and i tried with perl script

     

    Please find the perl script which i have run .

    1. go to the %spectrum%/notifier directory.

    2. below is the code to send the sms by using perl script. save the following snippet in a <file_name>.pl file.

    ############################################

    #!/usr/bin/perl -w

    use utf8;
    use strict;
    use LWP::Simple;
    my $uri = $ARGV[0];
    my $response = get $uri;
    print "Response: $response\n";

    #######################################################################

    3. now in setscript (location:- %spectrum%/Notifier) pass the url of your sms gateway.

    ##############################

    use utf8;
    use strict;
    use LWP::Simple;

    my $username = "";
    my $password = "";
    my $send_from = "";
    my $send_to = "";
    my $message_text = "";

    my $URL = "http://websms.smswarehouse.com:7800/websms/webmsg?user=$username&pass=$password&sid=$send_from&mno=$send_to&type=1&esm=0&dcs=0&text=$message_text";

    perl <file_name>.pl $URL

    ####################################################

     

     

    and also followed your comments.still i am getting follwing errors.

     

    Microsoft Windows [Version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation. All rights reserved.

    C:\Users\Administrator>cd C:\win32app\Spectrum\bin

    C:\win32app\Spectrum\bin>perl.exe C:\win32app\Spectrum\Notifier\SetScript

    *****************************************************
    NO NotificationData assigned - no mail sent
    *****************************************************

    ============================================================

    Alarm Notification from SPECTRUM


    Date:
    Time:
    ModelName:
    Severity:
    IPAddress:
    ProbableCause:

    EventMessage:

    ============================================================
    /c/win32app/Spectrum/Notifier/SetScript: line 332: use: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 333: use: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 334: use: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 336: my: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 337: my: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 338: my: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 339: my: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 340: my: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 342: my: command not found
    Can't open perl script "sms.pl": No such file or directory

    C:\win32app\Spectrum\bin>perl.exe C:\win32app\Spectrum\Notifier\sms.pl
    Response:

    C:\win32app\Spectrum\bin>



  • 15.  Re: Using perl setscript for alarm notifier

    Posted Mar 07, 2018 02:31 AM

    Hi 

    Please send me the following files.

    .alarmrc

    setscript

    sms.pl

     

    Regards

    Klaus



  • 16.  Re: Using perl setscript for alarm notifier

    Posted Mar 07, 2018 02:43 AM

    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";

    #######################################################################



  • 17.  Re: Using perl setscript for alarm notifier

    Posted Mar 07, 2018 02:57 AM

    HI

    You CAN NOT use perl commands (below) in the setscript. It is a shell script

    It should be part of the sms.pl

    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";

     

     



  • 18.  Re: Using perl setscript for alarm notifier

    Posted Mar 07, 2018 03:01 AM

    Hi,

    Can  you please provide complete steps to implement SMS notification ????



  • 19.  Re: Using perl setscript for alarm notifier

    Posted Mar 07, 2018 03:27 AM

    Hi

    Try this 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

    username = "adg_ts"
    password = "dspcctns@12"
    send_from = "TSECOP"
    send_to = ""
    message_text = ""

    URL = "http://msdgweb.mgov.gov.in/esms/sendsmsrequest/websms/webmsg?user=$username&pass=$password&sid=$send_from&mno=$send_to&type=1&esm=0&dcs=0&text=$message_text"
    $SPECROOT/bin/perl.exe $SPECROOT/Notifier/sms.pl $URL



  • 20.  Re: Using perl setscript for alarm notifier

    Posted Mar 07, 2018 03:34 AM

    Hi,

    Getting given below error,


    AlarmNotifier 10.2.2.000
    Multiple Landscapes Mode
    SPECTRUM Alarm Notification Manager Enabled

    CA Technologies
    One CA Plaza
    Islandia, NY 11749 USA
    Copyright 2017 CA Technologies All Rights Reserved

    /c/win32app/Spectrum/Notifier/SetScript: line 318: syntax error: unexpected end
    of file
    /c/win32app/Spectrum/Notifier/SetScript: line 318: syntax error: unexpected end
    of file
    /c/win32app/Spectrum/Notifier/SetScript: line 318: syntax error: unexpected end
    of file
    /c/win32app/Spectrum/Notifier/SetScript: line 318: syntax error: unexpected end
    of file
    /c/win32app/Spectrum/Notifier/SetScript: line 318: syntax error: unexpected end
    of file
    /c/win32app/Spectrum/Notifier/SetScript: line 318: syntax error: unexpected end
    of file



  • 21.  Re: Using perl setscript for alarm notifier

    Posted Mar 07, 2018 03:37 AM

    Hi,

    Is it possible to take remote session.



  • 22.  Re: Using perl setscript for alarm notifier

    Posted Mar 07, 2018 03:55 AM

    Hi 

    Sorry. Small syntax mistake

     

    #!/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
    fi

    username = "adg_ts"
    password = "dspcctns@12"
    send_from = "TSECOP"
    send_to = ""
    message_text = ""

    URL = "http://msdgweb.mgov.gov.in/esms/sendsmsrequest/websms/webmsg?user=$username&pass=$password&sid=$send_from&mno=$send_to&type=1&esm=0&dcs=0&text=$message_text"
    C:/win32app/Spectrum/bin/perl.exe C:/win32app/Spectrum/Notifier/sms.pl $URL



  • 23.  Re: Using perl setscript for alarm notifier

    Posted Mar 07, 2018 04:14 AM

    Hi,

    tryied above also getting given below error


    AlarmNotifier 10.2.2.000
    Multiple Landscapes Mode
    SPECTRUM Alarm Notification Manager Enabled

    CA Technologies
    One CA Plaza
    Islandia, NY 11749 USA
    Copyright 2017 CA Technologies All Rights Reserved

    /c/win32app/Spectrum/Notifier/SetScript: line 311: username: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 312: password: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 313: send_from: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 314: send_to: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 315: message_text: command not fou
    nd
    /c/win32app/Spectrum/Notifier/SetScript: line 317: URL: command not found
    Response:
    /c/win32app/Spectrum/Notifier/SetScript: line 311: username: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 312: password: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 313: send_from: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 314: send_to: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 315: message_text: command not fou
    nd
    /c/win32app/Spectrum/Notifier/SetScript: line 317: URL: command not found
    Response:
    /c/win32app/Spectrum/Notifier/SetScript: line 311: username: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 312: password: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 313: send_from: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 314: send_to: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 315: message_text: command not fou
    nd
    /c/win32app/Spectrum/Notifier/SetScript: line 317: URL: command not found
    Response:
    /c/win32app/Spectrum/Notifier/SetScript: line 311: username: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 312: password: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 313: send_from: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 314: send_to: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 315: message_text: command not fou
    nd
    /c/win32app/Spectrum/Notifier/SetScript: line 317: URL: command not found
    Response:
    /c/win32app/Spectrum/Notifier/SetScript: line 311: username: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 312: password: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 313: send_from: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 314: send_to: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 315: message_text: command not fou
    nd
    /c/win32app/Spectrum/Notifier/SetScript: line 317: URL: command not found
    Response:
    /c/win32app/Spectrum/Notifier/SetScript: line 311: username: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 312: password: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 313: send_from: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 314: send_to: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 315: message_text: command not fou
    nd
    /c/win32app/Spectrum/Notifier/SetScript: line 317: URL: command not found
    Response:
    /c/win32app/Spectrum/Notifier/SetScript: line 311: username: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 312: password: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 313: send_from: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 314: send_to: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 315: message_text: command not fou
    nd
    /c/win32app/Spectrum/Notifier/SetScript: line 317: URL: command not found
    Response:
    /c/win32app/Spectrum/Notifier/SetScript: line 311: username: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 312: password: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 313: send_from: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 314: send_to: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 315: message_text: command not fou
    nd
    /c/win32app/Spectrum/Notifier/SetScript: line 317: URL: command not found
    Response:
    /c/win32app/Spectrum/Notifier/SetScript: line 311: username: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 312: password: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 313: send_from: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 314: send_to: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 315: message_text: command not fou
    nd
    /c/win32app/Spectrum/Notifier/SetScript: line 317: URL: command not found
    Response:
    /c/win32app/Spectrum/Notifier/SetScript: line 311: username: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 312: password: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 313: send_from: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 314: send_to: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 315: message_text: command not fou
    nd
    /c/win32app/Spectrum/Notifier/SetScript: line 317: URL: command not found
    Response:
    /c/win32app/Spectrum/Notifier/SetScript: line 311: username: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 312: password: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 313: send_from: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 314: send_to: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 315: message_text: command not fou
    nd
    /c/win32app/Spectrum/Notifier/SetScript: line 317: URL: command not found
    Response:
    /c/win32app/Spectrum/Notifier/SetScript: line 311: username: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 312: password: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 313: send_from: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 314: send_to: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 315: message_text: command not fou
    nd
    /c/win32app/Spectrum/Notifier/SetScript: line 317: URL: command not found
    Response:
    /c/win32app/Spectrum/Notifier/SetScript: line 311: username: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 312: password: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 313: send_from: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 314: send_to: command not found
    /c/win32app/Spectrum/Notifier/SetScript: line 315: message_text: command not fou
    nd
    /c/win32app/Spectrum/Notifier/SetScript: line 317: URL: command not found
    Response:


    AlarmNotifier: Waiting for more alarms from the SpectroSERVERs



  • 24.  Re: Using perl setscript for alarm notifier

    Posted Mar 07, 2018 04:26 AM

    Please try again

     

    #!/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
    fi

    USERNAME="adg_ts"
    PASSWORD="dspcctns@12"
    SEND_FROM="TSECOP"
    SEND_TO=""
    MESSAGE_TEXT=""

    URL="http://msdgweb.mgov.gov.in/esms/sendsmsrequest/websms/webmsg?user=$USERNAME&pass=$PASSWORD&sid=$SEND_FROM&mno=$SEND_TO&type=1&esm=0&dcs=0&text=$MESSAGE_TEXT"
    $SPECROOT/bin/perl.exe $SPECROOT/Notifier/sms.pl $URL



  • 25.  Re: Using perl setscript for alarm notifier

    Posted Mar 07, 2018 04:32 AM

    Hi,

     

    Getting given below ouput only 


    AlarmNotifier 10.2.2.000
    Multiple Landscapes Mode
    SPECTRUM Alarm Notification Manager Enabled

    CA Technologies
    One CA Plaza
    Islandia, NY 11749 USA
    Copyright 2017 CA Technologies All Rights Reserved

    Response:
    Response:
    Response:



  • 26.  Re: Using perl setscript for alarm notifier

    Posted Mar 07, 2018 04:33 AM



  • 27.  RE: Using perl setscript for alarm notifier

    Posted Dec 12, 2012 12:42 PM
    I haven't tested this (I run Spectrum on Linux, where setting the SetScript to a Perl replacement script "just works"), but you might be able to get it to work directly by setting up a file extension association in Windows. If you configure .pl as an application extension in Windows that ties it to the Perl interpreter, that might fix things.

    The version of Windows you're running will determine the easiest way to set/change the file association. Google for "Windows File Associations" and you can find lots of assistance with it.

    Alternately, you can use a shell script wrapper, as someone else suggested.