Quantcast
Channel: THWACK: Popular Discussions - Orion SDK
Viewing all 3719 articles
Browse latest View live

New SDK Version Available - SDK 1.3

$
0
0

Can be accessed here.  Can only be used with NPM 10.1.2 and above.

Adds additional product support and some basic invoke/write capabilities.  


Problem consuming wsdl

$
0
0

I'm attempting to consume the wsdl in perl.  I've generated the 'InformationService' package and succesfully managed to deal with the lack of an ssl-certificate and connect to the service.

 

All I'm attempting to do at the moment is replicate the getOneAlert function from the sample Java client.  As far as I can tell, I am successfully sending the soap request to our server, but I am getting an http 500 response with the following faultcode:

 

The message with Action '#QueryXml' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver.  Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).

 

Any suggestions as to what might be the cause this?  I'm at a loss at the moment.

SWQL and PERL using SOAP

$
0
0

I am using the Perl interface example for the SWQL access.

I am trying to run a query against the Orion.ResponseTime table, here is what the query looks like:


SELECT  NodeID, DateTime, Archive, AvgResponseTime, MinResponseTime, MaxResponseTime, PercentLoss, Availability

FROM Orion.ResponseTime

WHERE NodeID = 28

AND DateTime = (SELECT max(DateTime) as DT

                             FROM Orion.ResponseTime

                          WHERE NodeID = 28 AND Availability < 50)

AND Availability< 50

 

This Query runs perfectly SWQL Studio, but when I put it into the Perl script and do the call using the $swis->QueryXml( $sql, {} );

It fails completely.  I have narrowed the problem down to the < and > symbols which are passed through SOAP and are translated into &lt; and &gt; when being passed.

                                

I even tried to utilize "BETWEEN 0 AND 50" and but the SWQL does not recognize the BETWEEN command.  I even tried replacing the < and > with LT and GT, and even tried to use &lt and &gt.  I also tried to wrap the sql in     $sql = "<![CDATA[$sql]]>";  with no success.

 

Does anyone have any other solutions that work? 

 

Attached is the exact message I am receiving.

 

Thank you,

Charles

Why do Advance alert triggers change the SWQL results?

$
0
0

Please can someone tell me why changing the advance alert triggers would change the results fetched using the SWQL?

 

A brief description of my situation

The advance alert manager was set up to send an email when a node is down, unknown or unreachable, I have replaced this with an application that returns data using the swql when a node is down, unknown or unreachable, the application has been working fine but when I disabled the triggers that have been previously used the send the email the the SWQL does not fetch anything. I suspect the trigger that sent the email when the nodes went down automatically created a log in the same database that is used with the SWQL?

 

Has anyone experienced something like this or can someone confirm what I think has appended.

 

Thank you.

set property on, or unmanage Thin wireless access point

$
0
0

Is there SDK-way to set a wireless access point as 'unmanaged' ?

 

I notice there is a field in the Wireless access points table to indicate the AP is Unmanaged

 

Thanks

 

Richardsdk

Problems with QueryXml when using a more complex query with multiple tables in c# from CSClient

$
0
0

I am trying to modify the CSClient code that is provided in the SDK to fetch data via QueryXml with more than one table in the query.

The problem I am having is when I try include another table data I get this error " An unhandled exception of type 'System.NullReferenceException' occurred in CSClient.exe Additional information: Object reference not set to an instance of an object." What is the best way to fetch data based on my query so I can select individual nodes such as "alert.NodeID"  I am wanting to pull the data and insert it into a local MySQL database you see.

 

Any help or advice would be appreciated.

 

