Quantcast
Channel: THWACK: All Content - Orion SDK
Viewing all 2677 articles
Browse latest View live

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


SSL Certificate Experiation Date Monitor (SWQL)

$
0
0

Here is a widget that can be used for a NOC view which list the SSL certs.  Nice little view which can also be used for a summary view.

 

 

select

n.Caption as [Node]

,n.DetailsURL as [_LinkFor_Node]

,'/Orion/images/StatusIcons/Small-' + n.StatusIcon AS [_IconFor_Node]

,cts.value as [Port]

,CONCAT(round(floor(tmp.data/30),0),' Months ',(tmp.data)-(FLOOR(tmp.data/30)*30),'Days') AS [Expiration Duration]

,concat(substring(tmp.errormessage,CharIndex(':',tmp.errormessage)+1,99),' (',tmp.data,' days)') as [Expiration Date]

,c.DetailsUrl as [_linkfor_Expiration Date]

,case when tmp.data<tmp.ThresholdStatisticCritical then '/Orion/images/StatusIcons/Small-Critical.gif'

      when tmp.data<tmp.ThresholdStatisticWarning then '/Orion/images/StatusIcons/Small-Warning.gif'

      else '/Orion/images/StatusIcons/Small-up.gif' end as [_Iconfor_Expiration Date]

from Orion.nodes n

join Orion.APM.Application a on a.NodeID=n.NodeID

join orion.apm.Component c on c.ApplicationID=a.ApplicationID

left join Orion.APM.componenttemplate ct on ct.id = c.templateid

left join Orion.APM.ComponentTemplateSetting cts on cts.componenttemplateid = ct.id and cts.[key] = 'portnumber'

left  join

(SELECT DISTINCT n.caption, n.nodeid, n.Applications.Name, c.Name, c.ComponentID, c.ApplicationID ,c.CurrentStatistics.ComponentStatisticData as [data], c.CurrentStatistics.ErrorMessage, c.ShortName

,c.DetailsUrl,ct.ThresholdStatisticWarning, ct.ThresholdStatisticCritical

from Orion.Nodes n join Orion.APM.Component c on c.ApplicationID=n.Applications.ApplicationID

join orion.APM.ComponentAlertThresholds ct on ct.ComponentID=c.ComponentID

where c.name like  'SSL%') tmp on tmp.applicationid=a.ApplicationID and tmp.nodeid=n.nodeid

where a.ApplicationTemplateID in (SELECT distinct a.ApplicationTemplateID from Orion.APM.Application a

left join Orion.APM.ApplicationTemplate t on t.ApplicationTemplateID=a.ApplicationTemplateID where t.name like '%SSL%')

group by n.Caption, n.nodeid,n.DetailsURL, n.Statusicon, tmp.data, tmp.shortname,tmp.errormessage, cts.Value, c.DetailsUrl, tmp.ThresholdStatisticCritical, tmp.ThresholdStatisticWarning

order by tmp.data asc

 

THanks

Amit

How to add a node to an existing Orion group using the Python SDK

$
0
0

Hey guys! I am trying to see if anyone knows of a way to add a node to an existing group in Orion. I need this for a script I am writing to sort newly added nodes to the respective groups they belong to. Please help! Any suggestions are welcome but the answer has to be something I can code because the scope of the project is vast and will need automation using the SDK.

Thanks!

how to remanage node via curl/rest api?

$
0
0

i've figured out how to unmanage a node via curl, eg:

 

curl -k -u userid:password -v https://orion:17778/SolarWinds/InformationService/v3/Json/Invoke/Orion.Nodes/Unmanage -X POST -d '["N:2670","03-21-2019","01-01-2020","false"]' -H "Content-Type: application/json"

 

but when i do the same for a remanage :

 

curl -k -u userid:password -v https://orion:17778/SolarWinds/rmationService/v3/Json/Invoke/Orion.Nodes/Remanage -X POST -d '["N:2670"]' -H "Content-Type: application/json"

 

it fails with the error message:

 

HTTP Error 404. The requested resource is not found.

 

what am i doing wrong?

how to add snmpv3 node via curl?

Python Orion SDK swis.update broken after IPAM 4.6.0 upgrade

$
0
0

Before upgrade, the Python Orion SDK swis.update was working fine. After upgrade, the Python Orion SDK swis.update broke with the error HTTP error 400: "The given key was not present in the dictionary”

 

Full technical details

Before upgrade: IPAM 4.5.2, SAM  6.4.0, VMAN 8.0.0, NPM 12.1, 

After upgrade:  IPAM 4.6.0, SAM 6.5.0, VMAN 8.1.0, NPM 12.2

 

