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

Cannot get interface caption using discovery through PowerShell and DiscoverInterfacesOnNode verb

$
0
0

Hi,

 

I am trying to do some automatic interface additions based on interface type and on interface name. I have slightly modified the PowerShell example to discover interfaces on nodes in order to get it working, however, when it comes down to Caption, the value is "Caption" for *all* interfaces. Am I missing a special option in order to get the proper interface name, or is this not supported? I have tried to get more documentation on the DiscoverInterfacesOnNode or DiscoveredLiteInterface XML output, but I haven't had any luck there either.

 

This is an copy from the script output:

 

> & 'C:\Program Files (x86)\SolarWinds\Orion SDK\Samples\PowerShell\NPM.DiscoverAndAddInterfacesOnNode.ps1'

 

Id          : 3

ifIndex     : 1

Caption     : Caption

ifType      : 6

ifSubType   : 0

InterfaceID : 50653

Manageable  : true

ifSpeed     : 0

 

Id          : 5

ifIndex     : 2

Caption     : Caption

ifType      : 6

ifSubType   : 0

InterfaceID : 50664

Manageable  : true

ifSpeed     : 0

 

Id          : 7

ifIndex     : 3

Caption     : Caption

ifType      : 6

ifSubType   : 0

InterfaceID : 0

Manageable  : true

ifSpeed     : 0

 

[...]

 

If its not possible, is there a better way to get the interface name prior to importing it?


Thanks!


Orion SDK Unmanage Script works then Remanages before its set to

$
0
0

I have a powershell script that uses a list of hostnames in a CSV to unmanage in mass via the Orion SDK. I have the results of the script exported to a log file. The Unmanage reports as successful however the node magically remanages itself before the UnManageUntil time. See screenshots below

 

Script ran at 4:45pm using UnManageFrom time of Now (4:45pm) to UnManageUntil time of Now + 6 hours (10:45pm).

AuditEents.JPG

 

However at 6:45pm the node is managed again. And triggers a reboot alert when rebooted during our maintenance window. This occurred for every node I unmanaged with my script so its not an isolated incident.

Events.JPG

 

Below is my powershell script. Is there something wrong with my script? What would make my nodes remanage exactly 2 hours after I unmanaged them and before they are set to?

Im running NPM 11.0.1 and SAM 6.1.1

 

Set-ExecutionPolicy RemoteSigned

Add-PSSnapin SwisSnapin

 

$HostnameList = @()

Import-Csv c:\Hostnames.csv | ForEach-Object {$HostnameList += $_.Hostname}

 

$cred = get-credential Admin

$swis = Connect-Swis -host "orionserver" $cred

 

$now=[DateTime]::Now

$later=$now.AddHours(6)


ForEach ($Hostname in $HostnameList)

{

$NodeID = Get-SwisData $swis "SELECT NodeID FROM Orion.Nodes WHERE SysName LIKE '$Hostname' OR DNS LIKE '$Hostname'"

$NodeIDStr = "N:" + $NodeID

Invoke-SwisVerb $swis Orion.Nodes Unmanage @($NodeIDStr,$now,$later,"false") -ErrorAction SilentlyContinue | Out-Null

    IF ($NodeID) {

        $Hostname + " " + $NodeID + " has been UnManaged from " + $now + " until " + $later | Tee-Object C:\UnManageLog.txt -Append

    }

    ELSE {

        $Hostname + " does not exist in SolarWinds or the Hostname is incorrect. Try FQDN." | Tee-Object C:\UnManageLog.txt -Append

    }

}

documentation for SWQL for alerts?

$
0
0

Migrated to 11.5.1 and am trying really hard to embrace SWQL.  Having a tough time correlating what I need in the various tables with the documentation from SDK.

specifically, right now, I'm working on my critical alert reset criteria.  Our environment requires someone ACK the critical alert prior to it being able to clear, regardless of trigger criteria status.

before, using SQL, I joined with AlertStatus table and said acknowledged must =1 AND NOT (<trigger criteria>).

 

part of the issue is the alert can clear from the AlertActive table prior to the ACK <and add some other custom complexity> and the alert sticks around in the alertstatusview table even after finally ACK'd.

 

so...if I change my SQL to SWQL, I should be able to do something like...

where ${N=SwisEntity;M=ComponentAlert.Acknowledged}=1

or maybe ${N=Alerting;M=Acknowledged}=1