static void Main()

        {

            const string hostname = "";

            const string username = "";

            const string password = "";

           

            ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, errors) => true;

 

            var client = new InformationServiceClient("BasicHttpBinding_InformationService",

                                                      string.Format("https://{0}:17778/SolarWinds/InformationService/OrionBasic", hostname));

            client.ClientCredentials.UserName.UserName = username;

            client.ClientCredentials.UserName.Password = password;

            client.Open();

 

            var result = client.QueryXml("SELECT Interfaces.FullName, Interfaces.NodeID, Nodes.IPAddress FROM Orion.NPM.Interfaces INNER JOIN Orion.Nodes ON Interfaces.NodeID = Nodes.NodeID WHERE Interfaces.Status <> '1' RETURN XML AUTO", null);

 

            var element = result.XPathSelectElement("//*[local-name()='Interfaces']");

            var element2 = result.XPathSelectElement("//*[local-name()='Nodes']");

 

            var alert = new AlertInfo

            {

                FullName = element.ElementAnyNS("FullName").Value,

                NodeID = element.ElementAnyNS("NodeID").Value,

                IPAddress = element2.ElementAnyNS("IPAddress").Value,

            };

           

            var alerts = new[] {alert};

           

            var dcs = new DataContractSerializer(alerts.GetType());

            var doc = new XmlDocument();

            using (var writer = doc.CreateNavigator().AppendChild())

            {

                dcs.WriteObject(writer, alerts);

            }

 

            /*

            var arguments = new ArrayOfXmlElement {XDocument.Load(new XmlNodeReader(doc)).Root};

            var result2 = client.Invoke("Orion.AlertStatus", "Acknowledge", arguments);

            */

            //Console.Write(result2);

            Console.WriteLine("FullName: " + alert.FullName);

            Console.WriteLine("NodeID: " + alert.NodeID);

            Console.WriteLine("IPAddress: " + alert.IPAddress);

           

            client.Close();

            Console.ReadLine();

        }

 

        [DataContract(Name = "AlertInfo", Namespace = "http://schemas.solarwinds.com/2008/Orion")]

        public class AlertInfo

        {

            [DataMember(Order = 1)]

            public string FullName;

 

            [DataMember(Order = 2)]

            public string NodeID;

 

            [DataMember(Order = 3)]

            public string IPAddress;

        }

Accessing custom poller data via the API?

$
0
0

I'm curious if it's possible to access the data returned from an NPM custom poller via the API?

 

I can see the custom poller configuration via SWQL, but am stumped on a way to query the datastore programatically.....

 

Many thanks for any guidance.

Orion SDK & Java

$
0
0

Started to play around with the SDK under Java, and so far it works pretty fine. Packaged the Orion SDK in an utility project, created a few wrapper classes, externalized the SWIS parameters (user, password, host, etc...) into an encrypted properties file, ran a few unit tests, so far so good!

Few remarks/questions though:

1. A self-signed certificate for a WS is not an option in a SOA corporate environment. Whats the proper way of updating the SWIS certificate (I should mention I know nothing about .NET...) ? Is updating the SolarWinds.InformationService.Service.exe.config file to point to another certificate in the TrustStore enough ? And if so, do you plan on making this modular/configurable ? Changing the config file is subject to possible loss of the changes every time an upgrade or fix is applied...

2. Any plans to release CRUD interfave to Java soon ? Ultimately what am really looking for is the ability to publish a WS allowing to create a NPM or IPAM Node/Group. That would really distinguish Orion from competitors by allowing deeper integration in corporate environments

3. JDK compliance. It is mentioned that JDK6 is required. However I can see this has been compiled with JAX-RS 2.1, which is available is most app server containers running JDK 1.5. Actually I deployed it to JBoss 5.1 with JDK 1.5 and so far everything works fine. Have you identified some problems with 1.5 yet ?

This is all really promising, cannot wait for the possibility for CRUD operations through Java / SOA !

Thanks and Regards


"An error occurred when verifying security for the message" error in SWQL studio...

$
0
0

Came back from vacation and now have this error "An error occurred when verifying security for the message" when connecting to SWQL studio.

I can still log in fine from my .NET app that uses a web reference to SWIS and Orion Web Console connects and works fine from Orion server and remote boxes.

SolarWinds Orion Core 2011.1.1, NPM 10.1.3, IVIM 1.1.2 

SolarWinds Orion SDK 1.2

Any ideas?

Solarwinds Information Service - Enable for External API Access

$
0
0

I've recently installed the Orion SDK and I want to be able to use the SWIS from various machines on our network.

 

I think I need to change the config file so the tcp service on 17777 isn't bound to only localhost any more (hence enabling remote access) but I can't find any documentation on how to do it in the latest NPM/APM version (APMv5??). I found this old knowledgebase link but does anyone have anything more up to date?

 

http://knowledgebase.solarwinds.com/kb/questions/1992/How+to+change+the+host+name+used+by+the+Orion+SDK+to+connect+to+the+SolarWinds+Information+Service+%28SWIS%29

 

Thanks,

 

Henri

Orion SDK, Add network interface and Volumes

$
0
0

Hi,

First of all, thanks for the great SDK you provide :d). I'm using the powershell api, and it works fine.

I have several questions about how to add network interface and volumes for monitoring.

My problem is how to find the network interface index and name, and how to find the volumes index and caption; Is there a way to collect them using API as in the web interface when we click on List Resources?