The Python code

 

    swis = orionsdk.SwisClient(solarwinds_url, solarwinds_user, solarwinds_pass)

    ipFree = swis.query(

        "SELECT TOP 1 I.uri, I.DisplayName FROM IPAM.IPNode I WHERE Status=2 " +

        " AND I.DNSBackward is NULL " +

        " AND I.Subnet.DisplayName = '" + solarwinds_network + "'")

    ipAddr=ipFree['results'][0]['DisplayName']

    ipUri=ipFree['results'][0]['uri']

    swis.update(ipUri , Status=1, DNSBackward=customer_hostname)

 

 

Did a HTTP request and reponse capture

  1. Find the next free IP (This works)
    URL: https://solarwinds.url.com:17778
    POST /SolarWinds/InformationService/v3/Json/Query
    Request: {"query": "SELECT TOP 1 I.uri, I.DisplayName FROM IPAM.IPNode I WHERE Status=2  AND I.DNSBackward is NULL  AND I.Subnet.DisplayName = \'Mgt Services\'", "parameters": {}}
    Response: [{u'DisplayName': u'10.10.14.26', u'uri': u'swis://HE1-SWAPP-01.headquarters.healthedge.com/Orion/IPAM.IPNode/IpNodeId=9316'}]
  2. Change IP Node status to Used (This does not work)
    URL: https://solarwinds.url.com:17778

POST /SolarWinds/InformationService/v3/Json/swis://HE1-SWAPP-01.headquarters.healthedge.com/Orion/IPAM.IPNode/IpNodeId=9316
Request: {"Status": 1, "DNSBackward": "mynewdomain.url.com"}
Response: 'HTTP/1.1 400 Bad Request  "The given key was not present in the dictionary”

 

 

 

There is an open Solarwinds ticket for this issue 35188

 

Message was edited by: Jirawat Uttayaya

SQL to SWQL Conversion

$
0
0

Hi all,

 

I'm completely unfamiliar with SWQL and to be honest I've never needed to use it until now.

 

We have this SQL query running a report

 

Select Distinct data.Name, sum(data.TotalPowerLoad) TotalPowerLoad, data.location

 

FROM (

SELECT

   distinct (substring(n.Caption,1,16)) AS NAME, cs.ComponentStatisticData AS TotalPowerLoad, n.location

FROM

   [dbo].[APM_CurrentStatistics] cs

INNER JOIN [dbo].[NodesData] n

ON n.NodeID = cs.NodeID

WHERE

   ApplicationName = 'APC PDU' AND ComponentName LIKE '%LOAD (Amp)' AND n.caption LIKE 'City%'

 

Group By cs.nodeID,n.caption,cs.ComponentStatisticData, n.location) AS Data

 

Group by Data.Name, Data.Location

Order By Name ASC

 

I now need to run this query using the swispowershell module, unfortunately the swispowershell module seems to only support SWQL, in which this query is not compatible. So I need this SQL query "Converting" to SWQL.

 

I understand the basic syntax changes, but even changes the table names to reflect SWQL objects I can't seem to get this query working in SWQL.

 

Any help would be much appreciated.

cannot discover snmpv3 node via discover_one_node.py script

$
0
0

am trying to use the discover_one_node.py script provided at GitHub - solarwinds/orionsdk-python: Python client for interacting with the SolarWinds Orion API

 

but am getting this error when i run it:

 

requests.exceptions.HTTPError: 400 Client Error: ProvideFault failed, check fault information. for url: https://orion:17778/SolarWinds/InformationService/v3/Json/Invoke/Orion.Discovery/StartDiscovery

 

here's my script:

 

from __future__ import print_function

import re

import requests

from orionsdk import SwisClient

 

def main():

    npm_server = 'orion'

    username = '<userid>

    password = '<password>'

    target_node_ip = 'vlxadmp04'

    snmpv3_credential_id = 181

    orion_engine_id = 1

 

    swis = SwisClient(npm_server, username, password)

    print("Add an SNMP v3 node:")

 

    corePluginContext = {

        'BulkList': [{'Address': target_node_ip}],

        'Credentials': [

                {

                        'CredentialID': snmpv3_credential_id,

                        'Order': 1

                }

        ],

        'WmiRetriesCount': 0,

        'WmiRetryIntervalMiliseconds': 1000

    }

 

    corePluginConfig = swis.invoke('Orion.Discovery', 'CreateCorePluginConfiguration', corePluginContext)

 

    discoveryProfile = {

        'Name': 'discover_one_node.py',

        'EngineID': orion_engine_id,

        'JobTimeoutSeconds': 3600,

        'SearchTimeoutMiliseconds': 5000,

        'SnmpTimeoutMiliseconds': 5000,

        'SnmpRetries': 2,

        'RepeatIntervalMiliseconds': 1800,

        'SnmpPort': 161,

        'HopCount': 0,

        'PreferredSnmpVersion': 'SNMP2c',

        'DisableIcmp': False,

        'AllowDuplicateNodes': False,

        'IsAutoImport': True,

        'IsHidden': True,

        'PluginConfigurations': [{'PluginConfigurationItem': corePluginConfig}]

    }

 

    print("Running discovery...")

    result = swis.invoke('Orion.Discovery', 'StartDiscovery', discoveryProfile)

    print("Returned discovery profile id {}".format(result))

 