...what is the difference between {N=SwisEntity;M=ComponentAlert.<>} and ${N=Alerting;M=<>}

 

how are we supposed to know what we can tie together?  is there docs for this? am I missing it?

I see where you lay out swql for nodes and custom properties <objecttype>.CustomProperties.<propertyName>...

 

Inquiring minds want to know!!

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

I wanted to create a Java program for Solarwinds to Query everything on an IP Address

$
0
0

Hi,

 

I wanted to create a Java Program which could run Queries and give me an output for the Queries. I already have it in Python but specifically wanted it for Java.

 

import requests

import json

from getpass import getpass

 

 

"""

Make sure to set a valid nodeID in line 50 before using!

"""

 

 

class SwisClient:

    def __init__(self, hostname, username, password):

        self.url = "https://%s:17778/SolarWinds/InformationService/v3/Json/" % (hostname)

        self.credentials = (username, password)

 

    def query(self, query, **params):

        return self._req("POST", "Query", {'query': query, 'parameters': params}).json()

 

    def _req(self, method, frag, data=None):

        return requests.request(method, self.url + frag,

            data=json.dumps(data),

            verify=False,

            auth=self.credentials,

            headers={'Content-Type': 'application/json'})

 

 

def samplecode(npm_server,username,password):

    swis = SwisClient(npm_server,username,password)

   

    print ("Query Test:")

    results = swis.query("Query") # set valid NodeID!

    #uri = results['results'][0]['Uri']

    print (results)

   

def main():

    npm_server = input("IP address of NPM Server: ")

    username = input("Username: ")

    password = getpass("Password: ")

    samplecode(npm_server,username,password)

 

if __name__ == "__main__":

    main()

 

Thanks

Arnav

Set Poll Interval on Node

$
0
0

Hi,

Can we set poll interval value on any node via SWIS? I try to Update method but I got an error like this, "Operation not implemented for entities mapped to multiple storages. PollInterval: 300"

Can anyone let me know how to get a full list of node custom properties via a SWIS session?

$
0
0

Or how do I tell if a field in the nodes table is a custom property?

 

Thanks,

Daniel

Orion SDK Unmanage Script works then Remanages before its set to

$
0
0

I have a powershell script that uses a list of hostnames in a CSV to unmanage in mass via the Orion SDK. I have the results of the script exported to a log file. The Unmanage reports as successful however the node magically remanages itself before the UnManageUntil time. See screenshots below

 

Script ran at 4:45pm using UnManageFrom time of Now (4:45pm) to UnManageUntil time of Now + 6 hours (10:45pm).

AuditEents.JPG

 

However at 6:45pm the node is managed again. And triggers a reboot alert when rebooted during our maintenance window. This occurred for every node I unmanaged with my script so its not an isolated incident.

Events.JPG

 

Below is my powershell script. Is there something wrong with my script? What would make my nodes remanage exactly 2 hours after I unmanaged them and before they are set to?

Im running NPM 11.0.1 and SAM 6.1.1

 

Set-ExecutionPolicy RemoteSigned

Add-PSSnapin SwisSnapin

 

$HostnameList = @()

Import-Csv c:\Hostnames.csv | ForEach-Object {$HostnameList += $_.Hostname}

 

$cred = get-credential Admin

$swis = Connect-Swis -host "orionserver" $cred

 

$now=[DateTime]::Now

$later=$now.AddHours(6)


ForEach ($Hostname in $HostnameList)

{

$NodeID = Get-SwisData $swis "SELECT NodeID FROM Orion.Nodes WHERE SysName LIKE '$Hostname' OR DNS LIKE '$Hostname'"

$NodeIDStr = "N:" + $NodeID

Invoke-SwisVerb $swis Orion.Nodes Unmanage @($NodeIDStr,$now,$later,"false") -ErrorAction SilentlyContinue | Out-Null

    IF ($NodeID) {

        $Hostname + " " + $NodeID + " has been UnManaged from " + $now + " until " + $later | Tee-Object C:\UnManageLog.txt -Append

    }

    ELSE {

        $Hostname + " does not exist in SolarWinds or the Hostname is incorrect. Try FQDN." | Tee-Object C:\UnManageLog.txt -Append

    }

}


Adding CPU & Memory Pollers

$
0
0