My second question is about when I had a volume (I get the index and the name manually) and I'm using the API (following code), i have an error on Volume Polling Details : The "Volume Polling Details " resource threw an exception..
Specified cast is not valid.

 

powershell Code:

$newVolProps = @{
 NodeID=$nodeProps["NodeID"]; # NodeID on which the interface is working on
 VolumeIndex=[int]$VolumeIndex;
 Status=0;
 Type ="Fixed Disk";
 Icon ="FixedDisk.gif";
 Caption=$VolumeCaption;
 VolumeDescription=$VolumeDescription;

 }
 $newVolUri = New-SwisObject $swis –EntityType "Orion.Volumes" –Properties $newVolProps
 $VolProps = Get-SwisObject $swis -Uri $newVolUri
 # register specific pollers for the node
 # Disk Poller
 
 $poller = @{
 PollerType="Poller_VO";
 NetObject="V:"+$VolProps["VolumeID"]
 }
 $pollerUri = New-SwisObject $swis -EntityType "Orion.Pollers" -Properties $poller

 

thanks for your help

Automated creation of NPM server nodes including specific node resources

$
0
0

I have a PS script that utilizes both the SDK and the Internet Explorer PS Object.  The script does the following:

Script Input Arguments:  Script Action (Currently just adds, but in the future it would delete, modify custom props, etc...), Node Name, Node's IP Address, Orion Poller name, server profile csv file (contains the custom properties to populate).  Powershell syntax:

Script Requirements: 

  • Discovery profile to be used by the script only.  The profile should include the SNMP strings required to add an SNMP node. Currently this is hard coded in the script.
  • csv File that contains custom property names as headers and the property values.  The custom property fields need to already exist.  You can modify the script fairly easily to read in your custom props.
  • (optional) a logfile name/path hard coded in the script that outputs script process and actions.
  • Internet Explorer browser (tested on v8 and v9)
  • I have not tested this on an NPM SSL website.

Script Syntax: <script name> add <node (server) name> <node IP Address> <Orion Poller Name> <server Profile Name>

Script Process Overview:

  • Prompts for SW credentials - Can be modified to use specific credentials without prompting.
  • Reads in arguments
  • Connects to Orion instance on the poller name specified.
  • Reads the custom properties from the csv file into a hash table
  • Starts discovery process
    • Modifies the discovery profile (currently coded in the script) and changes the discovery scope to only scan the IP address of the node (using the node's IP address argument)
    • logs into website using previously supplied credentials
    • Starts running the discovery scan using the modified discovery profile.
    • Adds the discovered node including it's resources found during the discovery.
    • Verifies the node has been added.
  • Updates the node's custom properties with the values from the csv file.
  • Removes specific node resources.  (I used this to remove the many virtual adapters found on Windows 2008 servers), but can be modified to remove other node resources as well.

 I don't want to post the script yet because I would like it to be more scripter friendly, but contact me if you are interested.

Chris

Adding an SNMP node with SDK, but SNMP details never populate

$
0
0

Hi all,

We're using the SDK and a powershell script to create a SNMP node. When I use SWQL Studio to compare the node added via the script to one added via the admin GUI, the details look pretty much identical, except that the SNMP fields like NodeDescription, SysName, Vendor, SysObjectID and so on, never get populated on the node we add via the script. Here's our code snippit (we're passing in nodename, IPaddress as command line args to the script):

 $newNodeProps = @{
  EntityType="Orion.Nodes";
  IPAddress=$args[1];
  Caption=$args[0];
  DynamicIP=$False;
  EngineID=1;
  Status=1;
  UnManaged=$False;
  Allow64BitCounters=$False;
  ObjectSubType="SNMP";
  SysObjectID="";
  MachineType="";
  VendorIcon="";
  SNMPVersion=2;
  Community="public";
  PollInterval=120;
  StatCollection=10;
  RediscoveryInterval=30;
 }

 $newNodeUri = New-SwisObject $swis -EntityType "Orion.Nodes" -Properties $newNodeProps
 $nodeProps = Get-SwisObject $swis -Uri $newNodeUri

 # Windows/UNIX
 $poller = @{
  PollerType="Poller_HT";
  NetObject="N:"+$nodeProps["NodeID"]
 }
 $pollerUri = New-SwisObject $swis -EntityType "Orion.Pollers" -Properties $poller

 

So even when we've added a node via this method and tried to manually issue a "rediscover" in the Node Management context in the GUI, the fields still don't populate (yet it claims the rediscover completes). Am I missing something here? Only thing i can see via SWQL that might be relevant is the "NextRediscovery" field on the script added node is "1/1/0001 12:00" but the same field in the GUI added node is up to date.

NPM Connection Error Using SDK 10.1

$
0
0

Team,

 

We are currently able to connect to the NPM v 10.1 via your SDK(not sure of the SDK verion here) to retrieve any alerts and pull them into our system. At times, for some unknown reason that I would like to understand, we are not able to connect at all. This just happens out of the clear blue sky.

 

I would like to understand if this is a result of devices changing or what. The last time I saw this error, I blew away my database and started fresh and it began to connect again. Is there some configuration change that needs to take place? I think there is another answer other than starting fresh each time I get these errors:

 

"java.lang.IllegalArgumentException: 9" is one that I have seen before and also "java.lang.IllegalArgumentException: 10". I would love to understand what this means and how to fix it. Again....this works for a while, then I'm assuming maybe devices change and it affects how we connect somehow? Errors below...

 

2013-03-24 00:24:08,151 -:- Caught exception

java.lang.IllegalArgumentException: 9

    at com.ray.sv.smc.orion.collector.OrionAvailability.fromValue(OrionAvailability.java:58)

    at com.ray.sv.smc.orion.collector.OrionNodeCollector.collectNodeAvailability(OrionNodeCollector.java:126)

    at com.ray.sv.smc.orion.collector.OrionNodeCollector.collectStatus(OrionNodeCollector.java:72)

    at com.ray.sv.smc.orion.offering.NodeWarehouse.collectNodes(NodeWarehouse.java:77)

    at com.ray.sv.smc.orion.offering.NodeWarehouseLocator$1.run(NodeWarehouseLocator.java:124)

    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)

    at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)

    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)

    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)

    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)

    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)

    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

    at java.lang.Thread.run(Thread.java:662)

