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

Description property of an Application

$
0
0

Hello Thwackers,

 

I am hoping to make use of this Description variable from within an application. It will be filled with some extra text which will be appended to the alert when it triggers.

 

 

However, I can't find the description field anywhere in the Web GUI for the application and if I try using PowerShell: -

 

Set-SwisObject $swis -Uri 'swis://localhost/Orion/Orion.Nodes/NodeID=2216/Applications/ApplicationID=1909' -Properties @{ Description = 'Extra text' }

 

I get the error message

 

Set-SwisObject : Operation not supported on Orion.APM.Application

 

 

Can anyone help please?!

 

Thanks

Paul


More Automated Discovery

$
0
0

With a lot of help from some very knowledgeable people here I have managed to build a script for discovering network devices that works but, I have a few more questions.

1. Depending on the location and type of network device (router, switch, loadbalancer, firewall) I'm discovering, a different SNMP community string may be required. What I'm needing to confirm is wether this syntax will work in terms of having the discovery process attempt to use multiple credentials until it hits a working one.

2. If I wanted to create a second script that was for windows servers only (WMI), do I need these?

3. What can be done to push the agent for discovery/polling in the script

 

 

$CorePluginConfigurationContext = ([xml]"
    <CorePluginConfigurationContext xmlns='http://schemas.solarwinds.com/2012/Orion/Core' xmlns:i='http://www.w3.org/2001/XMLSchema-instance'>
    <BulkList>
    <IpAddress><Address>$theAddress</Address></IpAddress>
    </BulkList>
    <Credentials>
     <SharedCredentialInfo>
      <CredentialID>6</CredentialID>
      <Order>1</Order>
      <CredentialID>3</CredentialID>
      <Order>2</Order>
      <CredentialID>4</CredentialID>
      <Order>3</Order>
      <CredentialID>5</CredentialID>
      <Order>4</Order>
      <CredentialID>10</CredentialID>
      <Order>5</Order>
      <CredentialID>9</CredentialID>
      <Order>6</Order>
     </SharedCredentialInfo>
    </Credentials>
    <WmiRetriesCount>1</WmiRetriesCount>
    <WmiRetryIntervalMiliseconds>15000</WmiRetryIntervalMiliseconds>
    </CorePluginConfigurationContext>
    ").DocumentElement

    $CorePluginConfiguration = Invoke-SwisVerb $swis Orion.Discovery CreateCorePluginConfiguration @($CorePluginConfigurationContext)
    $InterfacesPluginConfigurationContext = ([xml]"
    <InterfacesDiscoveryPluginContext xmlns='http://schemas.solarwinds.com/2008/Interfaces'
                                  xmlns:a='http://schemas.microsoft.com/2003/10/Serialization/Arrays'>
    <AutoImportStatus>
     <a:string>Up</a:string>
     <a:string>Down</a:string>
     <a:string>Shutdown</a:string>
    </AutoImportStatus>
    <AutoImportVirtualTypes>
     <a:string>Virtual</a:string>
     <a:string>Physical</a:string>
    </AutoImportVirtualTypes>
    <AutoImportVlanPortTypes>
     <a:string>Trunk</a:string>
     <a:string>Access</a:string>
     <a:string>Unknown</a:string>
    </AutoImportVlanPortTypes>
    <UseDefaults>true</UseDefaults>
    </InterfacesDiscoveryPluginContext>
    ").DocumentElement

    $InterfacesPluginConfiguration = Invoke-SwisVerb $swis Orion.NPM.Interfaces CreateInterfacesPluginConfiguration @($InterfacesPluginConfigurationContext)
    $DeleteProfileAfterDiscoveryCompletes = "false"
    $StartDiscoveryContext = ([xml]"
    <StartDiscoveryContext xmlns='http://schemas.solarwinds.com/2012/Orion/Core' xmlns:i='http://www.w3.org/2001/XMLSchema-instance'>
     <Name> $theAddress $([DateTime]::Now)</Name>
     <EngineId>$EngineID</EngineId>
     <JobTimeoutSeconds>3600</JobTimeoutSeconds>
     <SearchTimeoutMiliseconds>2500</SearchTimeoutMiliseconds>
     <SnmpTimeoutMiliseconds>2500</SnmpTimeoutMiliseconds>
     <SnmpRetries>1</SnmpRetries>
     <RepeatIntervalMiliseconds>2500000</RepeatIntervalMiliseconds>
     <SnmpPort>161</SnmpPort>
     <HopCount>0</HopCount>
     <PreferredSnmpVersion>SNMP2c</PreferredSnmpVersion>
     <DisableIcmp>false</DisableIcmp>
     <AllowDuplicateNodes>false</AllowDuplicateNodes>
     <IsAutoImport>true</IsAutoImport>
     <IsHidden>false</IsHidden>
     <PluginConfigurations>
      <PluginConfiguration>
       <PluginConfigurationItem>$($CorePluginConfiguration.InnerXml)</PluginConfigurationItem>
       <PluginConfigurationItem>$($InterfacesPluginConfiguration.InnerXml)</PluginConfigurationItem>
      </PluginConfiguration>
     </PluginConfigurations>
    </StartDiscoveryContext>

10.4.1 - use of Orion.Discovery verbs

$
0
0

I was using the SWQL Studio to look through a server newly updated to NPM 10.4.1 and noticed the verbs "CreateCorePluginConfiguration" and "StartDiscovery" on the new Orion.Discovery object. I was able to pull out the XML templates for their parameters from the Metadata.VerbArgument section, but I'm not clear on their usage. For some context, we're trying to programmatically add interfaces to a node and only add the new interfaces that are in an up/up state. It looks like we can do it if the interfaces are in the Orion.NPM.DiscoveredInterfaces table, but we don't know how to get them there and we're hoping/assuming that using these verbs will get them there.

 

I have three questions about actually using these verbs, and hoping someone here can provide some insight:

  1. Would using these verbs actually add a node/interfaces to the DiscoveredNodes/DiscoveredInterfaces tables, as we're hoping?
  2. It looks like we could use StartDiscovery if we can update the discovery engine on the fly to only discover the relevant IP address. Is this possible via SWIS? If so, does anyone have any guidance on updating the ranges for the discovery engine?
  3. It looks like CreateCorePluginConfiguration might get us what we want (i.e., a request to only discover specific IPs in a range.) Is there any guidance available on using this method in conjunction with StartDiscovery to do that?

 

Thanks!

API Network Discovery

$
0
0

Following the instructions on GitHub (Discovery · solarwinds/OrionSDK Wiki · GitHub ) I am attempting to create a very basic network scan where IP address's between 10.X.0.1-10.X.31.254 are scanned with the credential ID's provided.   I am assuming the 3 separate plugin configuration are all actually part of the same script ?  Assuming this is correct, when I run the script now, the system is expecting an argument at the line below

 

#Error expecting argument

PS C:\Users\nsd000.QACMA> C:\Users\nsd000.QACMA\Documents\PowerShell Scripts\Do not Modify\Discovery.ps1

 

cmdlet Invoke-SwisVerb at command pipeline position 1

 

Supply values for the following parameters:

 

Arguments[0]:

 

Invoke-SwisVerb : Verb Orion.NPM.Interfaces.CreateInterfacesPluginConfiguration requires 1 parameters not 0

 

At C:\Discovery.ps1:73 char:34

 

+ $InterfacesPluginConfiguration = Invoke-SwisVerb $swis Orion.NPM.Interfaces Crea ...

 

+                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

    + CategoryInfo          : InvalidOperation: (:) [Invoke-SwisVerb], FaultException`1

 

    + FullyQualifiedErrorId : SwisError,SwisPowerShell.InvokeSwisVerb

 

 

 

#The error above is referencing the line directly below

$InterfacesPluginConfiguration = Invoke-SwisVerb $swis Orion.NPM.Interfaces CreateInterfacesPluginConfiguration

 

#Complete Script Below, Everything above this line is describing the problem

#CONNECTION TO SWIS

$ErrorActionPreference = 'Stop'

#Add the snapin
Add-PSSnapin SwisSnapin

#create a connection to solarwinds

$hostname = 'X.X.X.X'
$username = 'X'
$password = 'X'

#swis = Connect-Swis -Hostanme $hostname -Trusted
$swis = Connect-Swis -Hostname $hostname -Username $username -Password $password

 

 

#Core Plugin Configuration

$CorePluginConfigurationContext = ([xml]"
<CorePluginConfigurationContext xmlns='http://schemas.solarwinds.com/2012/Orion/Core' xmlns:i='http://www.w3.org/2001/XMLSchema-instance'>
        <IpAddressRange>
            <StartAddress>10.X.0.1</StartAddress>
            <EndAddress>10.X.31.254</EndAddress>
        </IpAddressRange>
    <Credentials>
        <SharedCredentialInfo>
            <CredentialID></CredentialID>
            <CredentialID>1</CredentialID>
         <CredentialID>2</CredentialID>
         <CredentialID>11</CredentialID>
            <CredentialID>13</CredentialID>
            <CredentialID>20</CredentialID>
            <CredentialID>21</CredentialID>
         <CredentialID>47</CredentialID>
         <CredentialID>71</CredentialID>
            <CredentialID>89</CredentialID>
            <CredentialID>110</CredentialID>
            <CredentialID>156</CredentialID>
            <CredentialID>163</CredentialID>
            <CredentialID>170</CredentialID>
         <CredentialID>197</CredentialID>
            <CredentialID>198</CredentialID>
            <CredentialID>202</CredentialID>
            <Order>1</Order>
        </SharedCredentialInfo>
    </Credentials>
    <WmiRetriesCount>1</WmiRetriesCount>
    <WmiRetryIntervalMiliseconds>1000</WmiRetryIntervalMiliseconds>
</CorePluginConfigurationContext>
").DocumentElement

 

#Interface Plugin Configuration

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

$InterfacesPluginConfigurationContext = ([xml]"
<InterfacesDiscoveryPluginContext xmlns='http://schemas.solarwinds.com/2008/Interfaces'
                                  xmlns:a='http://schemas.microsoft.com/2003/10/Serialization/Arrays'>
    <AutoImportStatus>
        <a:string>Up</a:string>
        <a:string>Down</a:string>
        <a:string>Shutdown</a:string>
    </AutoImportStatus>
    <AutoImportVirtualTypes>
        <a:string>Virtual</a:string>
        <a:string>Physical</a:string>
    </AutoImportVirtualTypes>
    <AutoImportVlanPortTypes>
        <a:string>Trunk</a:string>
        <a:string>Access</a:string>
        <a:string>Unknown</a:string>
    </AutoImportVlanPortTypes>
    <UseDefaults>false</UseDefaults>
</InterfacesDiscoveryPluginContext>
").DocumentElement

$InterfacesPluginConfiguration = Invoke-SwisVerb $swis Orion.NPM.Interfaces CreateInterfacesPluginConfiguration

 

#Discovery Plugin Configuration

$EngineID = 1
$DeleteProfileAfterDiscoveryCompletes = "false"

$StartDiscoveryContext = ([xml]"
<StartDiscoveryContext xmlns='http://schemas.solarwinds.com/2012/Orion/Core' xmlns:i='http://www.w3.org/2001/XMLSchema-instance'>
    <Name>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>true</IsAutoImport>
    <IsHidden>$DeleteProfileAfterDiscoveryCompletes</IsHidden>
    <PluginConfigurations>
        <PluginConfiguration>
            <PluginConfigurationItem>$($CorePluginConfiguration.InnerXml)</PluginConfigurationItem>
            <PluginConfigurationItem>$($InterfacesPluginConfiguration.InnerXml)</PluginConfigurationItem>
        </PluginConfiguration>
    </PluginConfigurations>
</StartDiscoveryContext>
").DocumentElement)

 

#Running The Discovery ( I get the error noted at the top regardless of the line below.  To be honest, I guessed this would be at the bottom of the script.

$DiscoveryProfileID = (Invoke-SwisVerb $swis Orion.Discovery StartDiscovery @($StartDiscoveryContext)).InnerText

ADDING CUSTOM TABS TO THE TOP LEVEL NAV BAR with the API

$
0
0

Inspired by wluther's post on how to edit the db to create your own custom menu drop downs (Adding Custom Tabs To The Top Level Nav Bar ) I went ahead and scripted up some tools to simplify the process.

 

 

The basic explanation is that when the menu bars were redone as part of the UX update last year they added a few tables to the database that we will be manipulating to add our own additional toolbars.  Obviously keep in mind that database edits of this nature are unsupported so you should take precautions such as backing up your database before you get in there and start banging around, but once you are comfortable with the concept you may find yourself using it a lot.

 

Essentially it boils down to adding the drop down menu you want to the table callled WebViewGroup, then adding the link you want to the table called WebView, then linking those objects together via an entry on the table called WebViewGroupWebView.

 

The first tool I made, AddCustomMenusInteractively.ps1, is just a quick little prompt driven powershell script that will ask you for the name of the menu you want to add entries too, if that menu doesn't exist it creates it.

Then it asks you for the URL and Title you want your link to have.  If you wanted to add multiple new entries just run the tool again and tell it to use the same menu title as you created in the previous runs.  It's currently set up to run it locally on your Orion server and passes through your Windows login credential but you can edit it to work other ways if you need.

 

 

The second tool, AddCustomMenuSettingsLinks.ps1, is geared more as a time saving tool for myself.  As the SW admin I spend a ton of time bouncing between the settings menus and having to click into all settings, wait for that to load, then drill down into the next layer(s) that I needed to keep going to be where I want to be always annoyed me.  This adds a pre-populated stack of admin type links to the settings drop down.  I like putting them there because if an account isn't an admin in Orion they won't have that drop down available to them.  You can remove any links you don't need by commenting or deleting them from the big array of them around line 44.  The one big issue I learned when I made this is that can be some graphical glitches if your list is too long because the black background seems to only go to about 2/3 down the screen, the specific limit in terms of how many rows that is varies based on your screen resolution.  For my laptop it looks like about 23 rows is my max unless I zoom way out.  So staying under 20 rows in each menu is probably a reasonable practice there.

 

 

 

 

 

 

 

 

I'd love to see anyone else post up whatever cool things you all come up with as far as these menu bars.

 

-Marc Netterfield

    Loop1 Systems: SolarWinds Training and Professional Services

 

 

And for the people who have a hard time downloading the links here is the text of the scripts

 

######################## AddCustomMenusInteractively ##################################

 

<#------------- CONNECT TO SWIS -------------#>

# load the snappin if it's not already loaded (step 1)

if (!(Get-PSSnapin | Where-Object { $_.Name -eq "SwisSnapin" })) {

    Add-PSSnapin "SwisSnapin"

}

 

 

 

 

$hostname = "localhost"

$swis = Connect-Swis -Hostname $hostname -Trusted

 

 

#alternative connection method

#$user = "user"

#$password = "pass"

#$swis = connect-swis -host $hostname -username $user -password $password -ignoresslerrors

 

 

<#------------- ACTUAL SCRIPT -------------#>

 

 

$MenuTitle = Read-Host -Prompt "What is the title of the drop down menu you want to work with?"

 

 

# check if that drop down already exiss

$MenuTest = get-swisdata $swis @"

SELECT ID, Name, DefaultTitle, Tags, SortOrder, OrionFeatureName, URI

FROM Orion.Web.ViewGroup

where DefaultTitle = '$MenuTitle'

"@

 

 

if (!$MenuTest) {

    $MenuProps = @{

    Name = $MenuTitle.replace(' ','')

    DefaultTitle = $MenuTitle

    Tags = "navigation"

    SortOrder = 99

}

    "`Creating new menu called $MenuTitle"

    $MenuResults = New-SwisObject -SwisConnection $swis -EntityType "Orion.Web.ViewGroup" -Properties $MenuProps

 

 

} else {

    $MenuResults = $MenuTest.URI

}

 

 

"`Menu called $MenuTitle exists..."

 

 

$ViewURL = Read-Host -Prompt "What is the URL you want to add to this menu? (You can provide full URL's or use relative links by starting the address with a '/')"

$ViewTitle = Read-Host -Prompt "What is the title you want to give to this item?"

 

 

$ViewProps = @{

    Name = $ViewTitle.replace(' ','-')

    DefaultTitle = $ViewTitle

    Type = "legacy"

    URL = $ViewURL

    IsCustom = "True"

    SortOrder = 0

    OpenInNewWindow = "False"

}

 

 

"`Creating new menu item called $ViewTitle under $MenuTitle"

$ViewResults = New-SwisObject -SwisConnection $swis -EntityType "Orion.Web.View" -Properties $ViewProps

 

 

$MenuID = get-swisdata $swis @"

SELECT ID FROM Orion.Web.ViewGroup where uri = '$MenuResults'

"@

 

 

$ViewID = get-swisdata $swis @"

SELECT ID FROM Orion.Web.View where uri = '$ViewResults'

"@

 

 

$LinkViewtoGroup = Invoke-SwisVerb $swis 'Orion.Reporting' 'ExecuteSQL' @"

INSERT WebViewGroupWebView (WebViewGroupID, WebViewID, SortOrder)

VALUES ($MenuID,$ViewID,0)

"@

 

$ClearCache = Invoke-SwisVerb $swis 'Orion.Web.Menu' 'ClearCache' -Arguments ""

 

############################## End #########################################

 

 

######################## AddCustomMenSettingsLinks ##################################

 

 

<#------------- CONNECT TO SWIS -------------#>

# load the snappin if it's not already loaded (step 1)

if (!(Get-PSSnapin | Where-Object { $_.Name -eq "SwisSnapin" })) {

    Add-PSSnapin "SwisSnapin"

}

 

 

 

 

$hostname = "localhost"

$swis = Connect-Swis -Hostname $hostname -Trusted

 

 

#alternative connection method

#$user = "user"

#$password = "pass"

#$swis = connect-swis -host $hostname -username $user -password $password -ignoresslerrors

 

 

<#------------- ACTUAL SCRIPT -------------#>

 

 

$MenuTitle = "Settings"

 

 

# check if that drop down already exiss

$MenuTest = get-swisdata $swis @"

SELECT ID, Name, DefaultTitle, Tags, SortOrder, OrionFeatureName, URI

FROM Orion.Web.ViewGroup

where DefaultTitle = '$MenuTitle'

"@

 

 

if (!$MenuTest) {

    $MenuProps = @{

    Name = $MenuTitle.replace(' ','')

    DefaultTitle = $MenuTitle

    Tags = "navigation"

    SortOrder = 99

}

    "`Creating new menu called $MenuTitle"

    $MenuResults = New-SwisObject -SwisConnection $swis -EntityType "Orion.Web.ViewGroup" -Properties $MenuProps

 

 

} else {

    $MenuResults = $MenuTest.URI

}

 

 

"`Menu called $MenuTitle exists..."

 

 

$Links = @(

    @{ URL = "/Orion/Nodes/Add/Default.aspx"; Title = "Add Node";},

    @{ URL = "/Orion/AgentManagement/Admin/ManageAgents.aspx"; Title = "Manage Agents";},

    @{ URL = "/Orion/Admin/Accounts/Accounts.aspx"; Title = "Manage Orion Accounts";},

    @{ URL = "/Orion/Alerts/Default.aspx"; Title = "Manage Alerts";},

    @{ URL = "/Orion/Admin/PollingSettings.aspx"; Title = "Polling Settings";},

    @{ URL = "/Orion/Admin/Credentials/CredentialManager.aspx"; Title = "Manage Orion Credentials - Windows";},

    @{ URL = "/Orion/Admin/Credentials/SNMPCredentialManager.aspx"; Title = "Manage Orion Credentials - SNMPv3";},

    @{ URL = "/Orion/Admin/CPE/Default.aspx"; Title = "Manage Custom Properties";},

    @{ URL = "/Orion/Admin/CPE/InlineEditor.aspx"; Title = "Edit Custom Properties";},

    @{ URL = "/Orion/Admin/DependenciesView.aspx"; Title = "Manage Dependencies";},

    @{ URL = "/Orion/Admin/Containers/Default.aspx"; Title = "Manage Groups";},

    @{ URL = "/Orion/Reports/Default.aspx"; Title = "Manage Reports";},

    @{ URL = "/Orion/Admin/ListViews.aspx"; Title = "Manage Views";},

    @{ URL = "/Orion/WorldMap/Manage.aspx?"; Title = "Manage Worldwide Map";},

    @{ URL = "/Orion/APM/Admin/Default.aspx"; Title = "SAM Settings";},

    @{ URL = "/Orion/APM/Admin/Applications/Default.aspx"; Title = "Manage Assigned Applications";},

    @{ URL = "/Orion/APM/Admin/ApplicationTemplates.aspx"; Title = "Manage Application Templates";},

    @{ URL = "/Orion/APM/Admin/Components/Templates.aspx"; Title = "Manage Application Components";},

    @{ URL = "/Orion/NCM/Admin/Default.aspx"; Title = "NCM Settings";},

    @{ URL = "/Orion/TrafficAnalysis/Admin/NetflowSettings.aspx"; Title = "NTA Settings";},

    @{ URL = "/Orion/Admin/Details/ModulesDetailsHost.aspx"; Title = "License Details";}

)

 

 

$Order = 1

foreach ($Link in $links) {

    $ViewURL = $Link.URL

    $ViewTitle = $Link.Title

 

 

    $ViewProps = @{

        Name = $ViewTitle.replace(' ','-')

        DefaultTitle = $ViewTitle

        Type = "legacy"

        URL = $ViewURL

        IsCustom = "True"

        SortOrder = $Order++ # alternatively you can set all your rows to have the same order and Orion will sort alphabetically

        OpenInNewWindow = "False"

    }

 

 

    "`Creating new menu item called $ViewTitle under $MenuTitle"

    $ViewResults = New-SwisObject -SwisConnection $swis -EntityType "Orion.Web.View" -Properties $ViewProps

 

 

    $MenuID = get-swisdata $swis " SELECT ID FROM Orion.Web.ViewGroup where uri = '$MenuResults' "

 

 

    $ViewID = get-swisdata $swis " SELECT ID FROM Orion.Web.View where uri = '$ViewResults' "

 

 

    $LinkViewtoGroup = Invoke-SwisVerb $swis 'Orion.Reporting' 'ExecuteSQL' @"

INSERT WebViewGroupWebView (WebViewGroupID, WebViewID, SortOrder)

VALUES ($MenuID,$ViewID,$Order)

"@

}

 

$ClearCache = Invoke-SwisVerb $swis 'Orion.Web.Menu' 'ClearCache' -Arguments ""

 

 

############################## End #########################################

Solarwinds API for all events.

$
0
0

Dear team,

 

Can any one help me in getting all the solarwinds events by API

Connection error while updating node

$
0
0

Hi,

There is a problem about updating custom property. As you see images, while updating custom property for any node, Key-value pair is "CINUM-XXXX".

 

I got this error message, "The connection was not closed. The connection's current state is open.".

 

Why got this message?

 

Platform version:

Orion Platform 2017.1.1 SP1, CloudMonitoring 1.0.0, SAM 6.4.0, DPAIM 11.0.0, NCM 7.6, VIM 7.1.0, QoE 2.3, NetPath 1.1.0, NPM 12.1

PS: We installed "Orion Platform 2017.1 - Hot Fix 1"

 

Code.png

 

Error.png

method to call external api or other real time integration?

$
0
0

We are new to SolarWinds SDK and we’re looking at the API to integrate with a custom help desk ticketing system. 

 

Our question has to do with polling NPM for alerts.  We want near real time alerts without risking “over polling” the API to the point that NPM performance could be degraded.  We’re specifically looking for an event-based alert option, such that when an alert is triggered a process can be launched to push a notification to our ticketing system to auto create tickets?  Our help desk system has its own API that we would like to call rather than having to poll the Orion API or deal with the complications of ingesting and parsing SMTP messages.

 

We can’t find a method for this in the SDK and we want to verify if this is possible.

 

On a related note, we see that Orion can send SNMP traps.  It seems that this is based on events regarding the health and status of Orion modules, and not necessarily based on alerts triggered by systems being monitored by Orion modules.  Is that correct or is it possible to do event-based alerts of monitored systems using SNMP?

 

Again we are new to SolarWinds and we’re building out a platform to monitor over 20K elements so we really want to build the most efficient system possible.


Nodes added via SDK stay Unknown status

$
0
0

I added some ICMP-only nodes with SDK via PowerShell as a test, and they're staying in Unknown status after hours of waiting for something to pop in.

 

This didn't happen with the ones I added from the same subnet using the normal Add Node function.  To keep it simple, the only properties I assigned them were EngineID, IPAddress, Caption, and ObjectSubType. Was there something more I should've done?

Enable QoE Management w/ REST Client

$
0
0

I was wondering if someone can point me in the right direction on how to enable QoE management of a node via the SDK REST.

 

Basically I have a list of nodes that I want to enable it for. I am familiar with listing interfaces, adding interfaces, update/adding pollers but I haven't figured this part out.

 

 

Thanks,

Will Lipford

SWQL VSCode Extension?

$
0
0

Forgive as I don't know the technical background for what would be required to do this but, I'm thinking it would be nice to have a Visual Studio Code extension for SWQL. Ideally it would be nice to duplicate the capabilities of SWQL Studio in VScode but, even a simple linting capability would be great. 

 

My main push for this is that I use a Chromebook full time at work with VScode running in Linux and any less reliance on Windows applications would be great.

Create Container with Parent in Powershell

$
0
0

I can't seem to get a script of mine working, can someone help me figure this out?  I'm still pretty new to using the API and I maybe touch PowerShell twice a year, so this is kinda new territory for me.  Whenever I try to run it, it asks me for the EntityName, so I already know it doesn't work like it does in my head.

 

Here's the script:

 

 

param(

[string]$parentID,

[string]$name,

[int]$statCalc)

 

#Credentials should be passed from outside in a variable called $cred.

 

# Connect to SWIS

$hostname = "localhost"

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

 

# Define Properties

$newContainerProps = @{

    parentID = $parentID;

    Name = $name;

statusCalculator = $statCalc;

 

    # === default values ===

 

    frequency = 60;

    owner = 'CORE'

    Description = 'Active-Passive Pair of Service Monitors'

    pollingEnabled = 'TRUE'

}

 

#Create the Container

Invoke-SwisVerb $swis -Verb createContainerWithParent -Arguments $newContainerProps

Help converting SQL to SWIS

$
0
0
  • We are trying to convert the following query to SWIS and quite frankly having trouble finding examples that utilize joins like this.  We built the query using the Orion Report Writer.

 

  • Query:

 

SELECT  TOP 10000 Nodes.Caption AS NodeName,

Case InBandwidth

            When 0 Then 0

            Else (In_Averagebps/InBandwidth) * 100

            End AS Recv_Percent_Utilization,

Case OutBandwidth

            When 0 Then 0

            Else (Out_Averagebps/OutBandwidth) * 100

            End AS Xmit_Percent_Utilization,

Interfaces.Caption AS Interface_Caption,

InterfaceTraffic.DateTime AS DateTime,

Interfaces.InterfaceID AS InterfaceID

 

FROM

(Nodes INNER JOIN Interfaces ON (Nodes.NodeID = Interfaces.NodeID))  INNER JOIN InterfaceTraffic ON (Interfaces.InterfaceID = InterfaceTraffic.InterfaceID AND InterfaceTraffic.NodeID = Nodes.NodeID)

 

WHERE

( DateTime BETWEEN 43406.5833333333 AND 43407.625 )

AND 

(

  (Nodes.Caption LIKE 'rtr1.dc5024%') AND

  (Interfaces.Caption LIKE '%AT&T%') AND

  (Nodes.area = 'remote_distributioncenter_rdc')

)

 

 

  • It would be really nice to have a SWIS converter as our customers are requesting more and more to pull data from the Solarwinds API without having to write in the SWQL/SWIS langauge.

How to find if a subnet is available for allocation

$
0
0

I'm trying to programmatically create subnets and have run across the following challenge: How do you determine if a subnet is already in use?

 

Here's a snippet from my code, which gets subnet attributes from the database:

 

# Get the subnet attributes
q = swis.query("SELECT TOP 1 " \    "SubnetId, Address, CIDR, Comments, VLAN, Location, Description, URI " \    "FROM IPAM.Subnet "\    "WHERE (Address = '{}' AND CIDR = {})".format(        net.network_address,        net.prefixlen        )

If this returns an empty result set, then we know that the subnet does not exist, which is great. But say I have a subnet allocated already on 10.1.1.0/24, and I ask IPAM if 10.1.1.0/28 is available? It will tell me that the 28 does not exist, which is not what I want.

 

Any ideas?

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.


Unable to get active interfaces for a device using SWIS

$
0
0

Hi folks,

 

Anybody successfully tested adding all "active interfaces" for a device. My script throws "AdminStatus: 4, OperStatus: 0" for both "up/down" interfaces. How do I set only "active" interfaces to be monitored through SWIS API?

 

Below is my code & the screenshot from Orion WebUI.

 

            all_interfaces = swis.invoke('Orion.NPM.Interfaces', 'DiscoverInterfacesOnNode', nodeID)['DiscoveredInterfaces']

        for interface in all_interfaces:

            print "Name: {0}, AdminStatus: {1}, OperStatus: {2}".format(interface["Caption"],interface["ifOperStatus"],interface["ifAdminStatus"])

        break

 

        >> OUTPUT

Name: lo0, AdminStatus: 4, OperStatus: 0

Name: ge-0/0/10, AdminStatus: 4, OperStatus: 0

Name: ge-0/0/3.0, AdminStatus: 4, OperStatus: 0

Name: ge-0/0/11, AdminStatus: 4, OperStatus: 0

Name: ge-0/0/12, AdminStatus: 4, OperStatus: 0

 

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 access to Resources and ResourceProperties tables

$
0
0

Hi,

 

I'm wondering if anyone has found a way of querying the Resources and Resourceproperties Tables via the SDK. I've looked throught the V3 schema and doesn't appear to be any related classes to those database tables. I'm just trying to avoid doing a database connection directly if it can be retrieved via the SDK. We have some custom reports where the report configurations are stored in those tables. The closest related Class is the Orion.Views, but that doesn't provide the associated resources to the view.

 

Thanks

Vicente

Can anyone provide an example of how to supress alerts using the rest API, I've stumbled around but I can't seem to get it to work.

Orion.Accounts GroupPriority

$
0
0

Hello All,

 

I wonder if someone might be able to help me. I am looking for a way to pull out a list of all the AD Groups in my environment so that I can review the Priority Order. I can get this via SQL easily enough, but when I try to use SDK and SWQL it lets me down. For some reason, it doesn't appear to recognise the GroupPriority column as existing.

 

SQL Example:

SELECT AccountID,GroupPriority
FROM [dbo].[Accounts]
WHERE GroupPriority >=1
Order by GroupPriority

 

However, if I try and perform the statement from Orion.Accounts in SWQL it fails.

 

Any ideas?

Viewing all 2677 articles
Browse latest View live


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