Hi - When I add CPU & Memory pollers with the GUI it automatically adds the correct CPU poller - e.g. CPU.SNMP.CiscoGen1/2/3

 

How does the GUI "know" which poller to add?? I'm doing the same thing with the SDK for automated provisioning but I can't work out whether I need CiscoGen1, 2 or 3 for a given Cisco device.

 

Is there a lookup table in the DB or something??

 

Thanks for any guidance with this.

 

Mike

Nodes custom property from SDK

$
0
0

I am using the Orion SDK to query the Orion Database. I would like the read some of the custom properties of the Nodes in the network using the SDK. The problem is i can't find a way to get the custom property value from the Database schema. In the Nodes table the CustomProperties property just take me to another table which doesn't seem to have any valuable information. I checked Orion.CustomProperty and it shows all the custom properties in the system, but still can't find a way to connect it to a node.

 

 

I would really appreciate any help on this.

 

Regards

Alberto García

 

Discovery auto import results

$
0
0

Hello all,

 

New to the SDK game so I'm here with some functionality questions. I'd like to automate the addition of discovered nodes to the Orion platform. I attempting to get the DiscoveredNodes and DiscoveredInterfaces tables into my script so that I can then run through them with the addNode script.

 

Is there a nice way to get this information into Power Shell so that I can call upon it? The variable I'm populating now is just returning nothing but the test I did for only one row of data will give me the data as long as I know the column name.

 

Also asked this in another post but figured I'd put it here as well since it pertains to what I'm doing. The XML that gets generated and fed to the discovery now routine has a section for IsAutoImported or something like that. If I change this to true and generate the discovery will Orion finally take care of importing the results automatically?

 

Thanks guys! Below is what I've used to get something/nothing into my variable.

 

$imports = Get-SwisData $swis "SELECT NodeID, ProfileID, IPAddress, IPAddressGUID, SnmpVersion, SubType, CredentialID, Hostname, DNS, SysObjectID, Vendor, VendorIcon, MachineType, SysDescription, SysName, Location, Contact, IgnoredNodeID, DisplayName, Description, InstanceType, Uri

FROM Orion.DiscoveredNodes"

Trying to create custom swql query

$
0
0

I am trying to take an SQL Query and plug it into the SWQL Custom Query on one of our Orion views.

 

this is what i have.. replaced names in brackets..

 

use [database]

SELECT ComputerName, SourceName, Message

from dbo.APM_WindowsEvent_Detail

where ComputerName IN ('[list of all our domain controllers]')

and message like '%locked out%';

 

in the SQL manager this gives a report of all account lockouts... the goal is to have a solarwinds page for the help desk where they can go Search the username and see what device caused the lockout on any of the domain controllers..

 

any help is greatly appreciated.

 

thanks you.

 

Also, where can one download the SWQL Studio I have read about in other posts?

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!

REST API in PowerShell

$
0
0

I have been able to use the OrionSDK to create PowerShell scripts to help automate some processes that we have. The downside is that each team member will need to install the SDK in order to run the scripts. To try and alleviate this problem, I started looking into the REST/JSON API examples. Is my assumption that using REST will no longer require having the OrionSDK installed?

 

Has anyone been able to create any valid REST/JSON queries in PowerShell? I am having difficulty getting started. I found the PowerShell command: Invoke-RestMethod -uri https://IPAddress:17778/SolarWinds/InformationService/v3/Json/Query  but have been unable to have this appropriately connect to/authenticate with our Orion Server. Any help getting started will be much appreciated, I think figuring everything else out from there should be fairly simple.

SWQL and the ${NodeID} Variable in Node Detail View

$
0
0

Hello all!

I wanted to pick your brains to see if you have any thoughts on my issue. Any help would be kindly appreciated. =)

 

Here's the outline of the problem:

  • My customer has a lot of remote sites, connected via encrypted tunnel interfaces back to a central data center
  • They want to have a graph that gives the usage of just these tunnel interfaces, in a stacked-area graph, over the last three days
  • I have created a new node detail view and assigned it to the routers in question
  • I have created a custom graph and a SWQL query that seemingly accomplishes this (see query below). The query leverages the ${NodeID} variable so that it will return data only in the context of the current view (the router in question).
  • Unfortunately, the query returns results from, not just the wrong nodes, but several other wrong nodes!


Here's the query:

----

 