2013-03-24 00:24:08,151 -:- Creating Solarwinds Orion node collector for

2013-03-24 00:24:08,259 -:- No Orion status

-----------------------------------------------------------------------------------------------------------------------------------------------------------------

 

2013-03-24 00:23:59,275 -:- Caught exception

java.lang.IllegalStateException: Failed to create node collector

    at com.ray.sv.smc.orion.offering.NodeCollectorFactory$NodeCollectorImpl.<init>(NodeCollectorFactory.java:50)

    at com.ray.sv.smc.orion.offering.NodeCollectorFactory.createNodeCollector(NodeCollectorFactory.java:36)

    at com.ray.sv.smc.orion.offering.NodeWarehouse.collectNodes(NodeWarehouse.java:65)

    at com.ray.sv.smc.orion.offering.NodeWarehouseLocator$1.run(NodeWarehouseLocator.java:124)

    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)

    at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)

    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)

    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)

    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)

    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)

    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

    at java.lang.Thread.run(Thread.java:662)

Caused by: javax.xml.ws.WebServiceException: The following WSDL exception occurred: WSDLException: faultCode=WSDL4JWrapper : : javax.wsdl.WSDLException: WSDLException: faultCode=WSDL4JWrapper : : java.net.ConnectException: Connection refused: connect

    at org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(ExceptionFactory.java:173)

    at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:70)

    at org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.setupWsdlDefinition(ServiceDescriptionImpl.java:1054)

    at org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.<init>(ServiceDescriptionImpl.java:226)

    at org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.<init>(ServiceDescriptionImpl.java:156)

    at org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.createServiceDescription(DescriptionFactoryImpl.java:133)

    at org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.createServiceDescription(DescriptionFactoryImpl.java:79)

    at org.apache.axis2.jaxws.description.DescriptionFactory.createServiceDescription(DescriptionFactory.java:76)

    at org.apache.axis2.jaxws.spi.ServiceDelegate.<init>(ServiceDelegate.java:212)

    at org.apache.axis2.jaxws.spi.Provider.createServiceDelegate(Provider.java:59)

    at javax.xml.ws.Service.<init>(Service.java:56)

    at org.tempuri.InformationService_Service.<init>(InformationService_Service.java:42)

    at com.ray.sv.smc.orion.collector.OrionConnection.<init>(OrionConnection.java:78)

    at com.ray.sv.smc.orion.offering.NodeCollectorFactory$NodeCollectorImpl.<init>(NodeCollectorFactory.java:46)

    ... 12 more

Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=WSDL4JWrapper : : javax.wsdl.WSDLException: WSDLException: faultCode=WSDL4JWrapper : : java.net.ConnectException: Connection refused: connect

    at org.apache.axis2.jaxws.util.WSDL4JWrapper.commonPartsURLConstructor(WSDL4JWrapper.java:234)

    at org.apache.axis2.jaxws.util.WSDL4JWrapper.<init>(WSDL4JWrapper.java:156)

    at org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.setupWsdlDefinition(ServiceDescriptionImpl.java:1034)

    ... 23 more

Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=WSDL4JWrapper : : java.net.ConnectException: Connection refused: connect

    at org.apache.axis2.jaxws.util.WSDL4JWrapper.commonPartsURLConstructor(WSDL4JWrapper.java:203)

    ... 25 more

