DX Unified Infrastructure Management

Expand all | Collapse all

uim 9.0.2 and Perl nimAlarm/publishQoS ?

David Michel

David MichelMay 07, 2019 08:18 AM

  • 1.  uim 9.0.2 and Perl nimAlarm/publishQoS ?

    Posted Apr 17, 2019 05:32 AM

    Did somebody remark that standalone Perl sources that use the nimAlarm and/or publishQoS functions are not working anymore once running on a fresh UIM 9.0.2 running on Windows 2008r2? (same Perl source running on 8.5.1 sp1 was working fine)

    Not working:

    - qos is not created

    - alarm is not arriving in the console (UMP console or alarmsubconsole)

    When the same Perl is running as probe it is working as expected.



  • 2.  Re: uim 9.0.2 and Perl nimAlarm/publishQoS ?

    Posted Apr 17, 2019 10:39 AM

    Not knowing, asked someone on the services team, and yes in 9.0.2 it is no longer working. To add to that he said the nimAlarm and publishQOS in the /bin directory for 9.0.2 will not run either. Side note, my lab only has nimAlarm. No idea if it is planned on getting fixed. So it looks like a support case will be needed for a dev engagement on this.



  • 3.  Re: uim 9.0.2 and Perl nimAlarm/publishQoS ?

    Posted Apr 17, 2019 04:49 PM

    There is a hotfix version that they fixed Session stuff in a few other things.



  • 4.  Re: uim 9.0.2 and Perl nimAlarm/publishQoS ?

    Posted Apr 17, 2019 05:51 PM

    Savage,

    What is the hotfix file name?



  • 5.  Re: uim 9.0.2 and Perl nimAlarm/publishQoS ?

    Posted Apr 18, 2019 11:43 AM

    SDK Perl 5.10 HF1  - You can reference this case if you need to : 01213351 . I know you can't see it but the Support Engineer who gets the ticket should be able to. 



  • 6.  Re: uim 9.0.2 and Perl nimAlarm/publishQoS ?

    Posted Apr 18, 2019 11:45 AM

    As well we very much utilize Perl over here and i can tell you I have several scripts listening and publishing QoS currently . There would be issues if on a drop of a dime that stuff was removed on our side without deprecation notice .



  • 7.  Re: uim 9.0.2 and Perl nimAlarm/publishQoS ?

    Posted Apr 18, 2019 12:00 PM

    Savage,

    thank you.

     

    Luc,

    The file was already pruned from that case but at least now a case can be opened and the specific info provided to get what you need.

     

    And yes, did check, the online archive still has version 5.10 from 2017.



  • 8.  Re: uim 9.0.2 and Perl nimAlarm/publishQoS ?

    Posted Apr 19, 2019 01:32 AM

    Thanks for the info, will try to get a copy of this hotfix.



  • 9.  Re: uim 9.0.2 and Perl nimAlarm/publishQoS ?

    Posted May 07, 2019 05:30 AM

    I received yesterday a copy of SDK_Perl 5.10 HF1, installed it on 2 different 9.0.2 sp1 images, BUT still no qos and/or nimalarm when generated from standalone Perl. Issue is still open with support.



  • 10.  Re: uim 9.0.2 and Perl nimAlarm/publishQoS ?

    Posted May 07, 2019 08:18 AM

    The support case Savage opened was closed.



  • 11.  Re: uim 9.0.2 and Perl nimAlarm/publishQoS ?

    Posted May 08, 2019 08:52 AM

    The SP1 documentation says it comes with that version, but just in case might want to try using the one added via SP1 rather than the one given.

     

    That said it could be you are facing a different problem, so for your reference here is what was addressed in the case referenced in the SP1 docs and above.

    created a test queue and intend to read alarm_new , alarm_update, alarm_close off the attached queue I have created in my test 

     

    Now the problem is according to the documentation I should be getting 3 arguments back when the hub does it's hubpost . But in reality, I am only getting a array which is expected with 3 results and only 1 of the results has data inside it. 

     

    [root@819848-cauim savage-test]# /opt/nimsoft/perl/bin/perl5.14.2 savage-test.pl 
    $VAR1 = \23122800; 
    $VAR2 = undef; 
    $VAR3 = undef; 
    Nimbus::API::pdsGet_PCH: pds is not a reference at savage-test.pl line 89. 
    [root@819848-cauim savage-test]# 

     

    As you can see this is a Dumper of all arguments : 

     

    $VAR1 = \23122800; 
    $VAR2 = undef; 
    $VAR3 = undef; 



  • 12.  Re: uim 9.0.2 and Perl nimAlarm/publishQoS ?

    Posted May 08, 2019 09:14 AM

    So if your issue is different, provide a copy of the script, what's expected, and what's happening. I don't know, but is this the type of thing that DrNimBUS should be able to capture? Idea is, if there is an output but there is something wrong with it so it is not processed it will be good to have a copy of that. The goal is to detail the problem so the developer can easily understand and reproduce it.



  • 13.  Re: uim 9.0.2 and Perl nimAlarm/publishQoS ?

    Posted May 08, 2019 04:37 PM

    When you create a standalone script or daemon when not running as a probe there is a few things you need to make sure you do let me get a basic outline before hand or the alarm message and qos will be rejected . 

     

    You need to ensure the following variable is set : 

     

    # Reseting this value is very important or the script will use the old data to log back into the first environment even if you undefine the variables so setting this ensure which ip it may log into especially if your hitting multiple domains to get data from one domain and than sending data to another domain. 

     

    nimSetVarStr( $NIMV_CONTIP, $hubaddr );

     

    The $hubaddr is the hub ip that you will be issuing a login into . 

     

    Since this is a dedicated script and not a probe you need to issue a login example : 

     

    Inside Perl let say the hub is on the local loopback:

     

    #!/opt/nimsoft/bin/perl
    use lib "/opt/nimsoft/perllib";         # CA Perl SDK library

    use Nimbus::API;
    use Nimbus::PDS;
    use Nimbus::Session;

    # Some Values I always set in my standalone Scripts / Daemons
    # DEFINE NimVar Constant Field Codes
    my $NIMV_CONTINFO      = 1;
    my $NIMV_CONTIP        = 2;
    my $NIMV_CONTPORT      = 3;
    my $NIMV_DEF_CONTPORT  = 12;
    my $NIMV_DEF_HUBPORT   = 9;
    my $NIMV_DEF_SPOOLPORT = 13;
    my $NIMV_HUBADDR       = 10;
    my $NIMV_HUBDOMAIN     = 11;
    my $NIMV_HUBIP         = 6;
    my $NIMV_HUBNAME       = 16;
    my $NIMV_HUBPORT       = 7;
    my $NIMV_ROBOTIP       = 15;
    my $NIMV_ROBOTNAME     = 8;
    my $NIMV_SID           = 14;
    my $NIMV_SPOOLIP       = 4;
    my $NIMV_SPOOLPORT     = 5

    # DEFINE PDS DATA TYPE CONSTANTS
    my $pds_I    = 1;
    my $pds_PPI  = 3;
    my $pds_PCH  = 7;
    my $pds_PPCH = 8;
    my $pds_F    = 16;
    my $pds_PDS  = 21;
    my $pds_VOID = 22;
    my $pds_PPDS = 24;

    # DEFINE ERROR CODES
    my $NIME_OK      = 0;      # OK
    my $NIME_ERROR   = 1;      # ERROR
    my $NIME_COMERR  = 2;      # Communication error
    my $NIME_INVAL   = 3;      # Invalid argument
    my $NIME_NOENT   = 4;      # Not found
    my $NIME_ISENT   = 5;      # Allready defined
    my $NIME_ACCESS  = 6;      # Permission denied
    my $NIME_AGAIN   = 7;      # Temporarily out of resources
    my $NIME_NOMEM   = 8;      # Out of resources
    my $NIME_NOSPC   = 9;      # No space left
    my $NIME_EPIPE   = 10;     # Broken connection
    my $NIME_NOCMD   = 11;     # Command not found
    my $NIME_LOGIN   = 12;     # Login failed
    my $NIME_SIDEXP  = 13;     # SID expired
    my $NIME_ILLMAC  = 14;     # Illegal MAC
    my $NIME_ILLSID  = 15;     # Illegal SID
    my $NIME_SIDSESS = 16;     # Session id for hub is invalid
    my $NIME_EXPIRED = 17;     # Expired
    my $NIME_NOLIC   = 18;     # No valid license
    my $NIME_INVLIC  = 19;     # Invalid license
    my $NIME_ILLLIC  = 20;     # Illegal license
    my $NIME_INVOP   = 21;     # Invalid operation  finv
    my $NIME_USER    = 100;    # User error from this value and up

    my $hubaddr = 127.0.0.1
    my $username = user
    my $passwrod = password 

     nimSetVarStr( $NIMV_CONTIP, $hubaddr );
    sub login()
    {
        $sid = nimLogin($username, $password);
    }

    sub validateLogin()
    {
        my $current_sid = nimGetCurrentSid();
        if ($sid ne $current_sid)
        {
            nimLogin($username, $password);
        } else {
            #print "Login OK ! \n";
        }
    }

    login();
    validateLogin();

    #Now you should be able to utilize nimAlarm as example : 

    $suppkey = "Test";
    $subsystemid = "4.1"; #Made up sub system you can define your own in the nas
    $alarmsource = "localhost";
    nimAlarm(NIML_CRITICAL, "Test Alarm ", $subsystemid, $suppkey, $alarmsource);

     

    See Page 13

    https://docops.ca.com/ca-unified-infrastructure-management/8-31/en/files/220339116/256214615/1/1438135607070/PERL--Perl%20SDK_12_14.pdf 

     

    Perl Version i am using this code on : 

     

    [root@362407-uim-mon cron]# /opt/nimsoft/bin/perl -v

    This is perl 5, version 14, subversion 2 (v5.14.2) built for x86_64-linux-thread-multi

    Copyright 1987-2011, Larry Wall

    Perl may be copied only under the terms of either the Artistic License or the
    GNU General Public License, which may be found in the Perl 5 source kit.

    Complete documentation for Perl, including FAQ lists, should be found on
    this system using "man perl" or "perldoc perl".  If you have access to the
    Internet, point your browser at http://www.perl.org/, the Perl Home Page.

    [root@362407-uim-mon cron]#
    [root@362407-uim-mon cron]# cat /opt/nimsoft/perllib/
    5.14.2/ auto/   Nimbus/


  • 14.  Re: uim 9.0.2 and Perl nimAlarm/publishQoS ?

    Posted May 09, 2019 03:37 AM

    These are Perl sources that work fine with older versions.

    If I start a 8.5.1sp1 image, the same Perl works fine.  I will add an example source in the issue

    ps. I tried your sample with NimAlarm, and that one doesn't generate a nimalarm in the console



  • 15.  Re: uim 9.0.2 and Perl nimAlarm/publishQoS ?

    Posted May 09, 2019 11:49 AM

    Interesting as we are using 9.02 with perl 5.14 with the sdk and running external scripts and it is working just fine. Let me validated the script as it was pure example to point out the need to use nimSetVarStr when running a external script not as a probe. 



  • 16.  Re: uim 9.0.2 and Perl nimAlarm/publishQoS ?

    Posted May 09, 2019 11:51 AM

    What hub version are you running and the ip you put as example can you check that hub to make sure the user is authing successfully ?



  • 17.  Re: uim 9.0.2 and Perl nimAlarm/publishQoS ?

    Posted May 10, 2019 05:02 AM

    Hub 9.10, UIM 9.1

    ip: 192.168.0.157

    perl: strawberry v5.14.2

    windows 2012r2

    I added the nimSetVarStr string in my existing test Perl (and executed also yours posted above), but this didn't change.

    (I never used that string previously, but in previous versions (8.5.1sp1) qos and nimalarm from standalone Perl did work without problems)

    Strange; what could be changed that with 9.0.2 and 9.1 existing and running external Perl sources don't work anymore? (in my environment)

    Can I have your email so I can mail you my test perl?



  • 18.  Re: uim 9.0.2 and Perl nimAlarm/publishQoS ?

    Posted May 10, 2019 10:47 AM

    Let me upgrade my test environment to 9.1 as this would not be the first time they may have potentially broke a SDK with a new version of the hub.  Another thing to remember is i don't think the SDK will work against a SECURE hub as it looks like infrastructure manager can't even auth against one.  If i was reading the release notes right.



  • 19.  Re: uim 9.0.2 and Perl nimAlarm/publishQoS ?

    Posted May 11, 2019 05:04 AM

    Your hub version hint did me make some tests:

    - uim 8.5.1 sp1 with hub 7.97: no nimalarm perl working

    - deployed hub 7.80: all ok

    - uim 9.1 with hub 7.80: all ok !!

    Seems that hub version after 7.80 did create this problem (will update issue)



  • 20.  RE: Re: uim 9.0.2 and Perl nimAlarm/publishQoS ?

    Posted Jun 03, 2019 08:52 AM
    Support is still investigating


  • 21.  RE: Re: uim 9.0.2 and Perl nimAlarm/publishQoS ?

    Posted Jul 22, 2019 06:34 AM
    Still no solution...


  • 22.  RE: Re: uim 9.0.2 and Perl nimAlarm/publishQoS ?
    Best Answer

    Posted Sep 23, 2019 08:36 AM
    It is confirmed that some hub changes (after version 7.80) did modify the behavior of some Perl functions when running standalone (not as a probe).


  • 23.  RE: Re: uim 9.0.2 and Perl nimAlarm/publishQoS ?

    Posted Mar 24, 2020 09:12 AM
    This problem is fixed in 20.1