SELECT

  N.NodeID,

  N.Interfaces.InterfaceName,

  DATETRUNC('HOUR', N.Interfaces.Traffic.DateTime) AS Time,

  SUM(N.Interfaces.Traffic.TotalBytes) AS TotalBytes

 

 

FROM Orion.Nodes N

 

 

WHERE

  N.NodeID = ${NodeID} AND

  N.Interfaces.InterfaceName LIKE 'Tunnel%' AND

  N.Interfaces.Traffic.DateTime >= ${FromTime} AND

  N.Interfaces.Traffic.DateTime <= ${ToTime}

 

 

GROUP BY N.Interfaces.InterfaceName, N.NodeID, DATETRUNC('HOUR', N.Interfaces.Traffic.DateTime)

----

Please note that N.NodeID, as part of the SELECT and GROUP BY commands, is temporarily in place as part of debugging this issue.


Here's the custom-graph result of the query:

2015-06-15 10_28_33-Router Details - Summary.jpg


The highlight in the URL section is the ID number of the node in question. I've validated this in SWQL studio.

The highlight below the graph contains the node IDs returned in the query.

My guess is that the NodeID variable is returning an array of nodes, rather than just the node in this context.



I've already reached out to support on this issue and they told me to come here. (frustrating)


It's either a bug, not possible, or I'm doing something wrong. Any thoughts, folks?


Thanks in advance!


Rest Api Connection Failed

$
0
0

Hi Everyone,

 

I am trying to run the example code from GitHub to connect to Orion and fetch the VM list but seeing the following error during the connection though the IP and Solarwinds is active . What am I missing here.?

 

from swClassLib import *

sw = SolarWinds(ip='X.X.X.X', username="admin", password="admin")

vms = sw.getOrionVIMVirtualMachines()

print ("My VMs\n")

for vm in vms:

   print (vm.getName(), vm.getIPAddress())

 

 

Could not connect in call from [(<frame object at 0x023CA9F8>, 'C:\\Python27\\Lib\\swClassLib.py', 97, 'sendRequest', ['        caller = inspect.stack()\n'], 0), (<frame object at 0x0240D9E8>, 'C:\\Python27\\Lib\\swClassLib.py', 3226, 'getOrionVIMVirtualMachines', ['                status=200)\n'], 0), (<frame object at 0x005AD608>, 'C:/Users/admin/PycharmProjects/SSH/ORION.py', 4, '<module>', ['vms = sw.getOrionVIMVirtualMachines()\n'], 0)]. Unable to continue

My VMs

 

 

Thanks

Paul

How do we programmatically discover the non-interface properties [in Orion] and enable them

$
0
0

We are automating the hydration of assets in Orion, and after adding a node, we know how to discover the interfaces, but how do we programmatically discover the non-interface properties and enable them like the sample below?Orion interface discovery ss.png


Thanks,

Scott F.


IPAM IPnodeID or IPAddress SWIS Variable

$
0
0

Hello,

I am trying to add a custom SWQL resource on the "IPAM IP Address Details View" which will list all the IP's for a given node which has that IP Address, the problem is i cannot find a suitable variable for the Address being viewed e,g IpNodeId or Ipadress

 

 

I have tried variants of the following

 

select ipaddress,nodeid from orion.nodeipaddresses where nodeid = (select nodeid from orion.nodeipaddresses where ipNodeId=${IpNodeId})

 

select ipaddress,nodeid from orion.nodeipaddresses where nodeid = (select nodeid from orion.nodeipaddresses where IPAddress = ${IPAM.IPNOde.IPAddress})

 

Is there a valid variable which can be used here?

 

Thanks,

Tony

Check Hardware Health Sensors via SWIS

$
0
0

Hi,

Is there any way to check Hardware Health Sensors via SWIS? Add some pollers etc. ?

Node Creation Error

$
0
0

After upgrading Solarwinds to the latest stable version (SUM 6.2, and NPM 11.5) we are unable to create a new node using the the SDK with version 1.10.16.

 

Please find below the error stack trace:

 

AxisFault

faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client

faultSubcode:

faultString: Create failed, check fault information.

faultActor:

faultNode:

faultDetail:

{http://schemas.solarwinds.com/2007/08/informationservice}InformationServiceFaultContract:<Message>Operation not implemented for entities mapped to multiple storages.</Message>

 

Create failed, check fault information.

 

Best Regards,

Viewing all 3719 articles
Browse latest View live


Latest Images

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