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

Error when editing node after adding via SDK/API

$
0
0

After adding a node to Solarwinds via SDK or API (I'm using Powershell) I cannot edit the node settings. I get the following error:

 

I have tried:

Rebooting the Solarwinds box

Adding the node with the absolute bare minimum properties required to create a new node

Rebooting the server that's being monitored

One of the things I read to try was to add a custom property name and then remove it.

 

The command I am using looks like this:

$newNodeProps = @{  IPAddress = $ipaddress  EngineID = 1  ObjectSubType = "WMI"  DNS = ""  SysName = ""
}

#region CREATING the node
$newNodeUri = New-SwisObject $swis -EntityType 'Orion.Nodes' -Properties $newNodeProps

 

If you require more information please let me know.


SQWL: Group SLA

$
0
0

Hi,

 

Does anyone have any info on how to create a 'Group' SLA report via SQWL?

 

I found this thread, however, I'm not sure if this is the correct way.  Group Availability Reports

 

Thank you in advance.

SWQL : NCM ConnectionProfiles table

$
0
0

Hi, the SQL statement below works in SQL Management studio. The objective is to retrieve the connection profile Name and build rules around it based on its name.

 

SELECT A.[NodeID]

      ,A.[IP_Address]

      ,A.[Caption]

      ,A.[DNS]

  ,B.EQUIPE_OPS

  ,C.ConnectionProfile

  ,D.Name

  FROM ((([SolarWindsOrion].[dbo].[NodesData] as A

  INNER JOIN SolarWindsOrion.dbo.NodesCustomProperties as B on B.NodeID = A.NodeID)

  INNER JOIN SolarwindsOrion.dbo.NCM_NodeProperties as C on C.CoreNodeID = A.NodeID)

  INNER JOIN SolarwindsOrion.dbo.NCM_ConnectionProfiles as D on D.ID = C.ConnectionProfile)

 

 

When I use the SQWL query api with the given statement as $query , (see code below) , I receive the error "Message" : "Source entity [NCM.ConnectionProfiles] not found in catalog",

 

my $query = sprintf(

"SELECT A.[NodeID]

        ,A.[IP_Address]

        ,A.[Caption]

        ,A.[DNS]

        ,B.EQUIPE_OPS

        ,C.ConnectionProfile

        ,D.Name

  FROM Orion.Nodes A

  INNER JOIN Orion.NodesCustomProperties B on B.NodeID = A.NodeID

  INNER JOIN NCM.NodeProperties C on C.CoreNodeID = A.NodeID

  INNER JOIN NCM.ConnectionProfiles D on D.ID = C.ConnectionProfile

");

 

What am I missing ?

SQWL: Group SLA

$
0
0

Hi,

 

Does anyone have any info on how to create a 'Group' SLA report via SQWL?

 

I found this thread, however, I'm not sure if this is the correct way.  Group Availability Reports

 

Thank you in advance.

Node Additon using SNMP v3

$
0
0

Can we add node (snmp v3 ) using java ?

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.

Query nodes based on custom property

$
0
0

Hello,

 

Is there any way to query the Orion nodes with all the custom properties?

 

Thanks.

CluM09

Run an availability report via API

$
0
0

Hello,

 

I am attempting to run a node availability query via the SolarWinds API but for some reason I am getting different results than when I run the availability report via the web-report or report-writer (which both get the same result).

 

In the web-report I can specify the previous month and in the report-writer it uses the BETWEEN command which are both unavailable when using the API.

 

The query I am using is below:

 

SELECT

       AVG(RT.Availability) as Availability,

       RT.NodeID

FROM

       Orion.ResponseTime RT

WHERE

       Month(DateTime) = 05

       AND Year(DateTime) = 2018

       AND NodeID = 555

GROUP BY

       NodeID

 

Would anyone know how to get node availability via the API that gives an accurate result?


http request was forbidden with client authentication scheme 'Basic'

$
0
0

Dear Support,

 

we are facing issues using RES API "http request was forbidden with client authentication scheme 'Basic'" could an one help here.

 

Regards

Chethan Kumar G

Invoking Orion.APM.ApplicationTemplate UpdateApplicationTemplateSettings

$
0
0

Hello Orion SDK Community,

 

I'm attempting to update a SAM template by invoking the UpdateApplicationTemplateSettings verb.

Although the operation completes successfully (I get a response), no changes are shown in the application template.

Not sure what I'm missing here, I'm guessing there is something simple I'm missing.

Assuming that $swis is a valid connection string, please see the below code.

I appreciate anyone's help with this.

 

$sometemplate = "335"

 

$app_temp_setting = ([xml]"

<ApplicationTemplateSetting>

      <Name>HelloWorld</Name>

      <Description>This is a message from HelloWorld</Description>

      <Frequency>350</Frequency>

      <Timeout>350</Timeout>

      <DebugLoggingEnabled>True</DebugLoggingEnabled>

      <NumberOfLogFilesToKeep>31</NumberOfLogFilesToKeep>

      <Use64Bit>False</Use64Bit>

  </ApplicationTemplateSetting>").DocumentElement

 

  Invoke-SwisVerb $swis Orion.APM.ApplicationTemplate UpdateApplicationTemplateSettings @($sometemplate,$app_temp_setting)

 

Thank you,

 

=swql

Run an availability report via API

$
0
0

Hello,

 

I am attempting to run a node availability query via the SolarWinds API but for some reason I am getting different results than when I run the availability report via the web-report or report-writer (which both get the same result).

 

In the web-report I can specify the previous month and in the report-writer it uses the BETWEEN command which are both unavailable when using the API.

 

The query I am using is below:

 

SELECT

       AVG(RT.Availability) as Availability,

       RT.NodeID

FROM

       Orion.ResponseTime RT

WHERE

       Month(DateTime) = 05

       AND Year(DateTime) = 2018

       AND NodeID = 555

GROUP BY

       NodeID

 

Would anyone know how to get node availability via the API that gives an accurate result?

Query nodes based on custom property

$
0
0

Hello,

 

Is there any way to query the Orion nodes with all the custom properties?

 

Thanks.

CluM09

Orion SDK Documentation

$
0
0

I'm trying to write some python scripts for creating and modifying groups. I've been looking at some examples on the github page, but I can't find any complete documentation for the API.
So parameters for functions, for example.
Is there any better documentation anywhere else?



Orion SDK 2.4 released

$
0
0

Orion SDK 2.4 has been released. This release contains a set of nice SWQL Studio UI upgrades:

  • Fancy tabs with Visual Studio-like behavior courtesy of DockPanelSuite
  • The query parameter window has been converted into a docking panel that automatically tracks the names of the query parameters used by the current query
  • Adds a toolbar
  • Combobox on the toolbar for switching which open connection is used for the current tab
  • Support for calling CRUD directly from SwqlStudio
  • Menu items to copy the current query as a curl or Get-SwisData command line
  • Preference for whether to prompt for saving queries on exit
  • Include "TOP 1000" when SWQL Studio generates a SELECT statement

And bugfixes:

  • Automatically reconnect when connection has gone stale
  • Ugly error in SWQL Studio when verb argument contains malformed XML

Finally:

  • All binaries are now code-signed by SolarWinds

 

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

You can also install it using Chocolatey (Chocolatey Gallery | SolarWinds Orion SDK 2.4.0.176) using "choco install orionsdk" (or "choco upgrade orionsdk" if you used Chocolatey to install a previous version)

 

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.3 and several previous releases are compatible with the latest 2018 SolarWinds products, so don't feel like you need to upgrade the Orion SDK just for compatibility.

 

As always, you can ask your Orion SDK questions in this forum. If you see a bug in the SDK tools, feel free to open an issue on the GitHub project: Issues · solarwinds/OrionSDK · GitHub

SWQL: CPU Monitoring with sustained threshold

$
0
0

Hi,

 

I was wondering if there is a way to add a 'sustained' threshold for CPU monitoring with a SWQL query.

 

I wanted to create a CPU Monitoring dashboard that will trigger when the CPU load has reached a 90% threshold + sustained for over 30 minutes.

 

I created this simple dashboard, however, it's only reporting in near real-time.

 

 

 

select n.caption AS [Nodes],'/Orion/NetPerfMon/NodeDetails.aspx?NetObject=N:' + ToString(n.nodeid) AS [_LinkFor_Nodes],

n.CPULoad as [CPULoad]

,'/Orion/NetPerfMon/NodeDetails.aspx?NetObject=N:' + ToString(n.nodeid) AS [_LinkFor_CPULoad] 

,Case 

WHEN n.CPULoad < '89' THEN ('/Orion/images/ActiveAlerts/Warning.png') 

WHEN n.CPULoad > '90' THEN ('/Orion/images/ActiveAlerts/Critical.png') 

End as [_IconFor_CPULoad], 

cp.Application_Function, cp.Asset_Type

from orion.Nodes n

left join orion.NodesCustomProperties cp on n.NodeID = cp.NodeID

where n.CPULoad > '80'

order by n.CPULoad DESC


Orion SDK Documentation

$
0
0

I'm trying to write some python scripts for creating and modifying groups. I've been looking at some examples on the github page, but I can't find any complete documentation for the API.
So parameters for functions, for example.
Is there any better documentation anywhere else?



How to enable API in Solarwinds to integrate with other tools?

$
0
0

Hi,

 

We are trying to create a “Central Dashboard for Capacity” related reports for my customer so that whenever needed one can login to this Tool and generate a report.

 

To generate those reports in our Tool, our Tool needs to further integrated with Solarwinds to get the Capacity and Performance related data. And API (Web services) is the only protocol that our Tool support.

 

We need your help to understand whether Solarwinds support API so that we can explore further to get the Capacity and Performance related data from Solarwinds.

 

Also, how we can enable API Integration.

Upgraded server. Python API broken, PowerShell working

$
0
0

Our server admin upgraded Solarwinds from a physical server to virtual server.  He said he did it by the book.  We have alot of python scripts that pull from the solarwinds API that are now broken.  When I download the SDK and try to run the example python script from the solarwinds server, I get the following:

 

PS C:\> python .\SwisClient.py

IP address of NPM Server:

Username:

Password:

Invoke Test:

Traceback (most recent call last):

  File ".\SwisClient.py", line 72, in <module>

    main()

  File ".\SwisClient.py", line 68, in main

    samplecode(npm_server,username,password)

  File ".\SwisClient.py", line 43, in samplecode

    aliases = swis.invoke("Metadata.Entity", "GetAliases", "SELECT B.Caption FROM Orion.Nodes B")

  File ".\SwisClient.py", line 18, in invoke

    return self._req("POST", "Invoke/%s/%s" % (entity, verb), args).json()

  File ".\SwisClient.py", line 37, in _req

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

  File "C:\Anaconda\lib\site-packages\requests\api.py", line 50, in request

    response = session.request(method=method, url=url, **kwargs)

  File "C:\Anaconda\lib\site-packages\requests\sessions.py", line 468, in request

    resp = self.send(prep, **send_kwargs)

  File "C:\Anaconda\lib\site-packages\requests\sessions.py", line 576, in send

    r = adapter.send(request, **kwargs)

  File "C:\Anaconda\lib\site-packages\requests\adapters.py", line 412, in send

    raise ConnectionError(err, request=request)

requests.exceptions.ConnectionError: ('Connection aborted.', error(10054, 'An existing connection was forcibly closed by

the remote host'))

 

 

I am attaching the script that I am running.  The only change was to enter a valid node ID on line 47 as requested by the script (changed to "NodeID=6"). 

 

I worked with Solarwinds for a bit before they told me they don't support API.  I think this is more than a mere programing issue and something wrong with the internals of Solarwinds. 

 

The odd thing is that I can create a basic powershell script and it runs fine.  Here is the powershell code I am running:

 

Add-PSSnapinswissnapin

 

$swis=Connect-Swis

 

[array]$Nodes=Get-SwisData$swis'SELECT NodeID, Caption, MachineType FROM Orion.Nodes'

 

 

foreach ($Nodein$Nodes)

{

       if (($Node.Caption) -like"su*" ) {

Write-Host$Node.NodeID $Node.Caption $Node.MachineType

       }

      

}




Working with Solarwinds for a short bit, we have already run the configuration wizard to have it fix any services or database issues.  I have restarted all services and still get the same error.  I have run the Solarwinds Diagnostics and searched for this error in the logs.  I see the same error code and response in the Core.BusinessLayer logs, but that doesn't tell me much. 


Here are the versions we are running:  Orion Platform 2015.1.2, VNQM 4.2.2, IPAM 4.3, SAM 6.2.2, DPA 10.0.0, NCM 7.4, IVIM 2.1.0, QoE 2.0, NPM 11.5.2


Any help is much appreciated.

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

$
0
0

When trying the following command:

Get-SwisData $swis "SELECT NodeID FROM Orion.Nodes"

or even

Get-SwisData $swis 'SELECT NodeID, Caption FROM Orion.Nodes'

I get the following error:

 

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

 

 

I have tried different credentials, creating a local (Windows AD Account) on SolarWinds and a user account with and without a domain

 

I am using the SwisPowershell Module (v2.3.0.108)

 

It was working fine around a month ago, I cannot think of anything that has changed that would stop this from working.

 

Any ideas?

 

Cheers

http request was forbidden with client authentication scheme 'Basic'

$
0
0

Dear Support,

 

we are facing issues using RES API "http request was forbidden with client authentication scheme 'Basic'" could an one help here.

 

Regards

Chethan Kumar G

Viewing all 3719 articles
Browse latest View live


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