Caused by: java.net.ConnectException: Connection refused: connect

    at java.net.PlainSocketImpl.socketConnect(Native Method)

    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)

    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)

    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)

    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)

    at java.net.Socket.connect(Socket.java:529)

    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:564)

    at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:141)

    at sun.net.NetworkClient.doConnect(NetworkClient.java:163)

    at sun.net.www.http.HttpClient.openServer(HttpClient.java:395)

    at sun.net.www.http.HttpClient.openServer(HttpClient.java:530)

    at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:272)

    at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:329)

    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:172)

    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:911)

    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:158)

    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1172)

    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:234)

    at org.apache.axis2.jaxws.util.WSDL4JWrapper$14.run(WSDL4JWrapper.java:973)

    at org.apache.axis2.java.security.AccessController.doPrivileged(AccessController.java:132)

    at org.apache.axis2.jaxws.util.WSDL4JWrapper.getInputStream(WSDL4JWrapper.java:970)

    at org.apache.axis2.jaxws.util.WSDL4JWrapper.commonPartsURLConstructor(WSDL4JWrapper.java:189)

    ... 25 more

2013-03-24 00:24:00,259 -:- No Orion status

Imported Nodes SNMPv2 get discovered SNMPv1 not

$
0
0

Hi Folks,

 

when I add nodes through a script and tell it to use SNMPv1 they are not being fully discovererd by Orion (OID etc. is missing)

when adding Nodes with SNMPv2 this works like a charm.

 

Any Ideas?

 

The relevanrt Script snippetis shown below, when I change the Bold vaule to 1 the node does not get rediscovered.

 

 

