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

Verbs and their parameters for IPAM.IPNode in addition to 'UpdateManyStatus'??

$
0
0

PREFACE:

  1. I'll be referring to the blog: How to use the IPAM API and get "Free IP Address" specifically a post by mtokarz on June 12, 2014 2:35PM in response to jgovednik
  2. I am also aware of and have voted for the feature request: Add SWIS features to IPAM
  3. I have also referred to this question post: Re: Full documentation of Orion SDK verbs? to see if any verbs exist for IPAM.IPNode, but none that I can find.

 

Following the post mentioned in #1, I am able to successfully find the next free ip address and update the status of an IP address in Solarwinds using Powershell:

 

Pre-reqs: Download the Orion SDK: solarwinds/OrionSDK · GitHub

 

Getting a Free IP Address:

# START Connect to SWIS

Add-PSSnapin SwisSnapin

$hostname = "mysolarwinds"

$username = "myuser"

$password = ConvertTo-SecureString -String "mypassword" -asplaintext -force

$creds = New-Object -TypeName System.Management.Automation.PSCredential -Argumentlist $username, $password

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

# END Connect to SWIS


Function SWOIPAM-GetFreeIpAddress($subnetAddress)

{

  $ipaddress = Get-SwisData $swis 'SELECT TOP 1 I.DisplayName FROM IPAM.IPNode I WHERE Status=2 AND I.Subnet.Address=@subnetAddress AND I.DnsBackward IS NULL' @{subnetAddress = $subnetAddress}

  return $ipaddress

}


$subnetProvision = 'X.X.X.X'

SWOIPAM-GetFreeIpAddress($subnetProvision)

 

Where:

  • $subnetProvision = Desired subnet to get next available IP Address from

 

Updating the Free IP Address' status from 'Available' to 'Used':

$postParams = @{__EVENTTARGET='ctl00$BodyContent$ctl05';__EVENTARGUMENT='';'ctl00$BodyContent$Username'='admin';'ctl00$BodyContent$Password'='password'}

Invoke-WebRequest -Uri http://mysolarwinds:8787/Orion/Login.aspx?autologin=no -Method POST -SessionVariable s -Body $postParams

$postParams =  @{'entity'='IPAM.IPNode';'verb'='UpdateManyStatus';'ObjectId'='129';'ipstatus'='1';'ids'='4'}

Invoke-WebRequest -Uri http://mysolarwinds:8787/Orion/IPAM/ExtCmdProvider.ashx -Method POST -WebSession $s -Body $postParams

 

Where:

  • ObjectID : type = number => SubnetId from IPAM.IPNode
    • One can obtain the SubnetId with the query: SELECT SubnetId, Address, FriendlyName, VLAN FROM IPAM.Subnet
  • ipstatus : type = number => where 1 (Used), 2 (Available), 4 (Reserved)
  • ids : type = number => the 4th octet of the IP Address you want to update in the specified subnet

 

THE QUESTION:

If the verb 'UpdateManyStatus' (with the params of ObjectID, ipstatus and ids) exist for IPAM.IPNode to update a particular IP address' status,

(@{'entity'='IPAM.IPNode';'verb'='UpdateManyStatus';'ObjectId'='129';'ipstatus'='1';'ids'='4'}),

are there any other verbs or documentation of verbs with necessary parameters for IPAM.IPNode that will update the DnsBackward (hostname), Comments and SkipScan fields for a particular IP Address??


If I can find out the verbs and their necessary parameters, then I would be able to update via the same method used for updating an IP Address' status in Powershell.

 

Thank you


Invalid username or password when connecting to Orion SDK via Powershell

$
0
0

I keep receiving invalid Username/password. My Orion account is linked with AD. Anyway I can connect using my AD credentials?

API GET fails if first result contains a null value

$
0
0

When attempting to pull a list of devices from the API, if the first result contains a null value for one of the attributes, the API returns an error.

 

Sample query: SELECT Status,LastSystemUpTimePollUtc,ObjectSubType FROM Orion.Nodes ORDER BY ip WITH ROWS 1 TO 100 (modified)

 

Result via SWQL Studio:

Status        LastSystemUpTimePollUtc  ObjectSubType

1                NULL                                    ICMP

1                NULL                                    ICMP

1                2017-11-22 20:01:03.603    SNMP

 

Result via API pull in browser:

{"Message":"Cannot set Column 'LastSystemUpTimePollUtc' to be null. Please use DBNull instead.","ExceptionType":"System.ArgumentException","FullException":"System.ArgumentException: Cannot set Column 'LastSystemUpTimePollUtc' to be null. Please use DBNull instead.\u000d\u000a at System.Data.DataRow.set_Item(DataColumn column, Object value)\u000d\u000a at SolarWinds.InformationService.Serialization.DataTableSerializer.Serialize(IQueryExpr query, ISchema schema, IQueryResultReader reader)\u000d\u000a at SolarWinds.InformationService.Serialization.DataTableSerializer.PrepareSerialize(IQueryExpr query, ISchema schema, IQueryResultReader reader)\u000d\u000a at SolarWinds.InformationService.Core.InformationService.RunQuery(String query, IDictionary`2 parameters, IDataSerializer serializer)"}

 

Additional Test: If I perform a query and the first result doesn't have a null value for LastSystemUpTimePollUtc, the API pull works.

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.

Setting NCM Global Connection Profile in script

$
0
0

Hello,

 

I've found that this will set my node properties to "Yes" for "Manage node(s) with NCM":

    Invoke-SwisVerb$swisCirrus.NodesAddNodeToNCM @($NodeId)

 

 

But I'm unable to find a way to set the Global Connection Profile.

 

I assume it's another verb(?), but I can't seem to put it together.

 

I can get the profiles and select the ID for the one I want:

     $ConnectionProfiles=Invoke-SwisVerb$swisCirrus.NodesGetAllConnectionProfiles

     $NCMConnectionProfileId= ($ConnectionProfiles.ConnectionProfile.Name |? {$_.'#text'-eq$NCMProfileName}).Id

 

But I'm not sure how to get that associated with the node from there.

 

TIA

    

 

 

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

Invoke-SwisVerb - Access Denied

$
0
0

I was advised by SolarWinds support to post a question on the community forms.  I am trying to run the below command and receive access is denied errors.  The account is a full admin on the server and in the IPAM application.  Any help would be greatly appreciated.

 

'Invoke-SwisVerb $swis IPAM.SubnetManagement GetFirstAvailableIp @("10.99.99.0", "24")'. 

 

How to fetch Total Ingress & Egress Bytes for Orion.NetFlow.IPAddressGroups using SDK

$
0
0

Hi All,

I have SWQL Studio and NTA installed. I created multiple IP Address Group and would like to get Ingress and Egress Bytes for a particular IPAddressGroup using SWQL Studio. What are the inputs that I should give in the SWQL Query to fetch Ingress and Egress Byte count:

 

This is the SWQL on right side pane from Orion.NetFlow.IPAddressGroupsConversationsTop:

SELECT ConversationID, SourceIPGroupID, DestinationIPGroupID, SourceIPGroupName, DestinationIPGroupName, NodeID, InterfaceID, TotalBytes, TotalPackets, TotalBytesIngress, TotalBytesEgress, TotalPacketsIngress, TotalPacketsEgress
FROM Orion.NetFlow.IPAddressGroupsConversationsTop

WHERE SourceIPGroupName='Airoli-Axis'

I am getting the below output when execute the SQL Query:

"The parameters 'Filter,Limit,Topkey' are missing for entry Orion.NetFlow.IPAddressGroupsConversationsTop"

Does anyone tested with the above and help me out.

 

thanks in advance

Arun


Create/Update operations are not working for Orion.Accounts through SolarWinds Rest API

$
0
0

We are trying to create Accounts in Solar winds system through Rest API URI: https://<HOST>:17778/SolarWinds/InformationService/v3/Json/Create/Orion.Accounts but, we are getting following error message in the API response.

SolarWinds.Data.AccessDeniedException: Operation not supported on Orion.Accounts\u000d\u000a at SolarWinds.InformationService.Core.CrudProcessor.CreateAccessDeniedException(String message)

 

