DX NetOps

 View Only
Expand all | Collapse all

CA Spectrum 10.1

  • 1.  CA Spectrum 10.1

    Posted Mar 22, 2016 07:56 AM

    Hi Team,

     

    How to configure SMS URL gateway in CA Spectrum 10.1?

     

    Regards,

    Anuj.



  • 2.  Re: CA Spectrum 10.1

    Broadcom Employee
    Posted Mar 22, 2016 10:59 AM

    The requirement is to send SMS from spectrum?

     

    Please check this thread :

    https://communities.ca.com/thread/98346777



  • 3.  Re: CA Spectrum 10.1

    Posted Mar 22, 2016 11:30 AM


  • 4.  Re: CA Spectrum 10.1

    Posted Mar 23, 2016 03:19 AM

    Hi Issac,

     

    I have SMS URL, User Name & Password for SMS gateway but not understand where to use these fields in setscript file.

    Help me to resolve this issue.

     

    Thanks in Advance!



  • 5.  Re: CA Spectrum 10.1
    Best Answer

    Broadcom Employee
    Posted Mar 23, 2016 04:50 AM

    Please check the comment posted on " Jan 7, 2014 6:52 AM" in the thread shared by Isaac08

     

    I am pasting the same content here :

     

    ?  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

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

     

     

     



  • 6.  Re: CA Spectrum 10.1

    Posted Mar 23, 2016 05:19 AM

    Hi Jayakrishna,

     

    Thanks for your reply.

    I used the same code in setscript file but SMS url gateway not working with Spectrum. Kindly share more detail of setscript file by which i follow and resolve this issue.

     

    Thanks,

    Anuj



  • 7.  Re: CA Spectrum 10.1

    Posted Mar 23, 2016 05:33 AM

    Hi

    call below script (saved as sms.pl) in setscript with input parameters,

    #!/usr/bin/perl -w

    use utf8;

    use strict;

    use warnings;

    use LWP::Simple;

    use LWP::UserAgent;

    my $Recipient = $ARGV[0];

    my $msg = $ARGV[1];

    my $msg1 = "$ARGV[2]";

    my $response = get("http\://sms.xyz.com/sendsms\?uname=<usernmae>&pwd=<password>&senderid=TechML&to=".$Recipient."&msg=".$msg."-".$msg1."&route=A");

    print "Response: $Recipient\n";

     

    call with following line item in setscript

    perl sms.pl $NOTIFDATA $MNAME "$ALARMTITLE"

     

    Regards

    Ajit C



  • 8.  Re: CA Spectrum 10.1

    Broadcom Employee
    Posted Mar 23, 2016 07:31 AM

    Could you please try executing only  sms.pl by hardcoding the required values such as $Recipient,$msg etc

    & try perl sms.pl

    What is the output of $response?

     

     

     



  • 9.  Re: CA Spectrum 10.1

    Posted Mar 28, 2016 12:08 AM

    Hi Jayakrishna,

     

    I am not understand by perl language. When I am trying to compile the sms.pl file faced few errors. Please send me the complete sms.pl file where i need to edit sms url, username and password.

     

    Thanks in Advance!

    Anuj



  • 10.  Re: CA Spectrum 10.1

    Posted Mar 29, 2016 03:10 AM

    Hi,

    When i am trying to compile the sms.pl file following error occured. Please help me to resolve this issue.

    Thanks,

    Anuj



  • 11.  Re: CA Spectrum 10.1

    Posted Mar 29, 2016 07:10 AM

    You don't compile perl script. You just run it. The message you are getting is self explanatory: uninitialized value $response in concatenation... line 13.

     

    Check the line 13 to see what it contains. If you have the script similar with what Ajit presented before, the $response would be the error message received back from the SMS sending engine or whatever you're using for sending SMS.

     

    If you're using the script above presented, you should specify also the specified parameters in the given example: "perl sms.pl $NOTIFDATA $MNAME "$ALARMTITLE"" or at least some values to test that is working properly. There are no error check mechanisms implemented in the script.



  • 12.  Re: CA Spectrum 10.1

    Broadcom Employee
    Posted Mar 30, 2016 12:22 AM

    I did small modification in the script to print error message :

     

    #!/usr/bin/perl -w

    use utf8;
    use strict;
    use warnings;
    use LWP::Simple;
    use LWP::UserAgent;

    my $Recipient = $ARGV[0];
    my $msg = $ARGV[1];
    my $msg1 = $ARGV[2];

    my $response = get("http\://sms.xyz.com/sendsms\?uname=<usernmae>&pwd=<password>&senderid=TechML&to=".$Recipient."&msg=".$msg."-".$msg1."&route=A") || die "get didn't run:\n$!\n";
    print "Response: $response\n";

     

    Make sure the url in the get method is correct  & run the script  eg : perl  sms.pl  recipient msg msg1  ( replace with appropriate values)



  • 13.  Re: CA Spectrum 10.1

    Posted Mar 30, 2016 12:34 AM

    Hi,

     

    Also be sure that

    ALARMTITLE=`echo "$PCAUSE" | /usr/bin/head -1`

     

    is added in setscript to create only alarm title from probable cause of alarm, because this is the 3rd argument that we are passing to the sms.pl script.

     

    Regards

    Ajit C