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

Orion SDK --Perl -- Add node issue

$
0
0

Using below Perl code against our standalone NCM setup, I can create new node and attach "SNMP" pollers to it. I can see, through querying SWQL, that the software (NCM 7.2.1) populate node data in Orion.Nodes (vendor, vendor icon, systemoid, location..) but only when it due for next discovery (30mins), I dont see the software discover it at first place after added. Also when drilling into node detail page, all the information under Node details are suppressed. Checking the Orion.DiscoveredPoller and DiscoverNodes, I could not see my new node in either of them, Am i missing anything?

 

 

 

***** extracted code ****

 

my $AddedNode = $swis->Create('Orion.Nodes',

    {

    IPAddress=> $ip,

    IPAddressGUID=>ip2guid($ip),

    EntityType=>'Orion.Nodes',

    Caption=>$node_name,

    DynamicIP=>$False,

    EngineID=>$True,

    Status=>$True,

    UnManaged=>$False,

    Allow64BitCounters=>$True,

    External=>$False,

    ObjectSubType=>"SNMP",

    Community=>"xxxxxxxx",

    SNMPVersion=>2,

    Comments=>"added by script",

    });

 

$swis->Create("Orion.Pollers", {

            'PollerType'=>$poller,

            'NetObject'=>"N:$node",

            'NetObjectType'=>'N',

            'NetObjectID'=>$node

            });


PowerShell or Python ?

$
0
0

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

Manage/Unmanage nodes via powershell

$
0
0

Hi,

 

I have tried to follow the below and I am stuck

Silence Group of Nodes

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

 

This is the script im using

 

# 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 = "test"

$password = "test123"

 

# 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 = 'slt-sol-app-99'
$nodename = $env:COMPUTERNAME

 

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

$nodeid = Get-SwisData $swis "SELECT NodeID FROM Orion.Nodes WHERE SysName LIKE 'slt-jim-esx-562'"

$now =[DateTime]::UtcNow

$later =$now.{AddMinutes(20)}

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

 

But I get the error

 

Invoke-SwisVerb : no viable alternative at input '<EOF>' in Where clause

At H:\My Documents\Monitoring And Alerting\Solarwinds\Scripts\unmanage.ps1:58 char:16

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

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

    + FullyQualifiedErrorId : SwisError,SwisPowerShell.InvokeSwisVerb

 

On the first link above bluefunelemental says

 

"Try for each $node in $nodeid. As it is this is only pulling the one group ID on the loop"

 

And then theroberts says it worked without showing what he had done.  Can someone point me in the wright direction?

SWQL entity for disabling NetFlow/CBQoS?

$
0
0

I have a few hundred routers I need to disable NetFlow collection as well as CBQoS on globally, so naturally I'd like to script it. I've been looking for an entity to call using Python. Can anyone provide what I'm after, and possibly an example use?

SWQL connection changed between ForecastCapacity and Nodes.CustomProperties?

$
0
0

Hopefully someone here will have a sense of what might have changed here.

 

Previously, I had reports set up with the "Top Capacity Problems" resource utilizing those nice colored charts to send to different teams to let them know their predicted volume run outs.

 

Similar to other resources, you simply have a filter line that you can use to filter out different objects that you do not want to appear.

 

I can still filter on ForecastCapacity columns and Nodes columns, but the one thing I am no longer able to do (I think since the upgrade to 6.2.4) is utilize the Nodes Custom Properties as column values that can be filtered.

 

It used to be that from this resource, you could simply add Nodes.CustomProperties.Department='<value>' but now no formatting appear to work to connect the resource to the Nodes Custom Properties.  SW Support was not able to determine the formatting.

 

Has the formatting changed?  Has the connection in SWQL somehow been broken on this resource over to Nodes.CustomProperties?

 

Can anyone help?

 

Thanks in advance!

- Matt

Trying to add a node with the add_node.py script

$
0
0

I get the following errors:

 

Add an SNMP v2c node:

/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:769: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html

  InsecureRequestWarning)

Adding node 127.0.0.1... DONE!

Traceback (most recent call last):

  File "add_node2.py", line 71, in <module>

    main()

  File "add_node2.py", line 33, in main

    nodeid = re.search('(\d+)$', results).group(0)

  File "/usr/lib64/python2.7/re.py", line 142, in search

    return _compile(pattern, flags).search(string)

TypeError: expected string or buffer

 