We have provide the admin access to the API login, Can you please let us know if Create/update operations are supported on Orion.Accounts object through Restful API?. If not, Can you please suggest any alternative APIs available in Solarwinds to achieve this reuirement?.

Rest API 403 after a WEB UI Certificate upgrade

$
0
0

Anyone have experience/direction/hints on this type of problem?

 

--Steve

 

Case #1360290

 

WEB UI Certificate (443) was upgraded and working API calls started receiving 403 errors.  Certificates were replaced on UI (443) and we still received the 403 error.

 

API certificates were not touched.

 

The account can login to the Web UI.

 

Note following example has IP, hostname and account name replaced.

 

$  curl  -v -k -u rjf\\myADaccount https://TheHost.rjf.com:17778/SolarWinds/InformationService/v3/Json/Query

Enter host password for user 'rjf\\myADaccount':

* STATE: INIT => CONNECT handle 0x600057930; line 1410 (connection #-5000)

* Added connection 0. The cache now contains 1 members

* STATE: CONNECT => WAITRESOLVE handle 0x600057930; line 1446 (connection #0)

*   Trying 99.99.999.999...

* TCP_NODELAY set

* STATE: WAITRESOLVE => WAITCONNECT handle 0x600057930; line 1527 (connection #0)

* Connected to TheHost.rjf.com (99.99.99.999) port 17778 (#0)

* STATE: WAITCONNECT => SENDPROTOCONNECT handle 0x600057930; line 1579 (connection #0)

* Marked for [keep alive]: HTTP default

* ALPN, offering h2

* ALPN, offering http/1.1

* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH

* successfully set certificate verify locations:

*   CAfile: /etc/pki/tls/certs/ca-bundle.crt

  CApath: none

* TLSv1.2 (OUT), TLS header, Certificate Status (22):

* TLSv1.2 (OUT), TLS handshake, Client hello (1):

* STATE: SENDPROTOCONNECT => PROTOCONNECT handle 0x600057930; line 1593 (connection #0)

* TLSv1.0 (IN), TLS handshake, Server hello (2):

* TLSv1.0 (IN), TLS handshake, Certificate (11):

* TLSv1.0 (IN), TLS handshake, Server key exchange (12):

* TLSv1.0 (IN), TLS handshake, Server finished (14):

* TLSv1.0 (OUT), TLS handshake, Client key exchange (16):

* TLSv1.0 (OUT), TLS change cipher, Client hello (1):

* TLSv1.0 (OUT), TLS handshake, Finished (20):

* TLSv1.0 (IN), TLS change cipher, Client hello (1):

* TLSv1.0 (IN), TLS handshake, Finished (20):

* SSL connection using TLSv1.0 / ECDHE-RSA-AES256-SHA

* ALPN, server did not agree to a protocol

* Server certificate:

*  subject: CN=SolarWinds-Orion

*  start date: Jan 29 17:05:33 2015 GMT

*  expire date: Dec 31 23:59:59 2039 GMT

*  issuer: CN=SolarWinds-Orion

*  SSL certificate verify result: self signed certificate (18), continuing anyway.

* STATE: PROTOCONNECT => DO handle 0x600057930; line 1614 (connection #0)

* Server auth using Basic with user 'rjf\\myADaccount'

> GET /SolarWinds/InformationService/v3/Json/Query HTTP/1.1

> Host: TheHost.rjf.com:17778

> Authorization: Basic ***removed***

> User-Agent: curl/7.54.1

> Accept: */*

>

* STATE: DO => DO_DONE handle 0x600057930; line 1676 (connection #0)

* STATE: DO_DONE => WAITPERFORM handle 0x600057930; line 1801 (connection #0)

* STATE: WAITPERFORM => PERFORM handle 0x600057930; line 1811 (connection #0)

* HTTP 1.1 or later with persistent connection, pipelining supported

< HTTP/1.1 403 Forbidden

< Content-Length: 0

* Server Microsoft-HTTPAPI/2.0 is not blacklisted

< Server: Microsoft-HTTPAPI/2.0

< Date: Thu, 30 Nov 2017 15:58:23 GMT

<

* STATE: PERFORM => DONE handle 0x600057930; line 1980 (connection #0)

* multi_done

* Connection #0 to host TheHost.rjf.com left intact

How to add only UP interfaces using Python/Orion sdk

$
0
0

I can add the nodes and interfaces using the Python script. I used the DiscoverInterfaceOnNode to add the new interfaces and specify the specific interfaces as well. Up to this point everything is good.

 

The issue is it will add that type of interfaces(E.G Gig,eth etc) either that is UP or Down. My goal is to add only UP interfaces. Can someone please put me in a right direction or share any example to help me fix this.

How do we programmatically discover the non-interface properties [in Orion] and enable them

$
0
0

We are automating the hydration of assets in Orion, and after adding a node, we know how to discover the interfaces, but how do we programmatically discover the non-interface properties and enable them like the sample below?Orion interface discovery ss.png


Thanks,

Scott F.


Accessing custom poller data via the API?

$
0
0

I'm curious if it's possible to access the data returned from an NPM custom poller via the API?

 

I can see the custom poller configuration via SWQL, but am stumped on a way to query the datastore programatically.....

 

Many thanks for any guidance.

No snap-ins have been registered for Windows PS v. 5.0

$
0
0

Hi Thwack,

 

As I was trying to unmanage whole groups at a time I stumbled upon OrionSDK and with that, PowerOrion.

I have installed OrionSDK and copied the PowerOrion directory to C:\Windows\System32\WindowsPowerShell\v1.0\Modules\.

Whenever I try to either Import-Module PowerOrion or Add-PSSnapin SwisSnapin I get this:

 

PS C:\Company> Add-PSSnapin SwisSnapin 

Add-PSSnapin : No snap-ins have been registered for Windows PowerShell version 5.

At line:1 char:1

+ Add-PSSnapin SwisSnapin

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

    + CategoryInfo          : InvalidArgument: (SwisSnapin:String) [Add-PSSnapin], PSArgumentException

    + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand

 

 

 

PS C:\Company> Import-Module PowerOrion

Add-PSSnapin : No snap-ins have been registered for Windows PowerShell version 5.

At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PowerOrion\PowerOrion.psm1:5 char:1

+ Add-PSSnapin SwisSnapin

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

    + CategoryInfo          : InvalidArgument: (SwisSnapin:String) [Add-PSSnapin], PSArgumentException

    + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand

 

I've tried running the following without success: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe 'C:\Program Files (x86)\SolarWinds\Orion SDK\SWQL Studio\SwisPowerShell.dll'

 

Any help is greatly appreciated.

 

Glad Regards,

Frederik Bruun

SDK or API to show fixed disks not monitored

$
0
0

I´m looking for an API or SDK to show me all fixed disks not monitored yet.


Node Resource Discovery Via JSON API

$
0
0

So the configuration seems to be properly set.

 

The community is being properly set and I get a completed discovery profile status but the polling and interface discovery isnt automatically working using the JSON api.

 

It will only work if I manually click in the UI to poll and list resources, then it will find everything.

 

CONFIG DATA

 

[{"Name": "app1.phx1",

   "EngineID": 1,

   "JobTimeoutSeconds": 3600,

   "SearchTimeoutMiliseconds": 2000,

   "SnmpTimeoutMiliseconds": 2000,

   "SnmpRetries": 3,

   "RepeatIntervalMiliseconds": 1500,

   "SnmpPort": 161,

   "HopCount": 0,

   "PreferredSnmpVersion": "SNMP2c",

   "DisableIcmp": "false",

   "AllowDuplicateNodes": "false",

   "IsAutoImport": "true",

   "IsHidden": "true",

   "PluginConfigurations": [  

       {"PluginConfigurationItem":"<?xml version='1.0' encoding='utf-16'?><PluginItems><knownTypes><ArrayOfstring xmlns:i='http://www.w3.org/2001/XMLSchema-instance' xmlns='http://schemas.microsoft.com/2003/10/Serialization/Arrays'><string>SolarWinds.Orion.Core.Models.Discovery.CoreDiscoveryPluginConfiguration,SolarWinds.Orion.Core.Models</string></ArrayOfstring></knownTypes><pluginItem><ArrayOfDiscoveryPluginConfigurationBase xmlns:i='http://www.w3.org/2001/XMLSchema-instance' xmlns='http://schemas.datacontract.org/2004/07/SolarWinds.Orion.Core.Models.Discovery'><DiscoveryPluginConfigurationBase xmlns:d2p1='http://schemas.solarwinds.com/2008/Orion' i:type='d2p1:CoreDiscoveryPluginConfiguration'><d2p1:ActiveDirectoryList /><d2p1:AddressRange /><d2p1:AgentsAddresses xmlns:d3p1='http://schemas.microsoft.com/2003/10/Serialization/Arrays' /><d2p1:AutoImportVolumeTypes xmlns:d3p1='http://schemas.datacontract.org/2004/07/SolarWinds.Common.Snmp' i:nil='true' /><d2p1:BulkList xmlns:d3p1='http://schemas.microsoft.com/2003/10/Serialization/Arrays'><d3p1:string>IP_HIDDEN</d3p1:string></d2p1:BulkList><d2p1:Credentials><d2p1:credentials><knownTypes><ArrayOfstring xmlns:i='http://www.w3.org/2001/XMLSchema-instance' xmlns='http://schemas.microsoft.com/2003/10/Serialization/Arrays' /></knownTypes><pluginItem><d2p1:ArrayOfCredential xmlns:i='http://www.w3.org/2001/XMLSchema-instance' /></pluginItem></d2p1:credentials></d2p1:Credentials><d2p1:DiscoverAgentNodes>false</d2p1:DiscoverAgentNodes><d2p1:PreferredPollingMethod>SNMP</d2p1:PreferredPollingMethod><d2p1:SharedCredentials xmlns:d3p1='http://schemas.microsoft.com/2003/10/Serialization/Arrays'><d3p1:KeyValueOfintint><d3p1:Key>1</d3p1:Key><d3p1:Value>3</d3p1:Value></d3p1:KeyValueOfintint></d2p1:SharedCredentials><d2p1:SubnetList /><d2p1:WMICredentials /><d2p1:WmiRetries>2</d2p1:WmiRetries><d2p1:WmiRetryInterval>PT1S</d2p1:WmiRetryInterval></DiscoveryPluginConfigurationBase></ArrayOfDiscoveryPluginConfigurationBase></pluginItem></PluginItems>"},

       {"PluginConfigurationItem":"<?xml version='1.0' encoding='utf-16'?><PluginItems><knownTypes><ArrayOfstring xmlns:i='http://www.w3.org/2001/XMLSchema-instance' xmlns='http://schemas.microsoft.com/2003/10/Serialization/Arrays'><string>SolarWinds.Interfaces.Common.Models.Discovery.InterfacesDiscoveryPluginConfiguration,SolarWinds.Interfaces.Common</string></ArrayOfstring></knownTypes><pluginItem><ArrayOfDiscoveryPluginConfigurationBase xmlns:i='http://www.w3.org/2001/XMLSchema-instance' xmlns='http://schemas.datacontract.org/2004/07/SolarWinds.Orion.Core.Models.Discovery'><DiscoveryPluginConfigurationBase xmlns:d2p1='http://schemas.solarwinds.com/2008/Interfaces' i:type='d2p1:InterfacesDiscoveryPluginConfiguration'><d2p1:AutoImportExpressionFilter xmlns:d3p1='http://schemas.datacontract.org/2004/07/' i:nil='true' /><d2p1:AutoImportStatus xmlns:d3p1='http://schemas.datacontract.org/2004/07/SolarWinds.Interfaces.Common.Enums'><d3p1:IfAutoImportStatus>Up</d3p1:IfAutoImportStatus><d3p1:IfAutoImportStatus>Down</d3p1:IfAutoImportStatus><d3p1:IfAutoImportStatus>Shutdown</d3p1:IfAutoImportStatus></d2p1:AutoImportStatus><d2p1:AutoImportVirtualTypes xmlns:d3p1='http://schemas.datacontract.org/2004/07/System'><d3p1:boolean>true</d3p1:boolean><d3p1:boolean>false</d3p1:boolean></d2p1:AutoImportVirtualTypes><d2p1:AutoImportVlanPortTypes xmlns:d3p1='http://schemas.datacontract.org/2004/07/SolarWinds.Orion.Core.Models.Enums'><d3p1:VlanPortType>Trunk</d3p1:VlanPortType><d3p1:VlanPortType>Access</d3p1:VlanPortType><d3p1:VlanPortType>Unknown</d3p1:VlanPortType></d2p1:AutoImportVlanPortTypes><d2p1:DiscoverVLANs>false</d2p1:DiscoverVLANs></DiscoveryPluginConfigurationBase></ArrayOfDiscoveryPluginConfigurationBase></pluginItem></PluginItems>"}    

   ]

  }]

 

This works fine.

 

This is the details of the Node after creation.

 

NODE DATA

 

Array

(

    [NodeID] => ID_HIDDEN

    [ObjectSubType] => SNMP

    [SNMPVersion] => 2

    [Community] => publ1c15

    [IP] => IP_HIDDEN

    [IPAddressType] => IPv4

    [Caption] => UT_app1.phx1_11-14_07:42

    [NodeDescription] => app1.phx1

    [Description] =>

    [Status] => 1

    [SystemUpTime] =>

    [PercentMemoryAvailable] =>

    [MemoryAvailable] =>

    [MemoryUsed] => -2

    [TotalMemory] =>

    [CPULoad] => -2

    [EngineID] => 1

    [UnManaged] =>

    [UnManageFrom] => 1899-12-30T00:00:00.0000000Z

    [UnManageUntil] => 1899-12-30T00:00:00.0000000Z

    [Uri] => NODE_URL

    [Division] => PremierWest

    [Delimiter] => |

    [VIP] => No

    [SystemsGrouping] => SystemsGrouping

    [NetcoolNotify] => Yes

    [SmartWan] => Yes

    [CustomerName] => TELE : PHX1

    [CustomerID] => 30848

)

 

It just simply wont poll and detect resources automatically only manually. Can you let me know what I need to do.

 

It wont detect the machine type, memory, all those things automatically.

 

Thank you.

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.

Create/Update operations are not working for Orion.Accounts through SolarWinds Rest API

$
0
0

We are trying to create Accounts in Solar winds system through Rest API URI: https://<HOST>:17778/SolarWinds/InformationService/v3/Json/Create/Orion.Accounts but, we are getting following error message in the API response.

SolarWinds.Data.AccessDeniedException: Operation not supported on Orion.Accounts\u000d\u000a at SolarWinds.InformationService.Core.CrudProcessor.CreateAccessDeniedException(String message)

 

We have provide the admin access to the API login, Can you please let us know if Create/update operations are supported on Orion.Accounts object through Restful API?. If not, Can you please suggest any alternative APIs available in Solarwinds to achieve this reuirement?.

SWQL GetDate()

$
0
0

Hi all,

 

I cannot get the GetDate() function to work in a query.  I have the code for a brilliant SQL job query written by another user.  It lists all jobs and their status.

 

I want to list all jobs other than succeeded and this works fine but I also want to only list the ones for the last 48 hours.  You can see near the bottom I have added the GetDate but it refuses to work.

 

Can one of you experts tell me what I am doing wrong?

SQWL Query to select SourcePort and DestinationPort

$
0
0

Hello,

 

I am trying to run this query in SWQL:

 

SELECT TotalBytes, TotalPackets, SourceIPSort, DestIPSort, Protocol, ProtocolName, SourcePortName, DestPortName, SourcePort, DestPort, SourceAppID, DestAppID, StartTime, SourceSinglePort, DestSinglePort, DisplayName, Description, InstanceType, Uri, InstanceSiteId

FROM Orion.NetFlow.ConversationsDetailReport

(Filter='NSF:C:10000000001-255249000001;TD:2016-11-22T00:00:00~2017-11-23T00:00:00,1,True,True')

 

However, there seem to be no results.

 

Is this table populated at all? And is it possible to upload data onto it?

 

Your help would be really appreciated.

 

Paolo

Viewing all 3719 articles
Browse latest View live


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