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

InterfaceTraffic Chart data aggregation on Sample Interval

$
0
0

Hello Community Members,

 

 

I am bit new to SWQL so wanted help on one of the Custom Charts realted to Interface Traffics

 

 

I have this data from NPM InterfaceTraffic

{"ObservationTimestamp":"2019-02-19T00:53:27.6330000","InAveragebps":22674344.0},{"ObservationTimestamp":"2019-02-19T00:44:27.6330000","InAveragebps":21715358.0},{"ObservationTimestamp":"2019-02-19T00:35:27.6300000","InAveragebps":17447148.0},{"ObservationTimestamp":"2019-02-19T00:26:27.6500000","InAveragebps":20513406.0},{"ObservationTimestamp":"2019-02-19T00:17:27.5630000","InAveragebps":19770150.0},{"ObservationTimestamp":"2019-02-19T00:08:27.5600000","InAveragebps":26387422.0},

 

 

In Dashboard, the chart data for 15 minute sample interval is displayed i.e. time duration 12AM, 12:15 AM, 12:30 AM and so on.

While querying the NPM.InterfaceTraffic table for an interface, i got the result set with difference of 9 minutes, starting from 12:08 AM.

I would like to know what kind of aggregation based on sample interval is done to generate the chart data for 12:15 AM, 12:30 AM... time duration

 

 

Any lead/help would be much appreciated.

 

 

Thanks.


Created dependencies dont work using python SDK

$
0
0

I am attempting to create a dependency using the python SDK and when I run the automated script it creates the dependency but it does not make the child unreachable when the parent node is down.

Below I have the example code as well as a screenshot of the GUI showing that the child is down when the parent is down on 2 of my dependencies. Please help, I am creating close to 6800 dependencies in this project so using the GUI is simply not an option.

 

     depUri = swis.create('Orion.Dependencies',

 

        Name=name,

        ParentUri=parent['DetailsUrl'],

        ChildUri= child['DetailsUrl'],

        AutoManaged=False,

        IncludeInStatusCalculation=True,

        EngineID=0,

        Category=0,

        ParentEntityType=parent['EntityType'],

        ParentNetObjectID=parent['NodeId'],

        ChildEntityType=child['EntityType'],

        ChildNetObjectID=child['NodeId'],

        Description='Node To Node Dependency')

 

I have called solar winds about it and they suggested that I change the engine id but that did not work either.

If anyone has any ideas let me know. I really appreciate the help!

how to run couple of show commands on all of my switches?

$
0
0

Hello

 

Could you please help me to create a report which runs below commands and give me the output ?

 

show interface trunk

show etherchannel summary

show cdp neighbors

 

Thank You

Murali.

powershell script to search node and delete

$
0
0

Please note that this script was based on this thwack message.

All I did was to change the swsql query used to get the URI and to search and delete a node via PowerShell

 

# This script will search for  node and delete it if exists

#

################################## Attention ###############################################

# You must have Orion SDK installed and set-execution policy must be set to unrestricted!!#

#Before running you must setup your hashed encrypted password using the line below.       #

###########################################################################################

 

#### Prerequisites ###

#  run the line below save credentials to be used by this script on a encrypted file

#GET-CREDENTIAL –Credential "EnterTheOrionUserNamehere” | EXPORT-CLIXML C:\Scripts\SecureCredentialsSAM.xml

## Load the SolarWinds Powershell snapin.

##Needed in order to execute the script.

##Requires the Orion SDK 2.0 installed on the machine this script is running from.

Add-PSSnapinSwisSnapin

# SolarWinds username and password section.

# It is recommended to use a local account create within SAM with only. I strongly recommend that you don't use a MS local account or domain account.

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

#This is using the hashed encrypted password

$MyCredentials=IMPORT-CLIXMLC:\Scripts\SecureCredentialsSam.xml

$ORIONSERVERNAME= 'yourserver.domain.com'

#This is connecting to SAM to pull the info we need need with the info given

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

$nodename=read-host"Enter node Name"

$nodeuri=Get-SwisData$swis"SELECT Uri FROM Orion.Nodes WHERe NodeName LIKE '%$nodename'"

if (!$nodeuri) {Write-Host"node does not exist on SAM"}

if ($nodeuri) {

Write-Host"node exist, uri: $nodeuri"

Remove-SwisObject$swis$nodeUri

Write-Host"node has been removed"

}

Add UDT ports via API

$
0
0