Any ideas?

Orion SDK with PowerShell - manage/unmanage multiple nodes

$
0
0

I've been able to script unmanaging and managing nodes in powershell. However, for 400+ nodes, this ends up taking quite a while. Via script, it takes about 7 minutes to unmanage the nodes and over 10 minutes to remanage them. Doing this from the website takes about 25 seconds and no more than a minute, respectively. My guess is that the website somehow group updates the database instead of doing it one at a time. Anyone else seen this or have any idea how to do more than one node at a time? Below is sample code for how I am unmanaging a single node:

 

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

 

Thanks for any advice you have!

Setting CreateCorePluginConfiguration details for Orion.Discovery in python

$
0
0

I've been trying to manage adding and removing nodes using the API.  My language of choice is python.  I have most of the discovery profile details figured out, but am not able to understand how to set things linke the Volume Types, Vlan Port Types, etc...

 

I'm not able to figure out how to specify that I only want Flash and Ram volume types. Only Access and Trunk interfaces.

I've tried various permutations of (Look at the code for the details of where this is applied):

    'AutoImportStatus': [{'IfAutoImportStatus':'Up'}],    'AutoImportVlanPortTypes': [{'Trunk': False}, {'Access':False}]    'AutoImportVlanPortTypes': [{'VlanPortType':'Trunk'}, {'VlanPortType':'Access'}],    'AutoImportVolumeTypes': [{'VolumeType': 'FlashMemory'},{'VolumeType': 'RAM'}]

 

 

Here is the python code I have so far:

from __future__ import print_function
import re
import requests
from orionsdk import SwisClient


