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

REST - HTTP Post - SWIS Invoke Orion.Container/CreateContainer Issue

$
0
0

Hello All,

 

I'm trying to do a http post to create a container and I can't seem to get the syntax right.

I've tried almost every possible combination for the memberDefinition section and nothing seems to work...

 

URL:

https://localhost:17778/SolarWinds/InformationService/v3/Json/Invoke/Orion.Container/CreateContainer

 

POST DATA:

{"name":"Orion123","owner":"Core","frequency":60,"statusCalculator":0,"description":"testing container creation","pollingEnabled":"true","memberDefinitions":[<ArrayOfMemberDefinitionInfo xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.solarwinds.com/2008/Orion"><MemberDefinitionInfo><Name>Testy123</Name><Definition>filter:/Orion.Nodes[CustomProperties.IT_Service='WAN' AND CustomProperties.Site_Code='USA']</Definition></MemberDefinitionInfo></ArrayOfMemberDefinitionInfo>]}

 

from SWQL Studio if I populate the values through the Invoke function (right click on the CreateContainer option) I have no issue, so I'm assuming there must be some error with my JSON formatting.

 

The above example is using the following format:

"memberDefinitions":[%data%]

 

I've also tried using another example found on thwack as well:

 

{"name":"Orion123","owner":"Core","frequency":"60","statusCalculator":"0","description":"hello","pollingEnabled":"true","memberDefinitions":["name":"Test1234","definition":"filter:/Orion.Nodes[CustomProperties.IT_Service='WAN' AND CustomProperties.Site_Code='USA']"]}

 

If anyone can assist with this, it would be greatly appreciated... trying to automate container creation, and hopefully group dependencies after -

 

Help me DTANNER AND THWACK COMMUNITY, you're my only hope


Is there a way to integrate or pull creditials from Cyberark to Solarwinds?

$
0
0

My company uses Cyberark and when talking with the Solarwinds Engineers, they seem unsure of how to pull credentials from Cyberark and create them in Solarwinds. This is sort of a deal breaker for us and I REALLY want to switch off of our current solution to Solarwinds.

Powershell scripts to automatically unmanage\remanage a node using the Orion SDK

$
0
0

First, I'll share the script. Then, I'll explain why we need it and how it helps us in our environment.

To use the script you must have the Orion SDK installed on the monitored node.

 

Take the text below, paste in Powershell ISE and save it as a PS1.

------------------------------------ Start PS1 -----------------------------------------------------------------

 

# 2014-07-21 Node Unmanage script for SolarWinds SDK Powershell

# by Joe Dissmeyer | Thwack - @JoeDissmeyer | Twitter - @JoeDissmeyer | www.joedissmeyer.com

# This script will unmanage a single node in the Orion database. First, it finds the node number in the Orion database, then it will unmanage it for 99 years.

# This script assumes you are running it LOCALLY from an already managed node AND that the machine has the Orion SDK v1.9 installed on it.

# If the machine is not already managed in SolarWinds this script will fail without warning.

# Replace ORIONSERVERNAME with the appropriate values.

# ORIONSERVERNAME = Your Orion poller instance. (Ex. 'SOLARWINDS01.DOMAIN.LOCAL'). Single quotes are important.

 

# Load the SolarWinds Powershell snapin. Needed in order to execute the script. Requires the Orion SDK 1.9 installed on the machine this script is running from.

Add-PSSnapin SwisSnapin

 

 

# SolarWinds user name and password section. Create an Orion local account that only has node management rights. Enter the user name and password here.

$username = "SWnodemanagement"

$password = "MyP@44w0$d"

 

# This section allows the password to be embedded in this script. Without it the script will not work.

$secstr = New-Object -TypeName System.Security.SecureString

$password .ToCharArray() | ForEach-Object {$secstr.AppendChar($_)}

$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username,$secstr

 

# The actual job

$ORIONSERVERNAME = 'SWServer1.domain.local'

$nodename = $env:COMPUTERNAME

 

$swis = Connect-Swis -Credential $cred -host $orionservername

$nodeid = Get-SwisData $swis "SELECT NodeID FROM Orion.Nodes WHERE SysName LIKE '$nodename%'"

$now =[DateTime ]:: Now

$later =$now.AddYears(99)

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

 

------------------------------------ End PS1 -----------------------------------------------------------------

 

 

 

And now the Remanage script. Again, save as a .PS1 file.

------------------------------------ Start PS1 -----------------------------------------------------------------

 

# 2014-07-21 Node Remanage script for SolarWinds SDK Powershell

# by Joe Dissmeyer | Thwack - @JoeDissmeyer | Twitter - @JoeDissmeyer | www.joedissmeyer.com

# This script will remanage a single node in the Orion database.

# This script assumes you are running it LOCALLY from an already managed node AND that the machine has the Orion SDK v1.9 installed on it.

# If the machine is not already managed in SolarWinds this script will fail without warning.

# Replace ORIONSERVERNAME with the appropriate values.

# ORIONSERVERNAME = Your Orion poller instance. (Ex. 'SOLARWINDS01.DOMAIN.LOCAL'). Single quotes are important.

 

 

# Load the SolarWinds Powershell snapin. Needed in order to execute the script. Requires the Orion SDK 1.9 installed on the machine this script is running from.

Add-PSSnapin SwisSnapin

 

 

# SolarWinds user name and password section. Create an Orion local account that only has node management rights. Enter the user name and password here.

$username = "SWnodemanagement"

$password = "MyP@44w0%d"

 

 

# This section allows the password to be embedded in this script. Without it the script will not work.

$secstr = New-Object -TypeName System.Security.SecureString

$password .ToCharArray() | ForEach-Object {$secstr.AppendChar($_)}

$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username,$secstr

 

 

# The actual job

$ORIONSERVERNAME = 'SWServer1.domain.local'

$nodename = $env:COMPUTERNAME

 

 

$swis = Connect-Swis -Credential $cred -host $orionservername

$nodeid = Get-SwisData $swis "SELECT NodeID FROM Orion.Nodes WHERE SysName LIKE '$nodename%'"

$now =[DateTime ]:: Now

$later =$now.AddYears(99)

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

 

------------------------------------ End PS1 -----------------------------------------------------------------

 

Explanation:

My company had a very unique need to monitor our enterprise Windows application that runs not only on standard desktop PCs, but also runs on mobile tablets connected to WiFi access points. These tablets run the standard Windows 7 Professional OS so it makes it easy to set up application monitoring in SolarWinds SAM for these machines. However, the problem comes at the end of the day when these tablets are turned off and placed in their charging docks for the night. As you can imagine, this creates an administrative nightmare (not to mention an email alert flood) in SolarWinds when this happens.

 

SolarWinds Orion NPM and SAM is designed to always keep an eye on a node or application that is entered in it's database. It is not designed to monitor an application or node only "part of the time" --- well, at least it isn't designed for this purpose out of the box. So instead, we have to create a workaround that will suit our needs. What we needed to do was figure out how to automatically "unmanage" these Windows tablet PCs in SolarWinds when they are shut down for the night, but also automatically "re-manage" them once they boot up. This is where the script comes into play.

 

The idea is to take the Unmanage script and apply it as a shut down script in Group Policy, then take the Remanage script and apply it as a boot up script in Group Policy.

Here is why this works for us:

The business is supposed to gracefully shut down the tablet by clicking Start > Shut down. If not, then an email alert triggers that informs us that the application is down on the machine.

If the tablet goes offline in the middle of the day for any reason, we will receive an email alert about that node.

When the machine is shut down properly, the node is automatically unmanaged in SolarWinds.

When the machine boots up and someone logs into the machine, the node is automatically remanaged in SolarWinds.

 

But here is an even better use for these scripts --- Scheduled Server Maintenance! How many times have we, server administrators, had to patch Windows Servers during scheduled maintenance hours? Normally you would have to go into SolarWinds and unmanage the node first BEFORE rebooting as not to trigger an email alert. Well with these scripts you wouldn't have to worry about that as much since this would be automatic.

 

Final notes:

Of course, this is just one way to go about auto-managing nodes in SolarWinds. There are some alternatives to doing this using the Orion SDK and Powershell which is to, instead, use the built-in .NET properties in Powershell 2.0 to access the Orion SQL database directly, find the node ID, and unmanage it in that manner. For those that are interested in how do to this without the Orion SDK, let me know and I'd be happy to elaborate.

[Q] Batch Editing Custom Properties w/ Powershell

$
0
0

We are trying to utilize Powershell to be able to update multiple custom properties of a specific subnet of machines. We have used the guidance found on the Github regarding most of the syntax, but we are still getting an error message when we run the entire sequence.

 

Here is the body of the script; I have redacted some things for obvious reasons:

 

#Intialization
Add-PSSNapin SwisSnapin

 

# Connect to SWIS
$hostname = "xxx.xxx.xxx.xxx"
$username = "UserName"
$password = get-content C:\Path\To\PWinfo.txt | convertto-securestring
$cred = New-Object -typename System.Management.Automation.PSCredential -argumentlist $username, $password
$swis = Connect-Swis -host $hostname -cred $cred

 

$NodeID="SELECT NodeID FROM Orion.Nodes WHERE IP_Address LIKE 'xxx.xxx.xxx.%'" # NodeID of a node which custom properties you want to change

 

# prepare a custom property value
$customProps = @{
  Comments="TEST comment - Delete Me";
  SecondarySiteEmail="test.email@testemail.com"
  ESN="TEST - numbers"
}

 

# build the node URI
$uri = "swis://localhost/Orion/Orion.Nodes/NodeID=$nodeId/CustomProperties";
# set the custom property
$NodeID2="SELECT NodeID FROM Orion.Nodes WHERE IP_Address LIKE '10.98.108.%'" | Set-SwisObject $swis -Uri $uri -Properties $customProps

 

However, the error message we are getting is this: "The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match any of the parameters that take pipeline input."

 

We were under the assumption that piping this was necessary, but we are re-thinking this. Any suggestions on what we are missing here?

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!

SNMP Port setting ignored in Node Discovery via SWIS

$
0
0

I've encountered an issue when adding nodes via SWIS. I have two equal devices one of which is configured to respond to SNMP requests on port 161 and another which listens on port 61161. The latter device cannot be discovered as an SNMP node directly using the web interface. Instead it has to be added as an ICMP-only node after which it must be changed to SNMP and port 61161 manually. The former node on the other hand gets discovered correctly and from the start gets added as an SNMP device.

Using the SolarWinds SDK it's possible to add nodes too. In addition to this, it's possible to control which SNMP port the Network Discovery should use for polling. Please see the below link: https://github.com/solarwinds/OrionSDK/wiki/Discovery In the code example right below the headline, "Building the discovery context from the plugin configurations", there's a field in the XML text, <SnmpPort>161</SnmpPort>, which obviously offers a way to control the SNMP port and yet SolarWinds NPM seems to ignore this field. I've run the same discovery script written in Powershell on both nodes with the SNMP Port field set to <SnmpPort>61161</SnmpPort>.

The problem is that the node which is configured to listen to port 161 gets added incorrectly and the other node which listens on port 61161, incorrectly does not get added using the same Powershell script. I therefore believe there's a bug in the SolarWinds SDK regarding the SNMP Port field.

 

Does anybody have any idea how I can perform a Network Discovery on a custom SNMP port i.e. other than port 161?

 

Thanks for reading this far,

Tobias

Orion SDK 2.2 released

$
0
0

Orion SDK 2.2 has been released. The main feature in this release is smart autocomplete in SWQL Studio, but there are also various minor bugfixes and improvements.

 

You can download the installer from GitHub: Release v2.2.54 · solarwinds/OrionSDK · GitHub

You can also install it from Chocolatey (Chocolatey Gallery | SolarWinds Orion SDK 2.2.54 ) using "choco install orionsdk"

 

These tools are compatible with all of the same SolarWinds products that the previous release was, so you should have no fear of upgrading. On the other side, Orion SDK 2.1 and several previous releases are compatible with the latest 2017 SolarWinds products, so don't feel like you need to upgrade the Orion SDK just for compatibility.

 

If you find bugs or need a feature in the tools, please open an issue on GitHub: Issues · solarwinds/OrionSDK · GitHub

PowerShell or Python ?

$
0
0

Ive taken a few python classes at school a while back and while I enjoyed it I never used it too much in the real world. From doing research and reading various posts I seem to have this feeling that knowing powershell vs python would put me in a much better position to excel as a SolarWinds admin.  Curious on Tdanners and others thoughts. 


Custom queries not working normally after upgrade from IPAM 4.3 to 4.3.2

$
0
0

Hi all,

 

I have a question on the custom queries. Seems like the custom queries are not working normally after the IPAM upgrade. Did anyone encounter similar issue? I have attached the screenshots on the issue.

 

The custom queries will time out and not show the results. Capture1 show that the queries are not working, capture2 is the SQL query.

 

Thank you

[Q] Batch Editing Custom Properties w/ Powershell

$
0
0

We are trying to utilize Powershell to be able to update multiple custom properties of a specific subnet of machines. We have used the guidance found on the Github regarding most of the syntax, but we are still getting an error message when we run the entire sequence.

 

Here is the body of the script; I have redacted some things for obvious reasons:

 

#Intialization
Add-PSSNapin SwisSnapin

 

# Connect to SWIS
$hostname = "xxx.xxx.xxx.xxx"
$username = "UserName"
$password = get-content C:\Path\To\PWinfo.txt | convertto-securestring
$cred = New-Object -typename System.Management.Automation.PSCredential -argumentlist $username, $password
$swis = Connect-Swis -host $hostname -cred $cred

 

$NodeID="SELECT NodeID FROM Orion.Nodes WHERE IP_Address LIKE 'xxx.xxx.xxx.%'" # NodeID of a node which custom properties you want to change

 

# prepare a custom property value
$customProps = @{
  Comments="TEST comment - Delete Me";
  SecondarySiteEmail="test.email@testemail.com"
  ESN="TEST - numbers"
}

 

# build the node URI
$uri = "swis://localhost/Orion/Orion.Nodes/NodeID=$nodeId/CustomProperties";
# set the custom property
$NodeID2="SELECT NodeID FROM Orion.Nodes WHERE IP_Address LIKE '10.98.108.%'" | Set-SwisObject $swis -Uri $uri -Properties $customProps

 

However, the error message we are getting is this: "The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match any of the parameters that take pipeline input."

 

We were under the assumption that piping this was necessary, but we are re-thinking this. Any suggestions on what we are missing here?

Help with SWQL query for alert history

$
0
0

Hello Everyone, I have an SQL query that I am trying to convert to SWQL and I am getting the error "Source entity [Orion.AlertHistory] not found in catalog.  When I compare SQL studio tables to SWQL studio tables I do not see a Orion.AlertHistory table however in SQL studio the table dbo.AlertHistory does exist.  Did I miss something or shouldnt the same tables be present between the two systems?  Below is my query:

 

 

SELECT ADDDATE('HOUR',-7,AlertHistory.[TimeStamp]) as "Time"

      ,AlertObjects.EntityCaption as "Alert"

      ,AlertObjects.RelatedNodeCaption as "Node"

      ,"Details" =

      Case

      When AlertObjects.EntityType = 'Orion.APM.Application' Then 'Application is Down'

      When AlertObjects.EntityType = 'Orion.Nodes' Then 'Node did not respond to ICMP call'

      When AlertObjects.EntityType = 'Orion.NPM.Interfaces' Then 'Interface is down.'

      When AlertObjects.EntityType = 'Orion.Volumes' Then 'Volume has reached a critical threshold'

      Else  'Check Event Log for Details'

      END

  FROM [Orion].[AlertHistory]inner join [Orion].[AlertObjects] on AlertHistory.[AlertObjectID]=AlertObjects.[AlertObjectID]

   where ActionID in

  (SELECT [ActionID]

FROM [Orion].[Actions]

where Title = 'Execute program : C:\Program Files (x86)\Tools\bin\RATriggerAlarm.CMD')

  and TimeStamp > ADDDATE('HOUR',7,DATEADD(DAY,-1,GETDATE())) 

Order by  TimeStamp desc

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.

SWIS REST/JSON API Authentication alternatives

$
0
0

Hey guys,

 

Currently trying to work all my PS based scripts that were using SWIS Snapin to use REST Api instead, so I don't need to worry about the snapin being installed on workstations.

 

Is there any plan to have alternative authentication method to the API? Current basic schema requires me to type user/password to authenticate. This is not an issue for automated systems where credentials can be save in a secured place. However, when it comes to create small functions for admins to use on daily basis (aka unmanage/remanage), that would require to have either creds hard-coded in the PS script or locally (ugly) or to have the user 'repeating' his current credentials to query Orion. At least OAuth with tokens, for example for a local account, would be a plus.

 

Not sure if this is the best place to ask about future features though

 

Thanks!

Custom queries not working normally after upgrade from IPAM 4.3 to 4.3.2

$
0
0

Hi all,

 

I have a question on the custom queries. Seems like the custom queries are not working normally after the IPAM upgrade. Did anyone encounter similar issue? I have attached the screenshots on the issue.

 

The custom queries will time out and not show the results. Capture1 show that the queries are not working, capture2 is the SQL query.

 

Thank you

Bit of help pls?

$
0
0

I am using vRealize and Azure to build Windows servers for my company.  After these boxes are built our help desk would like to have the new servers managed in Orion automatically.  Is there a simple way to add these servers to Orion with a powershell script?  I apologize but I have also never used Orion either. 

 

Thanks

- Bill


Integrating SolarWinds with Netcool

$
0
0

Hi All,

 

Is it possible to integrate SolarWinds with IBM Tivoli Netcool OMNIbus? If so, then what would be the requirements from our end (SolarWinds per se) for this integration?

 

Thank you very  much.

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!

Integrating SolarWinds with Netcool

$
0
0

Hi All,

 

Is it possible to integrate SolarWinds with IBM Tivoli Netcool OMNIbus? If so, then what would be the requirements from our end (SolarWinds per se) for this integration?

 

Thank you very  much.

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

PowerShell or Python ?

$
0
0

Ive taken a few python classes at school a while back and while I enjoyed it I never used it too much in the real world. From doing research and reading various posts I seem to have this feeling that knowing powershell vs python would put me in a much better position to excel as a SolarWinds admin.  Curious on Tdanners and others thoughts. 

Viewing all 3719 articles
Browse latest View live


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