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

VLAN Change through UDT & NCM using Orion SDK

$
0
0

Hi,

 

We have installed the UDT and NCM modules, we have a requirement like,

 

  1. User will given an input as IP Address.

  2. Through UDT with this IP Adrress, we need to identify the Port and VLAN.

  3. We need to pass the identifed port, VLAN from UDT, along with new VLAN to NCM module for changing the VLAN.

 

  We are using .net for this requirement, while going through the SDK, its clearly mentioning about the Invoke mentod for acknowledgeing an Alert.

  So can we achive our requirement of changing a VLAN with this Invoke method ?

 

  While going through the discussion fourm,  http://thwack.solarwinds.com/message/178759#178759

   we found the PowerShell script, it attached herewith.

   In this script we identified below line,

     Invoke-SwisVerb $swis Cirrus.ConfigArchive Execute @($nodeIdList, $script, $username) | Out-Null

   Is there any similar code available in .net, like

     swis.Invoke("Cirrus.ConfigArchive", "Execute", System.Xml.XmlElement[] parameters),  we don't know what is the format of this XmlElement[] parameters.

     Please provide the sample XmlElement[] for this. It will be very helpful.

 

  Also with this Invoke method, our requirement of changing a VLAN will work?

 

  Please help us to find out the solution for this requirement.

 

Thanks,

Arun


SWIS v2 VS v3 in QueryXml()

$
0
0

I have a growing selection of scripts which have all be using SWIS v2 connections.  I've begun encountering features that are lacking in v2 and supposedly present in v3.  However, when I change the endpoint to tell my library to use a v3 connection, I start getting total junk back from SWIS.  Either I get empty result sets, or I get a perl hash back that completely lacks the key/value pairs I get with a v2 connection.  Rather, I get a bunch of ordinal number keys instead of usable names. 

 

I'm guessing there's a new namespace missing from the v3 stuff, but I can't figure out what's missing or what's needing to be changed.  I'm using the InformationService.pm file provided in the 1.7 SDK.

 

Calls to simple things seem to work ok, but every call I make via QueryXml() is returning junk.  Note that these very same calls work perfectly when I change the endpoint back to a v2 connection.

 

If I single-step into a unit test and dump the results array, then I see this (with a v2 connection;)

 

   862  HASH(0x5e4b1c0)

      'DNS' => ''

      'Description' => 'D-Link Systems, Inc.'

      'Displayname' => 'ALBIPIE-BNWF4-S2'

      'EngineID' => 2

      'IPAddress' => '10.149.8.200'

      'Location' => 'University House . Birmingham, AL'

      'NodeDescription' => 'D-Link DES-3052 Fast Ethernet Switch'

      'NodeID' => 24495

      'NodeName' => 'ALBIPIE-BNWF4-S2'

      'ObjectSubType' => 'SNMP'

      'Status' => 1

      'SysName' => 'ALBIPIE-BNWF4-S2'

      'SysObjectID' => '1.3.6.1.4.1.171.10.63.8'

      'Uri' => 'swis://./Orion/Orion.Nodes/NodeID=24495'

      'Vendor' => 'D-Link Systems, Inc.'

      '_Col1' => 'D-Link DES-3052 Fast Ethernet Switch'

 