def main():
    npm_server = 'MyServer'    username = 'MyUser'    password = 'MyPass'    names = ['MyDev1','MyDev2','MyDev3']    bulkList_names = []    for name in names:        bulkList_names.append({'Address': name})    print (bulkList_names)    orion_engine_id = 1    swis = SwisClient(npm_server, username, password)    corePluginContext = {    'BulkList': bulkList_names,    'Credentials': [    {    'CredentialID': 5,    'Order': 1    }    ],    'WmiRetriesCount': 0,    'WmiRetryIntervalMiliseconds': 1000,    'IsDiscoveryForVimEnabled': False,
#    'AutoImportStatus': [{'IfAutoImportStatus':'Up'}],
#    'AutoImportVlanPortTypes': [{'Trunk': False}, {'Access':False}]
#    'AutoImportVlanPortTypes': [{'VlanPortType':'Trunk'}, {'VlanPortType':'Access'}],
#    'AutoImportVolumeTypes': [{'VolumeType': 'FlashMemory'},{'VolumeType': 'RAM'}]    }    corePluginConfig = swis.invoke('Orion.Discovery', 'CreateCorePluginConfiguration', corePluginContext)    discoveryProfile = {    'Name': 'API discovery',    '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': False,    '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()

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.

Modifying Alert Recipients via SDK

$
0
0

We're trying to amend our active alerts so that they include an additional recipient email address. We'd like to use the Orion SDK to achieve this. If I'm not wrong there are probably 2 ways of doing it - either directly updating the tables, or by using a verb in order to adjust the alerts. Trouble is I can't seem to find the right documentation or a snippet of script/code showing how to achieve this.

"Invalid Node" error on DiscoverInterfacesOnNode

$
0
0

Hi,

I want to invoke "DiscoverInterfaceOnNode" method. I get "InvalidNode" error. There is a node having "3" NodeID. When appears that error? When not exist or not having ant interfaces etc.? Briefly, what is the reason of that error?

 

dinode.png

How do I limit the scope of a query to the current node?

$
0
0

I am trying the following:

 

SELECT CS.RowID as RowID, IsNull(CS.Status, 0) as Value

FROM Orion.NPM.CustomPollerStatus CS

INNER JOIN Orion.NPM.CustomPollerAssignment CA ON CA.CustomPollerAssignmentID = CS.CustomPollerAssignmentID

WHERE (CA.CustomPollerID='E200B54B-C47B-42F7-89C6-5F0784724C0A') AND (CA.NodeID=${N=SwisEntity;M=NodeID})

 

But I cet an error message: "mismatched input '=' expecting ')' in Where clause"

 

If I try "AND (CA.NodeID=${NodeId}) the statement is ignored and all rows returned.

 

If I try the same with SQL:

 

SELECT CS.RowID as RowID, IsNull(CS.Status, 0) as Value

FROM CustomPollerStatus CS

INNER JOIN CustomPollerAssignment CA ON CA.CustomPollerAssignmentID = CS.CustomPollerAssignmentID

WHERE (CA.CustomPollerID='E200B54B-C47B-42F7-89C6-5F0784724C0A') AND (CA.NodeID=${NodeId})

 

I get "Query not valid".

None of the macro vaiants work for either SQL or SWQL queries....

IPAM + PowerShell

$
0
0

Greetings,

 

Used the following to get an available IP:How to use the IPAM API and get "Free IP Address"

 

Getting an error while trying to update any information:

Set-SwisObject : Operation not supported on IPAM.IPNode

 

While using the following:

 

$ip = Get-SwisData $swis 'SELECT TOP 1 I.DisplayName FROM IPAM.IPNode I WHERE Status=2 AND I.Subnet.DisplayName = ''1.1.0.0/24'''

$ipobject = Get-SwisObject -Uri (Get-SwisData $swis ('SELECT Uri from IPAM.IPNode where IPAddress = ''' + $ip + '''')) -SwisConnection $swis

 

$customProps = @{

  Description="TACOS";

}

 

Set-SwisObject -Uri $ipobject.Uri -SwisConnection $swis -Properties $customProps

 

Anyone trying to reserve IPs???

Upgrade from NMP 11.0.1 to 11.5 breaks SDK 1.10 set CustomProperties

$
0
0
Hello all,

I want to thank those that released the SDK.  It's a great tool and we've used it extensively.
We have a powershell script, using v1.10.16.0 of the SDK, which we use to add nodes, setup pollers, and set the nodes Custom Properties.  After upgrading Orion Network Performance Monitor from 11.0.1 to 11.5 values for Custom Properties no longer get set.  It's as if the initial node creation seems to no longer create the ground work or index for custom properties to be added/edited.  When we run the script there's no errors generated.
After a node is added via the PS script, if you go in through the WebGUI, and edit the custom properties of the node, save it and go back, the values for those custom properties have reverted back to the origional values.  We are not seeing any issues if a node is manually added via the GUI.  I have a feeling some of the tables have been split and it's almost like the '
Has anyone else run into this issue?
# Basic add node, add n-pollers, set some custom props (p.s. what circle of hell did I enter trying to copy and paste into this form's editor?)
#PSSnapin presence check/add
if (!(Get-PSSnapin-Name"SwisSnapin"-ErrorActionSilentlyContinue))
    { Add-PSSnapinSwisSnapin-ErrorActionSilentlyContinue }
# Default values
[string]$AlertingTier="SysOps Linux - P1 Very Urgent"
[string]$Access_KCNDataCenter="No"
[String]$KCNHardwareType="None"
[string]$ResponsibleGroup="Server Operations (Linux)"
[string]$Community="public"
[string]$SiteAddressState="MO"
ip2guid($ipString) {
  $ip=[System.Net.IPAddress]::Parse($ipString)
  $src=$ip.GetAddressBytes();
  $data=new-objectbyte[]16
  $src.CopyTo($data,$data.Length -$src.Length)
  $dest=new-objectbyte[]16
  [Array]::Copy($data,12,$dest,0,4)
  [Array]::Copy($data,10,$dest,4,2)
  [Array]::Copy($data,8,$dest,6,2)
  [Array]::Copy($data,6,$dest,8,2)
  [Array]::Copy($data,0,$dest,10,6)

  return (New-ObjectGuid (,$dest)).ToString()
}
AddPoller($PollerType) {
  $poller["PollerType"]=$PollerType;
  $pollerUri=New-SwisObject$swis-EntityType"Orion.Pollers"-Properties$poller
}

# Connect to SolarWinds
$SWhost ="cgslpwiswnpm01.centric.com"
$username="user"
$password =Read-Host-Prompt"Enter password"-AsSecureString
$cred =New-Object-typenameSystem.Management.Automation.PSCredential-argumentlist$username,$password
$swis = Connect-Swis-host$SWhost-cred$cred
# For simplicity just putting in a host and IP
# In the script we have steps to verify fqdn and ip
$hostname = 'somehost'
$ip = '10.0.0.1'
$ipGuid=ip2guid($ip)
# add a node
$newNodeProps= @{
  EntityType="Orion.Nodes";
  IPAddress=$ip;
  IPAddressGUID=$ipGuid;
  Caption=$hostname;
  DynamicIP=$False;
  Engine=1;
  Status=1;
  UnManaged=$False;
  Allow64BitCounters=$False;
  SysObjectID="";
  MachineType="";
  VendorIcon="";
  ObjectSubType="SNMP";
  SNMPVersion=2;
  Community=$Community;
}
$newNodeUri=New-SwisObject$swis-EntityType"Orion.Nodes"-Properties$newNodeProps
$nodeProps=Get-SwisObject$swis-Uri$newNodeUri

# register specific pollers for the node
$poller= @{
  NetObject="N:"+$nodeProps["NodeID"];
  NetObjectType="N";
  NetObjectID=$nodeProps["NodeID"];
}
### Create N-type Pollers
AddPoller("N.Status.SNMP.Native");
AddPoller("N.ResponseTime.ICMP.Native");
AddPoller("N.Details.SNMP.Generic");
AddPoller("N.Uptime.SNMP.Generic");
AddPoller("N.Cpu.SNMP.NetSnmpSystemStats");
AddPoller("N.Cpu.SNMP.NetSnmpCpuIdle");
AddPoller("N.Memory.SNMP.NetSnmpReal");
AddPoller("N.IPAddress.ICMP.Generic");

## Prepare a custom property value
$customProps= @{
  AlertingTier=$AlertingTier;
  ResponsibleGroup=$ResponsibleGroup;
  KCNHardwareType=$KCNHardwareType;
  SiteAddressState=$SiteAddressState;
  Comments="Host added by script";

## Build the Custom Properties node URI
$SWNodeURICP="$newNodeUri/CustomProperties"
## Set Custom Properties
Set-SwisObject$swis-Uri$SWNodeURICP-Properties$customProps



Using Powershell to add nodes with Custom Properties for Device Type

$
0
0

Hello,
Running Orion NPM 10.6.0 and SDK 1.7 on Win2k8R2

 

Can anyone help with adding devices into Orion using Powershell?

 

To complete via NPM Web console, select Management, Edit Node.
Select groups, break down the group to a specific node.
Choose node properties, then edit node.
Custom properties show Device_Type:

12-4-2013 3-35-46 PM.png

 

Sample script adding a server fails for the custom properties:
---------------

Add-PSSnapin SwisSnapin

# initialize SWIS connection
$swis = Connect-Swis -Certificate

# add a node
$newNodeProps = @
{
EntityType="Orion.NodesCustomProperties";
DisplayName="servername_here";
Device_Type="Server_Windows";
}

$newNodeUri = New-SwisObject $swis –EntityType "Orion.NodesCustomProperties" –Properties $newNodeProps

$nodeProps = Get-SwisObject $swis -Uri $newNodeUri Orion.Nodes

Output:
PS C:\> $newNodeUri = New-SwisObject $swis -EntityType "Orion.NodesCustomProperties" -Properties $newNodeProps
New-SwisObject : Cannot bind argument to parameter 'Properties' because it is null.
At line:1 char:89
+ $newNodeUri = New-SwisObject $swis -EntityType "Orion.NodesCustomProperties" -Properties <<<<  $newNodeProps
    + CategoryInfo          : InvalidData: (:) [New-SwisObject], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,SwisPowerShell.NewSwisObject

PS C:\>


Similar blog = http://thwack.solarwinds.com/message/163190#163190


SWQL queries not working in Custom Query and Custom Reports since NPM v12 but still working in SWQL studio

$
0
0

Hello World

 

before the upgrade to NPM v12 we were using some custom queries in order to extract IOPs per process from the database and create charts and tables with that. Everything was working beautifully until the upgrade to NPM v12, since then the query is not working (error message) on any web resources, however it still works in SWQL studio.

 

I've been troubleshooting the query and the issue is in the 'in (Select...)' statement. It works fine if you add values inside the in (example pec.componentid in ('10','20','30'...) but it doesn't with another WHERE clause.

 

 

It would be nice if we could get a response from the development team and if they could confirm that SWQL queries that are working in SWQL studio will also be working on the web interface? Otherwise, what's the point of SWQL studio? (yes, i know that there are lots of different things you can do with it, but this is one of the main ones, at least for a lot of SW users).

 

 

Query:

 

SELECT pec.componentid, ( pec.avgioreadoperationspersec + pec.avgiowriteoperationspersec )
AS avgiops, pec.timestamp, cst.componentprocessname, cst.componentprocessname + ' from ' + cst.componentname + ' on ' + n.caption
AS fullname
FROM orion.apm.processevidencechart pec inner join orion.apm.currentstatistics cst
ON cst.componentid = pec.componentid inner join orion.apm.component comp
ON comp.componentid = pec.componentid inner join orion.apm.applicationalert appl
ON appl.id = comp.applicationid inner join orion.nodes n
ON n.nodeid = appl.nodeid

WHERE pec.timestamp> ${FromTime} AND pec.timestamp< ${ToTime}
AND pec.componentid IN

 

(

SELECT top 10 componentid
FROM orion.apm.processevidencechart pec inner join orion.apm.component comp
ON comp.componentid = pec.componentid WHERE pec.timestamp> ${FromTime}
AND pec.timestamp< ${ToTime} AND avgioreadoperationspersec IS NOT NULL
AND avgiowriteoperationspersec IS NOT NULL AND comp.applicationid = ${applicationid}
GROUP BY componentid
ORDER BY avg ( avgioreadoperationspersec + avgiowriteoperationspersec )

DESC

)

 

The problem also is that we use this structure in order to extract other type of information....

 

Regards

 

Raul

 


Source entity [NPM.RoutingTable] not found in catalog - how do i get the catalog or convert table names into SWQL names?

$
0
0

Hi all,

 

Im using sql studio to browse the DB, and i can see that the table is name as such [SolarWindsOrion].[dbo].[NPM_RoutingTable]

 

Converting that into SWQL i would of presumed "Orion.NPM_RoutingTable" but im getting the error

 

"{u'Message': u'Source entity [NPM.RoutingTable] not found in catalog', u'ExceptionType': u'SolarWinds.Data.Query.EntityNotFoundException', u'FullException': u'SolarWinds.Data.Query.EntityNotFoundException: Source entity [NPM.RoutingTable] not found in catalog\r\n "

 

is there a way to browse the catalog to view the right names?

 

my query below:

 

core_01_route_query = """

  SELECT

  NodeID,

  RouteDestination,

  RouteNextHop

  FROM

  Orion.NPM_RoutingTable

    WHERE

  NodeID = 35

"""

print swis.query(core_01_route_query)

 

Thanks

Set NCM Credentials

$
0
0

Hello all -

 

I've managed to successfully create nodes using v3, and add that node to NCM with v2.  One thing I am not seeing though is  how to set the credentials for NCM?

 

I used

 

XmlDocument xdoc = new System.Xml.XmlDocument();

XmlElement[] elem = new System.Xml.XmlElement[1];

XmlElement xel = xdoc.CreateElement("coreNodeId");

this._NodeID.ToString();

client.invoke("Cirrus.Nodes", "AddNodeToNCM", elem);

 

Is there part of the XML that would set the credentials?

SWQL "Group By" command for Custom Query dashboard resource

$
0
0

Trying to display data gathered from a custom script monitor within a custom query resource on our dashboard view - however I can't seem to get the query to actually display grouped data - instead I just end up with a list of data as if I didn't group anything in the first place.

 

select n.Caption as Node, ac.Name, de.StringData as Data from Orion.APM.Application app
JOIN Orion.Nodes n
on n.NodeID=app.NodeID
JOIN Orion.APM.Component ac
on ac.ApplicationID=app.ApplicationID
JOIN Orion.APM.ComponentStatus cs
on cs.ComponentID=ac.ComponentID
inner join
(select ComponentID, max(TimeStamp)as TimeStamp from Orion.APM.ComponentStatus
group by ComponentID)cs2
on (cs.ComponentID=cs2.ComponentID and cs.TimeStamp=cs2.TimeStamp)
JOIN Orion.APM.DynamicEvidence de
on de.ComponentStatusID=cs.ID
where app.Name='DR Monitors'
and de.StringData is not NULL
and n.NodeID=3639
GROUP BY n.Caption, ac.Name, de.StringData, ac.ComponentOrder
Order by ac.ComponentOrder

 

In this example, I'm pulling one NodeID, but eventually I'll want to do any with the same Application Monitor.  It displays all lines - but really I want a node header with components and stats beneath like a typical report.

 

Thanks in advance for any feedback.

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

Viewing all 3719 articles
Browse latest View live


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