I have not found a way to do this, but maybe I'm not looking in the right place. We've got Python scripts for discovering and adding nodes and interfaces via API no problem. We're using corePluginConfig  and  interfacesPluginConfig to accomplish this. But I have not seen a similar "ports" PluginConfig (i.e. portsPluginConfig). When we started down the road of automating device entry, we assumed UDT ports would also be available to us via API. Like when we import discovered results in the web console, the Interfaces screen (with all of its selection criteria and filtering) is followed by an almost identical Ports screen. So it seemed safe to assume we would be able to include UDT ports when automating device entry via API.

 

Hopefully I'm just missing something and the option to do this is available.

 

Thanks!

C# using net.tcp connection

$
0
0

I'm looking for a quick concise way to connect to SolarWinds via the Orion SDK.  I've read that the best way to connect is via net.tcp, but can't find a simple example.

 

var client = new InforemationServiceClient("NetTcpBinding_InformationService"

                    ,string.Format("net.tcp://{0}:17778/SolarWindw/InformationService/v3/OrionBasic",hostname);

 

// I've tried using the connection syntax given for https, but the connection fails and the program exceptions...

// need to run queries against numerous tables.under IPAM

var result = client.QueryXml("SELECT IPAddress FROM IPAM.IPNode WHERE IPAddress NOT LIKE NULL",NULL);

 

Any help greatly appreciated.

Network Discovery returning Unknown

$
0
0

Hi, I am trying to modify the sample discovery powershell script in the Orion SDK package in hopes of automating our network discovery tasks. I am trying to feed the IP addresses from a .csv and the credentials from the Orion DB, but so far is getting Unknown results only. Hope someone can help and maybe you'll find something wrong in this portion of the code. Thanks so much in advance.

 

$credlist = Get-SwisData $swis "SELECT ID FROM Orion.Credential" | % {"<SharedCredentialInfo>

<CredentialID>$_</CredentialID>

<Order>$_</Order>

</SharedCredentialInfo>"}       

 

$ipcontainer = import-csv -Path "$($env:USERPROFILE)\ScanResults_20190124.csv" | Select-Object 'Address'| % {$_ -replace "@{Address=",""} | % {$_ -replace "}",""} | % {"<IPAddress>

<Address>$_</Address>

</IPAddress>"}

 

$InitialCorePluginXml = "<CorePluginConfigurationContext xmlns='http://schemas.solarwinds.com/2012/Orion/Core' xmlns:i='http://www.w3.org/2001/XMLSchema-instance'>

<BulkList>

        $ipcontainer

</BulkList>

<Credentials>

     $credlist

</Credentials>

<WmiRetriesCount>1</WmiRetriesCount>

<WmiRetryIntervalMiliseconds>1000</WmiRetryIntervalMiliseconds>

</CorePluginConfigurationContext>"

 

$CorePluginConfigurationContext = ([xml]$InitialCorePluginXml).DocumentElement

 

$CorePluginConfiguration = Invoke-SwisVerb $swis Orion.Discovery CreateCorePluginConfiguration @($CorePluginConfigurationContext)

 

$StartDiscoveryContext = ([xml]"

<StartDiscoveryContext xmlns='http://schemas.solarwinds.com/2012/Orion/Core' xmlns:i='http://www.w3.org/2001/XMLSchema-instance'>

<Name>Test Script Discovery $([DateTime]::Now)</Name>

<EngineId>$engineId</EngineId>

<JobTimeoutSeconds>3600</JobTimeoutSeconds>

<SearchTimeoutMiliseconds>2000</SearchTimeoutMiliseconds>

<SnmpTimeoutMiliseconds>2000</SnmpTimeoutMiliseconds>

<SnmpRetries>1</SnmpRetries>

<RepeatIntervalMiliseconds>1500</RepeatIntervalMiliseconds>

<SnmpPort>161</SnmpPort>

<HopCount>0</HopCount>

<PreferredSnmpVersion>SNMP2c</PreferredSnmpVersion>

<DisableIcmp>false</DisableIcmp>

<AllowDuplicateNodes>false</AllowDuplicateNodes>

<IsAutoImport>false</IsAutoImport>

<IsHidden>false</IsHidden>

<PluginConfigurations>

<PluginConfiguration>

<PluginConfigurationItem>$($CorePluginConfiguration.InnerXml)</PluginConfigurationItem>

</PluginConfiguration>

</PluginConfigurations>

</StartDiscoveryContext>

").DocumentElement

Adding new IPAM subnets via SWIS to existing groups

$
0
0

I am working on an application that allows users to automatically add subnets into IPAM by simply putting in some basic site details. It works with a basic Django based front-end and using Netmiko to jump on the kit. It's nearly done, I just need to export all the data I have into SWIS.

 

I am using the OrionSDK library for Python, and am a bit confused as to how I build out the command in SWIS, so far I have this:

 

swis.invoke('CreateSubnetForGroup', SWIS_Dict[str(i)]['address'], SWIS_Dict[str(i)]['cidr'], SWIS_Dict[str(i)]['code'])

 

Where;

 

`SWIS_Dict` is a nested dictionary of processed parameters, i.e. subnet address, cidr and site-code

`i` is an index as this is part of a loop, for adding multiple subnets

 

Using this as a reference, there is an outline as to how to do this for a 'Hierarchy Group', but all of our sites exist as groups under a single hierarchy group simply called "IP Networks" .

 

I am assuming I will also need to run CRUD operations on the subnets once they are added, for things such as the VLAN ID, display name and descriptions.


Conversion failed when converting the varchar value

$
0
0

Working on an alert for interface discards. This is the swql generated by the alert:

SELECT E0.[Uri], E0.[DisplayName]

FROM Orion.NPM.Interfaces AS E0

WHERE ( ( ( E0.[Node].[CustomProperties].[Alerts] = 'T' ) AND ( E0.[CustomProperties].[Alerts] = 'T' ) ) AND ( ( E0.[InErrorsDiscardsThreshold].[IsLevel1State] = 'True' ) AND ( E0.[InErrorsDiscardsThreshold].[IsLevel2State] = 'True' ) AND ( E0.[OutErrorsDiscardsThreshold].[IsLevel1State] = 'True' ) AND ( E0.[InErrorsDiscardsThreshold].[IsLevel2State] = 'True' ) ) )

 

When I paste that into the SWQL studio I get the error "Conversaion failed when converting the varchar value 'false' to data type int"


If I take away the Where statement the query returns and the values show up as False

 

Also I changed the alert to be OR because I realized it wouldn't work with an AND at all. But wanting to know changing the query to

SELECT E0.[Uri], E0.[DisplayName]

FROM Orion.NPM.Interfaces AS E0

WHERE ( ( ( E0.[Node].[CustomProperties].[Alerts] = 'T' ) AND ( E0.[CustomProperties].[Alerts] = 'T' ) ) AND ( ( E0.[InErrorsDiscardsThreshold].[IsLevel1State] = 1 ) OR ( E0.[InErrorsDiscardsThreshold].[IsLevel2State] = 1 ) OR ( E0.[OutErrorsDiscardsThreshold].[IsLevel1State] = 1 ) OR ( E0.[InErrorsDiscardsThreshold].[IsLevel2State] = 1 ) ) )

 

makes it work so it looks like 1 is true and 0 is false. Is this correct?

Swagger/OpenAPI documentation for Orion

$
0
0

In an attempt to make the Orion REST API easier to work with, I have posted Swagger/OpenAPI spec files (swagger.json, openapi.json). These can be used to generate client wrappers using tools like Swagger Codegen and Microsoft AutoRest. These spec files are based on the SWIS APIs available in the latest Orion product releases as of December 2018. This means Orion Platform 2018.4, NPM 12.4, NCM 7.9, etc.

 

OpenAPI spec files can also be used to generate interactive documentation . This is available at https://solarwinds.github.io/OrionSDK/swagger-ui/.

 

Orion Platform 2018.4 contains an addition to the format of the REST API. Prior to this release, verb arguments had to be passed as JSON arrays - positional arguments. This is still supported. Starting in this release, verb arguments will also be accepted in JSON object format - named arguments. I expect this to be more usable overall, but the immediate motivation for it is that the OpenAPI schema model does not provide a way to describe an array where each element is of a specific, possibly different, type.

 

Feedback on this new API documentation method is welcome; I hope to refine it in future releases.

Connecting to swis using python

$
0
0

Hello all,

 

I have been working in the Orion SDK using powershell and now I am learning python and had a quick question. Is there any way in python to connect to swis the same way as this powershell command ($swis = Connect-Swis 'OrionServer' -trusted). I liked using this as I would not have to retype my password every time I would be testing a script.

Network Discovery with a schedule

$
0
0

Can get a discovery job to get added and can rediscover manually, but if i add all the subnets to one discovery job (preferred, but with almost 4000 subnet ranges), i can edit it.  Think the number of subnets are too large and the request to edit times out.  Is there a way using rest/api (again prefer python) to set a discovery schedule on creation?

Thanks in advance to anybody that can help,

--Rob

AddInterfacesOnNode Traffic Statistics

$
0
0

I'm trying to utilize the

results = swis.invoke('Orion.NPM.Interfaces', 'DiscoverInterfacesOnNode', node_id)

and

if_add_results = swis.invoke('Orion.NPM.Interfaces', 'AddInterfacesOnNode', node_id, ifaces, poll_engine)

 

There is some logic behind that tells it what interface types to ignore and everything works great.  The issue I have is that by adding interfaces this way I end up with only:

 

I cannot seem to locate where I would enable traffic and error statistics when using this method.  When I do this via auto discovery it works fine but the ASA's seem to be hit and miss as far as interface discovery goes.  When searching here for a solution I found the article pointing to the Cisco bug  so I thought I would try it this way which is when I found out that it does not include the above statistics.  I did not see anything in the documentation that talks about this so I thought i would ask.  I just need a pointer to the documentation that discusses this part or a sample of it being enabled. 

server admin and credentials

API to change polling engine

$
0
0

Does the API support change of polling engine. If so is there sample/reference code available


Orion API Update Custom Property True/False using PowerShell

powershell script to search node and delete

$
0
0

Please note that this script was based on this thwack message.

All I did was to change the swsql query used to get the URI and to search and delete a node via PowerShell

 

# This script will search for  node and delete it if exists

#

################################## Attention ###############################################

# You must have Orion SDK installed and set-execution policy must be set to unrestricted!!#

#Before running you must setup your hashed encrypted password using the line below.       #

###########################################################################################

 

#### Prerequisites ###

#  run the line below save credentials to be used by this script on a encrypted file

#GET-CREDENTIAL –Credential "EnterTheOrionUserNamehere” | EXPORT-CLIXML C:\Scripts\SecureCredentialsSAM.xml

## Load the SolarWinds Powershell snapin.

##Needed in order to execute the script.

##Requires the Orion SDK 2.0 installed on the machine this script is running from.

Add-PSSnapinSwisSnapin

# SolarWinds username and password section.

# It is recommended to use a local account create within SAM with only. I strongly recommend that you don't use a MS local account or domain account.

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

#This is using the hashed encrypted password

$MyCredentials=IMPORT-CLIXMLC:\Scripts\SecureCredentialsSam.xml

$ORIONSERVERNAME= 'yourserver.domain.com'

#This is connecting to SAM to pull the info we need need with the info given

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

$nodename=read-host"Enter node Name"

$nodeuri=Get-SwisData$swis"SELECT Uri FROM Orion.Nodes WHERe NodeName LIKE '%$nodename'"

if (!$nodeuri) {Write-Host"node does not exist on SAM"}

if ($nodeuri) {

Write-Host"node exist, uri: $nodeuri"

Remove-SwisObject$swis$nodeUri

Write-Host"node has been removed"

}

SWSQL or TSQL to Delete a Node from Solarwinds Tables when the Node is no longer in Active Directory

$
0
0

I am trying to find a way to delete a node from Solarwinds, using Powershell, TSQL or SWSQL. I would download a list of Nodes in Active Directory that are currently joined to the domain. This would allow Solarwinds to stop monitoring, and alerting, on Nodes that have been removed from the Domain. This is a common problem for us since we use Solarwinds to monitor our Public PCs at the Columbus Library. We are using NPM 12.2

How to find out what items are in a group through SWQL

$
0
0

I am currently trying to find out what items are in various groups using the SDK. I want to know what nodes are in a given group so I can use the sdk to add another node if needed. I can not however find a table that shows me this information. Any help would be appreciated!

How to switch from SNMP to Agent monitoring from API

$
0
0

Hi,

 

     Could you give me the steps in order to switch from SNMP to Agent monitoring from REST API or powershell API.

 

     I wish I can do this because when I want a linux machine to solarwinds, I use SNMP discovery from REST API in order to get all Volume devices and Interface devices. After this I try to siwtch from SNMP to Agent Monitoring. I succed in installing the agent from REST API, but I can't succeed in switching from SNMT to Agent from REST API.

 

Thanks,

 

Regards,

 

Julien

Viewing all 2677 articles
Browse latest View live


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