if ($NewNodeCounter){

    foreach($entry in $NewNodelist){

        $newNodeProps = @{

          EntityType="Orion.Nodes";

          IPAddress=$($entry.IP_ADRESSE);

          Caption=$($entry.KOMPONENTE);

          DynamicIP=$False;

          EngineID=$($NewNodeCounter %3 +1);

          Status=1;

          UnManaged=$False;

          Allow64BitCounters=$True;

          Institutsnummer=$($entry.INSTITUT);

        Geraete_Gruppe=$($entry.LOCATION);

        Maintenance=$($entry.MAINTENANCE);

        DNS_IP=$($entry.DNSIPADRES);

        Zugriff=$($entry.ACCESS);

        Institutsname=$($entry.CAM_SI_INSTITUTNAME);

        Geschaeftsstelle=$($entry.Z_BUILDING);

        PLZ=$($entry.BUI_ZIP_CODE);

        Ort=$($entry.BUI_LOCATION);

        Strasse=$($entry.BUI_STREET_AND_NO);

        

            # SNMP v2 specific

          ObjectSubType="SNMP";

          SNMPVersion=2;

          Community=$($entry.COMMUNITY_RO);

            RediscoveryInterval="15";

  }

    $Script:NewNodeCounter--

 

 

    $newUri = New-SwisObject $target –EntityType "Orion.Nodes" –Properties $newNodeProps

    $newNode = Get-SwisObject $target -Uri $newUri

  

    # register specific pollers for the node

    $poller = @{

    NetObject="N:"+$newNode["NodeID"];

    NetObjectType="N";

    NetObjectID=$newNode["NodeID"];

    }

       

    # Details

    $poller["PollerType"]="N.Details.SNMP.Generic";

    $pollerUri = New-SwisObject $target -EntityType "Orion.Pollers" -Properties $poller

  

        # Uptime

    $poller["PollerType"]="N.Uptime.SNMP.Generic";

    $pollerUri = New-SwisObject $target -EntityType "Orion.Pollers" -Properties $poller


Imported Node into Orion from Perl but it does not appear in Manage Nodes

$
0
0

I used one of the sample scripts from the SDK that was provided.  I successfully added the node, I can see it in the database itself and in my listing of nodes in the "All Nodes" tree on my SW Home page.  This issue is then I go to Manage Nodes in Admin > Node Mangement > Manage Nodes.  Any node I add from perl does not appear, see screen shot:

 

Solarwindsmissingnode.PNG

 

Note that I did not assign a vendor hence the Vendor showing up as unknown.  What property am I missing that would allow me to see a node here similar to one added from the GUI?

 

My code... Its pretty much just what was in the example aside from username, password, ip addressing stuff I removed.

 

 

use SW::InformationService;

use SW::Orion;

use SOAP::Lite;

 

 

my $hostname = "xx.xx.xx.xx"; # fill in a hostname

my $username = "username";

my $password = "password";

 

 

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

my $swis = SW::InformationService->new();

$swis->outputxml("true");

$swis->proxy($endpoint);

$swis->proxy->ssl_opts(verify_hostname => 0);

$swis->proxy->http_request->authorization_basic($username, $password);

 

 

# Example of Create operation: Add a new node.

# Important: This is just an example of how to call Create operation. List of properties

#   is not complete and needs to be filled in with valid values.

# See 'Orion SDK.pdf' for more details on how to properly add a node.

print $swis->Create('Orion.Nodes', {

   'Caption'=>'TestNodeFromPerl2',

   'IPAddress'=>'x.x.x.x',

   'IPAddressGUID'=>ip2guid('x.x.x.x')

    });

 

Edit:

 

To add a little mode detail I am able to search for the nodes I added as well named "TestNodeFromPerl", was able to find them via a search. 

 

After a little more trial and error and messing with the database I learned a little more about whats going on.  What I'm looking for is the set of tables or objects I need that will mimic the process of adding a node similar to the GUI to get the full functionality. 

 

Thanks

Please help to conver SQL to SWQL

$
0
0


Can anyone help me to convert below SQL query to  SWQL,

 

Select Nodes.nodeID, Nodes.Caption as NodeName,Nodes.StatusDescription As Status, DATEDIFF(hh, DATEADD(hh,-5, LastSystemUpTimePollUtc), GetDate()) as [Down Time], Convert(varchar, DATEADD(hh,-5, LastSystemUpTimePollUtc),110) As [Last Date Up]

From Nodes
where
Nodes.Status != '1' and
DATEDIFF(Mi, DATEADD(hh,-5, LastSystemUpTimePollUtc), GetDate())>=180
Order by [Down Time] Asc

 

I am able to fetch the result on web page by using "Select Nodes.nodeID, Nodes.Caption as NodeName,Nodes.StatusDescription As Status From Orion.Nodes"

But i am not able to find right  query for  "Down Time" and  "last date Up"

Problems with QueryXml when using a more complex query with multiple tables in c# from CSClient

$
0
0

I am trying to modify the CSClient code that is provided in the SDK to fetch data via QueryXml with more than one table in the query.

The problem I am having is when I try include another table data I get this error " An unhandled exception of type 'System.NullReferenceException' occurred in CSClient.exe Additional information: Object reference not set to an instance of an object." What is the best way to fetch data based on my query so I can select individual nodes such as "alert.NodeID"  I am wanting to pull the data and insert it into a local MySQL database you see.

 

Any help or advice would be appreciated.

 

static void Main()

        {

            const string hostname = "";

            const string username = "";

            const string password = "";

           

            ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, errors) => true;

 

            var client = new InformationServiceClient("BasicHttpBinding_InformationService",

                                                      string.Format("https://{0}:17778/SolarWinds/InformationService/OrionBasic", hostname));

            client.ClientCredentials.UserName.UserName = username;

            client.ClientCredentials.UserName.Password = password;

            client.Open();

 

            var result = client.QueryXml("SELECT Interfaces.FullName, Interfaces.NodeID, Nodes.IPAddress FROM Orion.NPM.Interfaces INNER JOIN Orion.Nodes ON Interfaces.NodeID = Nodes.NodeID WHERE Interfaces.Status <> '1' RETURN XML AUTO", null);

 

            var element = result.XPathSelectElement("//*[local-name()='Interfaces']");

            var element2 = result.XPathSelectElement("//*[local-name()='Nodes']");

 

            var alert = new AlertInfo

            {

                FullName = element.ElementAnyNS("FullName").Value,

                NodeID = element.ElementAnyNS("NodeID").Value,

                IPAddress = element2.ElementAnyNS("IPAddress").Value,

            };

           

            var alerts = new[] {alert};

           

            var dcs = new DataContractSerializer(alerts.GetType());

            var doc = new XmlDocument();

            using (var writer = doc.CreateNavigator().AppendChild())

            {

                dcs.WriteObject(writer, alerts);

            }

 

            /*

            var arguments = new ArrayOfXmlElement {XDocument.Load(new XmlNodeReader(doc)).Root};

            var result2 = client.Invoke("Orion.AlertStatus", "Acknowledge", arguments);

            */

            //Console.Write(result2);

            Console.WriteLine("FullName: " + alert.FullName);

            Console.WriteLine("NodeID: " + alert.NodeID);

            Console.WriteLine("IPAddress: " + alert.IPAddress);

           

            client.Close();

            Console.ReadLine();

        }

 

        [DataContract(Name = "AlertInfo", Namespace = "http://schemas.solarwinds.com/2008/Orion")]

        public class AlertInfo

        {

            [DataMember(Order = 1)]

            public string FullName;

 

            [DataMember(Order = 2)]

            public string NodeID;

 

            [DataMember(Order = 3)]

            public string IPAddress;

        }

NCM Node Details

$
0
0

Hi folks,

I have a question. I created a node for NCM via SWIS and C# code but any information doesn't shown on Node Details section. Is there any requirement fields/properties to fill (like Caption, Location etc..) when creating a node via SWIS?

 

My code block is below:

 

                Dictionary<string, string> _dic = new Dictionary<string, string>();

                _dic.Add("ObjectSubType", "SNMP");

                _dic.Add("SNMPVersion", "2");

                _dic.Add("IPAddress", "192.168.1.254");

                _dic.Add("Caption", "");

                _dic.Add("SysName", "");

                _dic.Add("Contact", "");

                _dic.Add("Location", "");

                _dic.Add("PercentMemoryUsed", "-2");

                _dic.Add("MemoryUsed", "-2");

                _dic.Add("CPULoad", "-2");

                _dic.Add("Community", "<community>");

                _dic.Add("EngineID", "2");

                _dic.Add("DynamicIP", "false");

                _dic.Add("MachineType", "");

                _dic.Add("Allow64BitCounters", "true");

 

          string uri = npc.AddNode(pbn);    

SWIS REST/JSON API

$
0
0

Starting with NPM 10.4, SWIS now supports a REST/JSON API in addition to the existing SOAP API. The operations supported by each API are identical: the six basic operations of Query, Invoke, Create, Read, Update, and Delete; and the data you can access through each API is the same. The difference is that the REST/JSON API avoids the complexities of XML and SOAP, though it gives up the ability to have a client wrapper generated from WSDL.

 

Both APIs will be supported by the product indefinitely - the SOAP API is not deprecated or replaced by the REST API.

 

Request and Response Formats

Query

Request

GET https://localhost:17778/SolarWinds/InformationService/v3/Json/Query?query=SELECT+Uri+FROM+Orion.Pollers+ORDER+BY+PollerID+WITH+ROWS+1+TO+3+WITH+TOTALROWS HTTP/1.1
Authorization: Basic YWRtaW46
User-Agent: curl/7.20.0 (i386-pc-win32) libcurl/7.20.0 OpenSSL/0.9.8l zlib/1.2.3
Host: localhost:17778
Accept: */*

Response

HTTP/1.1 200 OK
Content-Length: 244
Content-Type: application/json
Server: Microsoft-HTTPAPI/2.0
Date: Fri, 27 Jul 2012 19:38:52 GMT
{"totalRows":13,"results":[{"Uri":"swis://tdanner-dev.swdev.local/Orion/Orion.Pollers/PollerID=4"},{"Uri":"swis://tdanner-dev.swdev.local/Orion/Orion.Pollers/PollerID=6"},{"Uri":"swis://tdanner-dev.swdev.local/Orion/Orion.Pollers/PollerID=7"}]}

Body reformatted for easier reading
{

 

    "totalRows": 13,

    "results": [

        { "Uri": "swis://tdanner-dev.swdev.local/Orion/Orion.Pollers/PollerID=4"},

        { "Uri": "swis://tdanner-dev.swdev.local/Orion/Orion.Pollers/PollerID=6"},

        { "Uri": "swis://tdanner-dev.swdev.local/Orion/Orion.Pollers/PollerID=7"}

    ]

}

Query with Parameters

Request

POST https://localhost:17778/SolarWinds/InformationService/v3/Json/Query HTTP/1.1
Authorization: Basic YWRtaW46
User-Agent: curl/7.20.0 (i386-pc-win32) libcurl/7.20.0 OpenSSL/0.9.8l zlib/1.2.3
Host: localhost:17778
Accept: */*
Content-Type: application/json
Content-Length: 130
{"query":"SELECT Uri FROM Orion.Pollers WHERE PollerID=@p ORDER BY PollerID WITH ROWS 1 TO 3 WITH TOTALROWS","parameters":{"p":9}}

Response

HTTP/1.1 200 OK
Content-Length: 99
Content-Type: application/json
Server: Microsoft-HTTPAPI/2.0
Date: Tue, 07 Aug 2012 17:36:27 GMT
{"totalRows":1,"results":[{"Uri":"swis://tdanner-dev.swdev.local/Orion/Orion.Pollers/PollerID=9"}]}

Invoke

Request

POST https://localhost:17778/SolarWinds/InformationService/v3/Json/Invoke/Metadata.Entity/GetAliases HTTP/1.1
Authorization: Basic YWRtaW46
User-Agent: curl/7.20.0 (i386-pc-win32) libcurl/7.20.0 OpenSSL/0.9.8l zlib/1.2.3
Host: localhost:17778
Accept: */*
Content-Type: application/json
Content-Length: 39
["SELECT B.Caption FROM Orion.Nodes B"]

Response

HTTP/1.1 200 OK
Content-Length: 19
Content-Type: application/json
Server: Microsoft-HTTPAPI/2.0
Date: Fri, 27 Jul 2012 19:23:27 GMT
{"B":"Orion.Nodes"}

The Metadata.GetAliases verb takes one string argument and returns a PropertyBag.

Create

Request

POST https://localhost:17778/SolarWinds/InformationService/v3/Json/Create/Orion.Pollers HTTP/1.1
Authorization: Basic YWRtaW46
User-Agent: curl/7.20.0 (i386-pc-win32) libcurl/7.20.0 OpenSSL/0.9.8l zlib/1.2.3
Host: localhost:17778
Accept: */*
Content-Type: application/json
Content-Length: 92
{"PollerType":"hi from curl 2", "NetObject":"N:123", "NetObjectType":"N", "NetObjectID":123}

Response

HTTP/1.1 200 OK
Content-Length: 69
Content-Type: application/json; charset=utf-8
Server: Microsoft-HTTPAPI/2.0
Date: Fri, 27 Jul 2012 19:27:11 GMT
"swis:\/\/tdanner-dev.swdev.local\/Orion\/Orion.Pollers\/PollerID=19"

Read

Request

GET https://localhost:17778/SolarWinds/InformationService/v3/Json/swis://tdanner-dev.swdev.local/Orion/Orion.Pollers/PollerID=6 HTTP/1.1
Authorization: Basic YWRtaW46
User-Agent: curl/7.20.0 (i386-pc-win32) libcurl/7.20.0 OpenSSL/0.9.8l zlib/1.2.3
Host: localhost:17778
Accept: */*

Response

HTTP/1.1 200 OK
Content-Length: 245
Content-Type: application/json
Server: Microsoft-HTTPAPI/2.0
Date: Fri, 27 Jul 2012 19:30:02 GMT
{"PollerID":6,"PollerType":"V.Details.SNMP.Generic","NetObject":"V:1","NetObjectType":"V","NetObjectID":1,"DisplayName":null,"Description":null,"InstanceType":"Orion.Pollers","Uri":"swis://tdanner-dev.swdev.local/Orion/Orion.Pollers/PollerID=6"}

Update

Request

POST https://localhost:17778/SolarWinds/InformationService/v3/Json/swis://tdanner-dev.swdev.local/Orion/Orion.Pollers/PollerID=6 HTTP/1.1
Authorization: Basic YWRtaW46
User-Agent: curl/7.20.0 (i386-pc-win32) libcurl/7.20.0 OpenSSL/0.9.8l zlib/1.2.3
Host: localhost:17778
Accept: */*
Content-Type: application/json
Content-Length: 29
{"PollerType":"hi from curl"}

Response

HTTP/1.1 200 OK
Content-Length: 0
Server: Microsoft-HTTPAPI/2.0
Date: Fri, 27 Jul 2012 19:32:06 GMT

Delete

Request

DELETE https://localhost:17778/SolarWinds/InformationService/v3/Json/swis://tdanner-dev.swdev.local/Orion/Orion.Pollers/PollerID=16 HTTP/1.1
Authorization: Basic YWRtaW46
User-Agent: curl/7.20.0 (i386-pc-win32) libcurl/7.20.0 OpenSSL/0.9.8l zlib/1.2.3
Host: localhost:17778
Accept: */*

Response

HTTP/1.1 200 OK
Content-Length: 0
Server: Microsoft-HTTPAPI/2.0
Date: Fri, 27 Jul 2012 19:37:33 GMT
Viewing all 3719 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>