This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

SDK 1.5 invoke with Perl ?

Hello,

I am just studying the New SDK 1.5 with the examples. I was able to read a node Information and to add a Node with severall properties with the perl client but I am unable to do a invoke operation with perl . Unfortunately there isn't any invoke example in the sample.pl although invoke is defined in the perl module.

I want to add a Node to the NCM. I got the ID from the node but I was unable to add him with perl.

I tried

print $swis->Invoke('Cirrus.Nodes', 'AddNodeToNCM 1485');

What would be the correct syntax for that operation ?

Best regards

  • The version of InformationService.pm distributed with the SDK doesn't have the Invoke operation hooked up correctly. I have updated it and attached a new copy to this reply. I also added an example of how to use it to unmanage a node.

    To add a node to NCM, the call would look like this:

    $swis->Invoke('Cirrus.Nodes', 'AddNodeToNCM', [1485]);

    PerlClient.zip
  • Hello tdanner,

    I tryed the new modul and your syntax for adding a node but I still got an error message.

    print $swis->Invoke ('Cirrus.Nodes','AddNodeToNCM',[1498]);

    2012-07-02 12:39:08,322 [891] ERROR SolarWinds.InformationService.Core.InformationService - Exception caught in method Invoke

    System.ArgumentNullException: Verb Execution requires an array of parameters

    Parameter name: parameters

       at

  • I hate to ask you "are you sure it is plugged in?" But the first troubleshooting step that comes to mind is to check that it Perl is actually loading the updated version of InformationService.pm (attached to my previous message in this thread), because the error you are getting is exactly what you would get with the version that's in SDK 1.5.

  • Hello tdanner,

    you are right! ! I have two different Perl Installations on my System and I updated the module on the secondary version but perl uses by default the primary version  . Now the Invoke was successfull ! :-))).  Thank you for that awesome client, it's really  very, very helpful for us. Stay tuned with the SDK. The last thing one my wish list is a improved documentation of the verbs and the necessary parameters. e.g. I found the Cirrus.ConfigArchive Download Verb in the v3.0 Schema Documentation but I can't use it currently since it needs 3 parameters which I don't know because they are not mentioned anywhere .

    Best regards

    cacao76

  • Sorry for the long delay! This one fell through the cracks.

    The arguments for Cirrus.ConfigArchive.Download are:

    1. NodeIDs - this is an array of the values from the NodeID property of Cirrus.Nodes, which is a GUID. You can query Cirrus.Nodes to look up this guid from the regular Orion integer NodeID values (using the CoreNodeID property of Cirrus.Nodes) or an IP Address.
    2. Config type - generally this will be either Running or Startup, though you can configure NCM to manage other config types.
    3. Username - just put the user you are connecting to SWIS with.

    The tricky part is that I haven't been able to get the perl xml serialization for the array of GUIDs to match up with what the product wants. To get it to work from Perl, I needed to use this syntax:

    $swis->Invoke("Cirrus.ConfigArchive", "Download", [

      SOAP::Data->type('xml' => "<ArrayOfguid xmlns='http://schemas.microsoft.com/2003/10/Serialization/Arrays'><guid>0ef3270e-866f-42ca-8114-f464cd2ffd15</guid></ArrayOfguid>"),

      "Running", "Admin"]);

    You should be able to adapt that to your needs.

  • Hello tdanner,

    Quick question here, can I launch a SWIS verb with Perl Invoke?  I've tried about a dozen iterations and get the same error.  The latest is below.


    print $swis->Invoke('Orion.NPM.Interfaces', 'Orion.NPM.Interfaces.DiscoverInterfacesOnNode', [22]);


    Error:

    2012-10-19 12:11:46,257 [3] ERROR SolarWinds.InformationService.Core.InformationService - Exception caught in method Invoke&#xD;

    SolarWinds.InformationService.Verb.VerbExecutorException: Verb Orion.NPM.Interfaces.Orion.NPM.Interfaces.DiscoverInterfacesOnNode: Not found&#xD;

       at SolarWinds.InformationService.Verb.VerbCache.GetVerbContext(String entity, String verb, VerbExecutor&amp; executor, VerbExecutorContext&amp; context)&#xD;

       at SolarWinds.InformationService.Core.InformationService.Invoke(String entity, String verb, XmlElement[] parameters)&#xD;

    </log></s:Header><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring xml:lang="en-US">Invoke failed, check fault information.</faultstring><detail><InformationServiceFaultContract xmlns="http://schemas.solarwinds.com/2007/08/informationservice" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><Message>Verb Orion.NPM.Interfaces.Orion.NPM.Interfaces.DiscoverInterfacesOnNode: Not found</Message></InformationServiceFaultContract></detail></s:Fault></s:Body></s:Envelope>

    ~Ed

  • For the second parameter to Invoke, you don't need to include the name of the entity again. Try this:

    print $swis->Invoke('Orion.NPM.Interfaces', 'DiscoverInterfacesOnNode', [22]);


  • Hello tdanner,


    I tried what you suggested,

    print $swis->Invoke('Orion.NPM.Interfaces', 'DiscoverInterfacesOnNode', [22]);

    but it still failed:


    2012-10-20 10:08:13,480 [3] ERROR SolarWinds.InformationService.Core.InformationService - Exception caught in method Invoke&#xD;

    SolarWinds.InformationService.Verb.VerbExecutorException: Verb Orion.NPM.Interfaces.DiscoverInterfacesOnNode: Not found&#xD;

       at SolarWinds.InformationService.Verb.VerbCache.GetVerbContext(String entity, String verb, VerbExecutor&amp; executor, VerbExecutorContext&amp; context)&#xD;

       at SolarWinds.InformationService.Core.InformationService.Invoke(String entity, String verb, XmlElement[] parameters)&#xD;

    </log></s:Header><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring xml:lang="en-US">Invoke failed, check fault information.</faultstring><detail><InformationServiceFaultContract xmlns="http://schemas.solarwinds.com/2007/08/informationservice" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><Message>Verb Orion.NPM.Interfaces.DiscoverInterfacesOnNode: Not found</Message></InformationServiceFaultContract></detail></s:Fault></s:Body></s:Envelope>

    Any ideas?

    ~Ed

  • Hi Ed,

    The verb has been introduced first in NPM 10.3, and it is available only using SWIS v3. Since I can see that the error message reports that the verb is not found, I assume that you may be using older NPM version or connecting to SWIS v2.

  • Tom,

    User error.  I didn't have the endpoint syntax correct.  I changed to

    my $endpoint = "https://$hostname:17778/SolarWinds/InformationService/v3/OrionBasic";

    and everything seemed to work correctly.

    Once again, thanks for the help.

    ~Ed