requests.packages.urllib3.disable_warnings()

 

if __name__ == '__main__':

    main()


Nodes Filter Variable Usage

$
0
0

I am trying to understand if it is possible to use variables, like ${Caption} in the Nodes Filter. I got this idea from writing custom resources for groups, similar to the ones in this thread Useful group custom SWQL query: Events on group members

 

Now I am wondering if I can use the same variables in other widgets in their filters.

Like below:

 

 

mesverrum, tdanner  Any insight into this?

 

Thank you!!

how to invoke a Network Sonar Discovery via rest api?

$
0
0

ive figured out how to discover a single node via python and the orion sdk but is that discovery the same as a network sonar discovery? because i noticed that changes in the volumes are NOT detected by the former. so if they are different, how do i trigger a network sonar discovery via either python or the rest api?

SWIS query to calculate date/time difference

$
0
0

I need to run a query and build an alert for the following.

 

1)Need to query Orion.PoolMembers for any LastheartbeatTimeStamp greater than 1 hour.

 

SELECT HostName, LastHeartbeatTimeStamp FROM Orion.HA.PoolMembers

 

2)I want to calculate if the LastheartbeatTimestamp is > 60 minutes old.  Really not sure how to accomplish this.

has anyone automated changing DB password with PowerShell script instead of using configuration wizard?

$
0
0

We have to change the password for DB user every 42 days and would like a way to automate it. We currently use SecretServer to store our passwords and it has the capability to enlist powershell scripts to update applications with the new password after SecretServer changes it. Has anyone created a script that can automate the password change for the SolarWinds DB password?

When can SWQL refer to an Alias

$
0
0

I'm trying to parse strings and am trying to refer to an alias in the SWQL query.

 

In the following query, I can refer to the alias IP without issue.  However, the alias from the CHARINDEX expression gives an exception: Cannot resolve property P1.

 

SELECT N.IPAddress AS IP

     , N.DnsBackward

     , CHARINDEX('.',IP,1)-1 AS P1

     , ToString(P1)

FROM IPAM.IPNode AS N

 

Is this a bug?  If not, what determines when an alias can be referenced?  Is there another way to accomplish this?

SWQL Single Character Wildcard / String Parsing

$
0
0

Does SWQL have a single character wildcard?  I've been working with the SDK for a while and find string parsing to be the greatest difficulty.

 

I'm still trying to find a way to work around for the lack of IP Address sorting.  SWQL functions for IP Addresses

https://thwack.solarwinds.com/ideas/10592

 

I generally find I need REGEX pattern matching MySQL :: MySQL 5.7 Reference Manual :: 3.3.4.7 Pattern Matching and a bunch of string functions MySQL :: MySQL 8.0 Reference Manual :: 12.5 String Functions that just don't exist.

 

How do people generally accomplish what is needed using only SubString and CharIndex?

 

Nesting of these functions doesn't appear to work...

    SELECT N.IPAddress AS IP

         , N.DnsBackward

         , SUBSTRING( IP

                    , 1

                    , CHARINDEX('.',IP,1)-1) AS O1

         , SUBSTRING( IP

                    , CHARINDEX('.',IP,1)+1

                    , CHARINDEX('.',IP,CHARINDEX('.',IP,1))-1) AS O2

         , SUBSTRING( IP

                    , CHARINDEX('.',IP,CHARINDEX('.',IP,1))+1

                    , CHARINDEX('.',IP,CHARINDEX('.',IP,CHARINDEX('.',IP,1)))-1) AS O3

         , SUBSTRING( IP

                    , CHARINDEX('.',IP,CHARINDEX('.',IP,CHARINDEX('.',IP,1)))+1

                    , CHARINDEX('.',IP,CHARINDEX('.',IP,CHARINDEX('.',IP,CHARINDEX('.',IP,1))))-1) AS O4

    FROM IPAM.IPNode AS N

SWQL -> SplitStringToArray -> ArrayValueAt

$
0
0

Hey guys,

 

first of all, please excuse my bad english

 

i try since two days to create a swql-query that give me with SPLITSTRINGTOARRAY one value from a string that contains two values wich are seperatet by |§|§| as shown in the SDK. But it dont work.

 

Thats the query :

 