If I change to a v3 connection (simply by inserting the '/v3' into the endpoint string and reruning the script, I send up with this:

 

         862  HASH(0x5bd9900)

            'c0' => 24495

            'c1' => 'swis://solarwinds-npm.pavlovmedia.corp/Orion/Orion.Nodes/NodeID=24495'

            'c10' => 'University House . Birmingham, AL'

            'c11' => 1

            'c12' => 2

            'c13' => 'D-Link Systems, Inc.'

            'c14' => 'ALBIPIE-BNWF4-S2'

            'c15' => 'D-Link DES-3052 Fast Ethernet Switch'

            'c2' => 'SNMP'

            'c3' => ''

            'c4' => 'ALBIPIE-BNWF4-S2'

            'c5' => 'ALBIPIE-BNWF4-S2'

            'c6' => '10.149.8.200'

            'c7' => 'D-Link DES-3052 Fast Ethernet Switch'

            'c8' => 'D-Link Systems, Inc.'

            'c9' => '1.3.6.1.4.1.171.10.63.8'

 

You can see it's the same node, but the keys are wrong.  The ONLY change between these two executions is adding '/v3' into the endpoint string.

 

I expect this is something obvious, but I can't find any references to similar issues here on Thwack or anywhere else, for that matter.

I'm betting there should be a different set of namespaces in InformationService.pm when a v3 connection is in use but I can't find any documentation for what this might be.

 

Can anyone point me to the documentation I'm missing?

 

I'm also wondering what, exactly, is the difference between the services on port 17777 vs the services on port 17778.   I thought that 17777 was v2 and 17778 was v3.  Yet there are examples here where everyone seems to be using 17778 for both v2 and v3 connections.

When I try to use a /v3/ endpoint with port 17777, I get an SSL error.

Download the latest config of all devices using Powershell

$
0
0

I am trying to download all device configurations (latest versions) to local drive. Here is the script I tried based on modified sample scripts.

 

if (! (Get-PSSnapin | where {$_.Name -eq "SwisSnapin"})) {
    Add-PSSnapin "SwisSnapin"
}

 

$hostname = "xxxxx"
$username = "xxxxx"
$password = New-Object System.Security.SecureString
$cred = Get-Credential
$swis = Connect-Swis -v2 -host $hostname -cred $cred

 

$ip = 'xxxxx'
$nodeId = get-swisdata $swis "SELECT NodeID FROM Cirrus.Nodes WHERE AgentIP=@ip" @{ip=$ip}

 

$script = "show clock"

 

$nodeIdList = New-Object -TypeName "System.Guid[]" 1
$nodeIdList[0] = $nodeId

 

$configType = "Running"

 

Invoke-SwisVerb $swis Cirrus.ConfigArchive Download @($nodeIdList, "Running", $username) | Out-Null

 

But I am getting the below error message in response. What is the problem? Can anyone guide me? I am language agnostic, any solutions in Perl, Python or Powershell is OK.

 

Invoke-SwisVerb : Retrieving the COM class factory for component with CLSID {FD7ADF54-44AC-4129-A8B1-7833F06418FD} failed due to the following
error: 8007000e Not enough storage is available to complete this operation. (Exception from HRESULT: 0x8007000E (E_OUTOFMEMORY)).
At line:1 char:1
+ Invoke-SwisVerb $swis Cirrus.ConfigArchive Download @($nodeIdList, "Running", $u ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Invoke-SwisVerb], FaultException`1
    + FullyQualifiedErrorId : SwisError,SwisPowerShell.InvokeSwisVerb

SDK 1.5 invoke with Perl ?

$
0
0

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

Getting the error of "Set-SwisObject : Access to IPAM.IPNode denied." using PowerShell

$
0
0

When doing the set-swisobject I get an access denied error. The account "admin" is marked as an admin in the Orion website.

 

Is there another location to set permissions that enable read/write on the nodes?

IPAM Question

$
0
0

Can someone tell me if it is possible to access the IPAM module of Solarwinds using a SOAP/REST type call?

 

I'm basically trying to write a script/workflow that can do the following:

 

1. Get the next available unused IP

2. Add the Hostname of the server to that IP address

 

Happy to share the workflow once it is created. I will be creating it in vCenter Orchestrator.

 

Nick

SolarWinds to Service-Now Integration

$
0
0

SolarWinds & Service-Now

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

We’re trying to do the following (option 1 is our preferred while option 2 is a fallback):

1)

A) SolarWinds generates alert

B) SolarWinds uses a “webservice/api/sdk/other tool” to “communicate with/connect to” with the appropriate information so ServiceNow can open a ticket with the appropriate categorization, priority, whether it is internally or externally managed (ticket assignment changes depending), etc.

C) ServiceNow will communicate to the “response team” that there is a new ticket that must be addressed

D) ServiceNow will “communicate with/connect to” SolarWinds to acknowledge the alert and to record the ServiceNow ticket in to the acknowledgement notes

E) SolarWinds will register alert and set alert to acknowledged status and will include the ServiceNow ticket number

*END*

 

2)

A) SolarWinds generates alert

B) SolarWinds sends email notification to ServiceNow – email will need to be in appropriate form to be “absorbed”

C) ServiceNow “absorbs” email and generates a ticket with the appropriate categorization, priority, whether it is internally or externally managed (ticket assignment changes depending), etc.

D) ServiceNow “responds” to email with acknowledgement and ticket number

E) SolarWinds registers the response and sets the alert to acknowledged status and will include the ServiceNow ticket number

*END*

 

At this time, we’re looking for foundational materials to help us get started and determine the easiest/best way to perform one of these options and we’re hoping SolarWinds support can give us some pointers on where to researching documentation and what documentation may exist. Our hope is this is a relatively straight forward activity since it seems like it would be fairly standard that companies would want their monitoring and ticketing systems to interact. We have been rather ineffectually researching SolarWinds documentation and Thwack for roughly a week and have been unable to find the “start here” materials. We understand that the referenced SDK is not supported and we will have to use Thwack as support, however, at this point, we don’t have enough information to understand whether the SDK is our best/only option. We see in the release notes that there is the VBClient, etc. however it is unclear if this is the proscribed technique or just *A* technique.

 

Thanks in advance for your feedback and guidance!

Orion SDK with PowerShell - manage/unmanage multiple nodes

$
0
0

I've been able to script unmanaging and managing nodes in powershell. However, for 400+ nodes, this ends up taking quite a while. Via script, it takes about 7 minutes to unmanage the nodes and over 10 minutes to remanage them. Doing this from the website takes about 25 seconds and no more than a minute, respectively. My guess is that the website somehow group updates the database instead of doing it one at a time. Anyone else seen this or have any idea how to do more than one node at a time? Below is sample code for how I am unmanaging a single node:

 

Invoke-SwisVerb $swis Orion.Nodes Unmanage @("N:$nodeid",$start,$end,"false")

 

Thanks for any advice you have!


Using Powershell to add nodes with Custom Properties for Device Type

$
0
0

Hello,
Running Orion NPM 10.6.0 and SDK 1.7 on Win2k8R2

 

Can anyone help with adding devices into Orion using Powershell?

 

To complete via NPM Web console, select Management, Edit Node.
Select groups, break down the group to a specific node.
Choose node properties, then edit node.
Custom properties show Device_Type:

12-4-2013 3-35-46 PM.png

 

Sample script adding a server fails for the custom properties:
---------------

Add-PSSnapin SwisSnapin

# initialize SWIS connection
$swis = Connect-Swis -Certificate

# add a node
$newNodeProps = @
{
EntityType="Orion.NodesCustomProperties";
DisplayName="servername_here";
Device_Type="Server_Windows";
}

$newNodeUri = New-SwisObject $swis –EntityType "Orion.NodesCustomProperties" –Properties $newNodeProps

$nodeProps = Get-SwisObject $swis -Uri $newNodeUri Orion.Nodes

Output:
PS C:\> $newNodeUri = New-SwisObject $swis -EntityType "Orion.NodesCustomProperties" -Properties $newNodeProps
New-SwisObject : Cannot bind argument to parameter 'Properties' because it is null.
At line:1 char:89
+ $newNodeUri = New-SwisObject $swis -EntityType "Orion.NodesCustomProperties" -Properties <<<<  $newNodeProps
    + CategoryInfo          : InvalidData: (:) [New-SwisObject], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,SwisPowerShell.NewSwisObject

PS C:\>


Similar blog = http://thwack.solarwinds.com/message/163190#163190

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

Need Help Converting SQL Report Writer Code to SWQL - Down Time Duration

$
0
0

Here is Report Writer SQL code that produces the duration of down time for a node.  I need to be able to convert this to SWQL and populate the 'hours down' time into a custom property field.  I want to use the 'hours down' time custom property field in conjunction with changing Google map Icon colors once time frame meets specified thresholds.   I'm not very savvy with SQL or coding so all suggestions are welcome.  Thanks everyone.  

 

SELECT     DATEDIFF(hh, T1.DownTime, CURRENT_TIMESTAMP) AS HoursDown, Nodes.Caption, Nodes.IP_Address,

T1.DownTime, Nodes.NodeID

FROM         (SELECT     MAX(EventTime) AS DownTime, NetObjectID, NetworkNode

                       FROM          Events

                       WHERE      (EventType = 1) AND (NetObjectType = 'N')

                       GROUP BY NetObjectID, NetworkNode) AS T1 INNER JOIN

                      Nodes ON T1.NetworkNode = Nodes.NodeID

WHERE     (Nodes.Status = '2') AND (Nodes.Owner = 'RHD')

ORDER BY HoursDown DESC, Nodes.Caption, T1.DownTime DESC, Nodes.NodeID

 

Output from this Query:

HoursDownNodeIP AddressDownTimeNode ID
139rtr.316864.ph.us.tgr.net10.165.4.111/2/2012 14:1818188
131rt2.023675.ph.us.tgr.net10.180.119.211/2/2012 22:1316384
120rt2.013146.ph.us.tgr.net10.81.4.211/3/2012 9:5615487
63rt2.013426.ph.us.tgr.net10.250.112.211/5/2012 18:1315560
42rtr.023040.ph.us.tgr.net10.80.164.111/6/2012 15:4816194
41rt2.012626.ph.us.tgr.net10.81.76.211/6/2012 16:5515348
39rt2.013236.ph.us.tgr.net10.7.34.211/6/2012 18:2215534
39rtr.023016.ph.us.tgr.net10.80.141.111/6/2012 18:0116174
36rt2.008384.ph.us.tgr.net10.74.64.211/6/2012 21:1314776
24rt2.026530.ph.us.tgr.net10.76.43.211/7/2012 9:4617140
17rt2.013122.ph.us.tgr.net10.81.94.211/7/2012 16:1115475
17rt2.013139.ph.us.tgr.net10.81.103.211/7/2012 16:1815484
16rtr.012934.ph.us.tgr.net10.82.80.111/7/2012 17:4815429
15rt2.006231.ph.us.tgr.net10.13.12.211/7/2012 18:2814567

Using the SDK powershell snap in - some newbie questions

$
0
0

Hi all,

Just getting started doing an integration between Orion and some of our other tools. Have been through the SDK 1.3 and found some useful stuff in there especially around the kind of things we're looking to do like:

- create/remove a new node

- Add pollers

- Get a list of nodes

 

So I have some questions and please excuse me if these are trivial, but I think it's important we get this right at the outset. To set the scene my plan is to use the powershell cmdlets to do my integrations. So to the questions:

1. The Connect-Swis cmdlet - can it take the user/pw as parameters? If so how? eg:

     $swis = Connect-Swis -user myuser -pw mypassword

 

2. To create a node, i can use the New-SwisObject cmdlet. There are basically 2 instances where I'd want to do this: creating a server or a network device like a switch etc. In either case, is it necessary to add one or more interfaces for that Orion.Node object or will Orion discover the interfaces when it polls it and add them itself?

3. Follow on from Q2 - can I force Orion to poll the device once I've added it?

4. Is it always necessary to use the NodeID when querying for a Orion.Node object? I've tried to use a select statement to do a query using "where Caption='myhost'" but it doesn't seem to like that.

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

Add Node to NCM via .NET

$
0
0

Trying to add a node to NCM using the SDK with C# .NET. Have the following code:

 

System.Xml.XmlDocument xdoc = new System.Xml.XmlDocument();
System.Xml.XmlElement[] elem = new System.Xml.XmlElement[1];
System.Xml.XmlElement xel = xdoc.CreateElement("coreNodeId");
xel.InnerText = nodeID.ToString();
elem[0] = xel;

client.Invoke("Cirrus.Nodes", "AddNodeToNCM", elem);

 

Following exception results: "Invoke failed, check fault information."

 

Where can I check this fault info? Seems like this should work from looking around the message board.

 

Also - Can I set the NCM Global Connection Profile using the SDK in a similar way?

Custom Poller Assignment

$
0
0

How is the CustomPollerAssignmentID generated?

~Ed


Orion.Events TimeStamp field is.. Binary?! :s

$
0
0

Hey all,

 

I'm looking at the Orion.Events table for use in a reporting context and noticed that [for whatever reason] the TimeStamp field is 'System.Binary.' The closest thing to that I've found in C# is System.Data.Linq.Binary. So the first question is, are those compatible, or is there some other C# type that matches your 'System.Binary' ?

 

Next question is, how do I .. 'decode' / read the data from that field, and for that matter, what does this TimeStamp represent? (Given EventTime is a DateTime and thus appears to represent the actual date & time of the event.)

 

 

Thanks,

Scott Fraley

SwisSnapin and PSremoting

$
0
0

SDK version 1.5

NPM version 10.2.2

 

I'm having trouble using SwisSnapin inside a PSremoting session.  Using local SW credentials so there isn't any double-hop windows authentication issues, I can't seem to get it to connect successfully.  My script works fine when run locally(even with the stored credentials), but as soon as it's done inside a WinRM session it stops connecting.  I removed the secure string for purposes of posting, but the secure string method was generated by converting a working credential password to a secure string and then saving that string as a variable.  This was tested working locally.  You can do the same by using

 

$cred | Get-Credential

$password = $cred.Password | ConvertFrom-SecureString

 

and storing that value in the below string(although the value printed to the string is incomplete so I was able to use PowerGui to fetch the entire string value from the variable.

 

 

$ctxsess = New-PSSession -ComputerName "server.hostname.com"

Invoke-Command -Session $ctxsess -ScriptBlock {

 

Add-PSSnapin SwisSnapin

 

$username = "\release_team"

$secpassword = "securestring would be here"

$password = ConvertTo-SecureString -String $secpassword

$credential = New-Object System.Management.Automation.PsCredential($username,$password)

# Connect to Solarwinds server

$swis = Connect-Swis -v2 -host 'solarwinds.hostname.com' -Credential $credential

 

 

$nodes = Import-Clixml -Path E:\Scripts\Files\UnmanagedServers.xml

 

 

#UnManage Nodes

 

 

foreach($node in $nodes) {

$nodename = $node.DNShostname

$nodeid = Get-SwisData $swis "SELECT NodeID FROM Orion.Nodes WHERE DNS like '$nodename'"

Write-Output "Unmanaging $nodename : $nodeid"

$now=[DateTime]::Now

$later=$now.AddHours(6)

Invoke-SwisVerb $swis Orion.Nodes Unmanage @("N:$nodeid",$now,$later,"false")

}

 

 

}

Remove-PsSession -Session $ctxsess

Get-SwisObject : An error occurred when verifying security for the message.

$
0
0


I am trying to connect to SolarWinds server from a different server and run a powershell script.  My ultimate goal is mark an IP address as available.  I can get the connection established, but as soon as I do a Get-SwisObject I get a security message.

 

Get-SwisObject : An error occurred when verifying security for the message.

 

If I put in a bogas password, I get the same message, so I guess I am not convinced that I am actually getting connected to my solarwinds server.

 

Here is my script:

 

If (!(Get-PSSnapin | where {$_.Name -eq "SwisSnapin"})) {
    Add-PSSnapin "SwisSnapin"
}

 

$hostname = "solar.mycompany.com"
$username="admin"
$password="1234567"

 

$cred = New-Object -typename System.Management.Automation.PSCredential -argumentlist @($username,(ConvertTo-SecureString -String $password -AsPlainText -Force))

 

#Connect to the System
$target = Connect-Swis -v2 -Credential $cred -Hostname $hostname

 

#Get all URIs of Nodes in the System
$UriBasket = Get-SwisData $target "SELECT Uri FROM Orion.Nodes"

 

I searched high and low and I can not find what this error means (An error occurred when verifying security for the message.).

 

FYI, I am able to log on with the same account via a web browser, so I know the account has access.

 

Any help would be greatly appreciated.

 

Not sure I put this in the right group either.

 

Thanks, Jon

Download the latest config of all devices using Powershell

$
0
0

I am trying to download all device configurations (latest versions) to local drive. Here is the script I tried based on modified sample scripts.

 

if (! (Get-PSSnapin | where {$_.Name -eq "SwisSnapin"})) {
    Add-PSSnapin "SwisSnapin"
}

 

$hostname = "xxxxx"
$username = "xxxxx"
$password = New-Object System.Security.SecureString
$cred = Get-Credential
$swis = Connect-Swis -v2 -host $hostname -cred $cred

 

$ip = 'xxxxx'
$nodeId = get-swisdata $swis "SELECT NodeID FROM Cirrus.Nodes WHERE AgentIP=@ip" @{ip=$ip}

 

$script = "show clock"

 

$nodeIdList = New-Object -TypeName "System.Guid[]" 1
$nodeIdList[0] = $nodeId

 

$configType = "Running"

 

Invoke-SwisVerb $swis Cirrus.ConfigArchive Download @($nodeIdList, "Running", $username) | Out-Null

 

But I am getting the below error message in response. What is the problem? Can anyone guide me? I am language agnostic, any solutions in Perl, Python or Powershell is OK.

 

Invoke-SwisVerb : Retrieving the COM class factory for component with CLSID {FD7ADF54-44AC-4129-A8B1-7833F06418FD} failed due to the following
error: 8007000e Not enough storage is available to complete this operation. (Exception from HRESULT: 0x8007000E (E_OUTOFMEMORY)).
At line:1 char:1
+ Invoke-SwisVerb $swis Cirrus.ConfigArchive Download @($nodeIdList, "Running", $u ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Invoke-SwisVerb], FaultException`1
    + FullyQualifiedErrorId : SwisError,SwisPowerShell.InvokeSwisVerb

Adding "resources" using the SDK

$
0
0

I'm new to SolarWinds, so please forgive me if this question is rather basic. Thus far I've been able to create nodes in SAM with the SDK (Windows hosts in my case). However, the nodes created this way are missing a lot of things I'd like, which seem to be called "resources" in the GUI. When I click "list resources" on a node I'm able to select things like:

  • Hardware Health Sensors
  • CPU & Memory
  • Topology: Layer 3
  • Volume Utilization
  • Network interfaces
  • Asset Inventory

How can I use the SDK to add these items to a node? I'm using PowerShell, but if anyone has examples in another language that would work as well.

Viewing all 3719 articles
Browse latest View live


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