SELECT SPLITSTRINGTOARRAY(Arr.Str) as ArrVal, ARRAYVALUEAT(ArrVal,0) as A0, ARRAYVALUEAT(ArrVal,1) as A1

     From (SELECT accp.WertePaar10 as Str

           From orion.AlertConfigurationsCustomProperties accp

           Where accp.Alert.AlertID = 188) as Arr

 

The faild message: Cannot resolve property ArrVal

 

If i execute the query without the "ARRAYVALUEAT" i get the array:

 

SELECT SPLITSTRINGTOARRAY(Arr.Str) as ArrVal

     From (SELECT accp.WertePaar10 as Str

           From orion.AlertConfigurationsCustomProperties accp

           Where accp.Alert.AlertID = 188) as Arr

 

Result:  ArrVal = [Test1, Test2]

 

Ive tried multiple query-variations without an useable result. Only failure-Messages. Can anyone help?


IMPORT / UPLOAD ORION MAPS [POWERSHELL]

$
0
0

Hello.

I have created a script which can upload OrionMap files (and thier associated images if required) to the SolarWinds database without the need for Network Atlas or ImportMapBatch as these were slow GUI applications.

 

The script i have created takes seconds to upload the files, so it is much quicker and means this process can be automated.

 

The reason i needed this automated was because i was tasked with creating a script to map our servers (which are constantly changing) in a graphical way in SolarWinds. So i created a script which can produce correct OrionMap files on-the-fly for the layout of our servers (without using Network Atlas, this was all automated based on the information it retrieves from SWIS). I needed a way of automating the import / upload to the SolarWinds Orion database, as this is where the map files are stored when they are imported with Network Atlas or ImportMapBatch.

 

Specifically, they are stored in the MapStudioFiles table. The actual map data is stored in the FileData column, so if you convert the MapFile or Image into a byte array, they can be uploaded to the database directly using the CRUD powershell functions.

 

My other problem with ImportMapBatch was if you were uploading a file which already existed (so updating a map), all of the Web UI map widget links to that map would break (as it would create a new entry in the database for the new map, and the Web UI map widget would still point to the old deleted map). My script addresses this by checking if a map with that file name already exists, saving the FileId it used, completely removing the old map, then uploading the new map with the old FileId. Which gives seamless map updates without breaking the Web UI map widgets.

 

I want to give a massive thankyou to KMSigma for his work on the Export map script, this helped me get the conversion to a byte array working and gave me a better understanding of the MapStudioFiles table, the link to his script is here, its very useful for backing up existing maps.

Export Orion Maps [PowerShell]

 

Please modify and use this script however you want, it would be especially useful if you had a task like i did where you had to automate the creation and upload of the maps, or you were just looking for a faster way of uploading the maps.

 

GitHub - akaProxim/SolarWindsOrionMapUploader: A Powershell script to upload OrionMaps (and thier associated images) to …

Can devices be added to Solarwinds via Ansible? Is there an ansible module available for this

$
0
0

Hi folks,

I've been tasked with adding a couple thousand network devices to SW. Is there an ansible playbook / module that does that? I didn't find any in the Orion github space. Any help would be greatly appreciated.

 

-JC

Cannot add or edit node

$
0
0

Hi Solarwinds fellas,

 

Just wondering if you encounter issue in adding or editing nodes, when adding, it just freezes and nothing happens after SNMP test is successful. While in editing node, it will return a certain error. We have 9 pollers, this issue is happening to 3 pollers only. Already consulted Solarwinds but the last recommendation is to rebuild the server. We already followed that .Net framework version should be the same on NPM and poller and Windows patches updated, restarted Orion services, even performed system reboot as well as diagnostics and configurations wizard but still the issue is the same. Thanks in advance.

How to dynamically/automatically (daily) fill in Node Custom Properties

$
0
0

Hi all

 

We need to run a "discovery job/script" to get plenty of values from roughly 1000 servers,

then update node custom properties with found values

and then use those values as variables in Application Templates for Windows PowerShell Component Monitors.

 

Seems like this topic was already discussed here: Automate custom property fill in more than a year ago.

 

I am wondering if there is any recommended "SolarWinds out-of-the-box way" now except of OrionSDK and/or using Alerts to change the custom property.

 

Thank you in advance, this is the most important step for us when replacing SCOM and implementing SolarWinds Solution.

 

J.

what is Orion? N-Central?

$
0
0

Solarwinds seems to have many diverse products.  My understanding is that Orion is not currently sold by Solarwinds?

 

They seem to sell N-Central for RMM.

 

I'm looking to use the SolarWinds Orion SDK, or the powershell module, or, at least perl, with the SWIS (SolarWinds Information System).

 

 

1. )  What products does or do these API's, SDK's and modules work with?

2.)  How would I execute or run a sample?

 

see also:

 

webserver - How to script remote monitoring and management - Super User

 

 

thanks,

 

Thufir

Viewing all 2677 articles
Browse latest View live


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