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

"Object reference not set to an instance of an object." when adding new Node with SNMPv3

$
0
0

I am trying to add a NPM node with SDK through PowerShell using SNMPv3 as the Polling Method.

 

I CAN add the node using ICMP, WMI or SNMPv2 as below:

 

$NewNodeProps = @{

IPAddress = $IpAddress;

Caption = $NodNam;

EngineID = 1;

ObjectSubType = "ICMP";   

}

$NewNodeUri = New-SwisObject $swis -EntityType "Orion.Nodes" -Properties $NewNodeProps

 

 

$NewNodeProps = @{

IPAddress = $IpAddress;

Caption = $NodNam;

EngineID = 1;

ObjectSubType = "WMI";   

}

$NewNodeUri = New-SwisObject $swis -EntityType "Orion.Nodes" -Properties $NewNodeProps

 

 

$NewNodeProps = @{

IPAddress = $IpAddress;

Caption = $NodNam;

EngineID = 1;

ObjectSubType = "SNMP";

SNMPVersion = 2;

Community = "public";   

}

$NewNodeUri = New-SwisObject $swis -EntityType "Orion.Nodes" -Properties $NewNodeProps

 

All above result in the node created with the proper Polling Method.

 

However when I try to create using Polling Method of SNMPv3, as in the following:

 

$NewNodeProps = @{

IPAddress = $IpAddress;

Caption = $NodNam;

EngineID = 1;

ObjectSubType = "SNMP";

SNMPVersion = 3;

SNMPV3Username = "someone";

SNMPV3PrivMethod = "None";

SNMPV3AuthMethod = "MD5";

SNMPV3AuthKey = "somepassword";

}

$NewNodeUri = New-SwisObject $swis -EntityType "Orion.Nodes" -Properties $NewNodeProps

 

The response is:

 

New-SwisObject : Object reference not set to an instance of an object.

At line:69 char:19

+     $NewNodeUri = New-SwisObject $swis -EntityType "Orion.Nodes" -Properties $Ne ...

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

    + CategoryInfo          : InvalidOperation: (:) [New-SwisObject], FaultException`1

    + FullyQualifiedErrorId : SwisError,SwisPowerShell.NewSwisObject

 

Been researching for several hours now and cannot find the answer.

 

What am I missing?

 

 

Thanks in advance...

 

Mike


Orion SWQL Orion.PollNow feature?

$
0
0

Quick question for you and probably an easyish question but what does this do? (pollnodes) and can i use it through powershell to poll x nodes at anytime?

also what do the blue icons mean?

 

Cheers, Thwacksters

Nodes with Interfaces that are unknown

$
0
0

Hello Thwack!

 

I was going over my nodes and have found a bunch where under Traffic & Percent Utilization of Each Interface the status says UNKNOWN.  I tried repolling and rediscovering node and that does not restore it.  I started removing the nodes out of Orion and adding them back and it has worked but I am hoping there is some other way to do this.  Thanks!

Orion SWQL Orion.PollNow feature?

$
0
0

Quick question for you and probably an easyish question but what does this do? (pollnodes) and can i use it through powershell to poll x nodes at anytime?

also what do the blue icons mean?

 

Cheers, Thwacksters

Alert API Document To Pull Alert

$
0
0

Hi All,

 

Can you please share the document to Pull alert using API

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.

Nodes with Interfaces that are unknown

$
0
0

Hello Thwack!

 

I was going over my nodes and have found a bunch where under Traffic & Percent Utilization of Each Interface the status says UNKNOWN.  I tried repolling and rediscovering node and that does not restore it.  I started removing the nodes out of Orion and adding them back and it has worked but I am hoping there is some other way to do this.  Thanks!

how to input 'y' or 'yes' with powershell script to NCM

$
0
0

Hello, Team

is anybody who can give me an idea how to input the 'yes' or 'y' command when waiting for the user input.

want to automate the Nexus 3048 ios upgrade process with powershell script with NCM.

 

Also, powershell script can apply for multiple devices at the same time for example upgrade 100 devices at the same time for 1 powershell script.

 

for example

Images will be upgraded according to following table:

Module             Image         Running-Version             New-Version  Upg-Required

------  ----------------  ----------------------  ----------------------  ------------

     1            system             6.0(2)U1(2)             6.0(2)U3(1)           yes

     1         kickstart             6.0(2)U1(2)             6.0(2)U3(1)           yes

     1              bios      v1.2.0(08/25/2011)      v1.2.0(08/25/2011)            no

     1         power-seq                    v4.4                    v4.4            no

 

 

Switch will be reloaded for disruptive upgrade.

Do you want to continue with the installation (y/n)?  [n] y   <--- here, how to input 'y' command with powershell script ??

 

Install is in progress, please wait.

Performing runtime checks.

[####################] 100% -- SUCCESS

Setting boot variables.

[####################] 100% -- SUCCESS

Performing configuration copy.

[####################] 100% -- SUCCESS

Finishing the upgrade, switch will reboot in 10 seconds.

as20a.w40216b.x460.krccw#


Network Discovery with a schedule

$
0
0

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

Thanks in advance to anybody that can help,

--Rob

swql full outer join?

$
0
0

Is a full outer join possible in swql?

 

(Full disclosure, I'm probably a C-student in  SQL intermediate class on a good day...)

Trying to get at alert history for purposes of alert integration with another tool.  The following query is exactly what I need but unfortunately in SWQL, it doesn't appear to support FULL OUTER JOINs

 

SELECT        AlertHistory.AlertHistoryID, AlertHistory.AlertActiveID, AlertHistory.EventType AS EventTypeID,                         CASE AlertHistory.[EventType] WHEN 0 THEN 'Triggered' WHEN 1 THEN 'Reset' WHEN 2 THEN 'Acknowledged' WHEN 3 THEN 'Note' WHEN 4 THEN 'AddedToIncident' WHEN 5 THEN 'ActionFailed' WHEN 6 THEN                          'ActionSucceeded' WHEN 7 THEN 'Unacknowledge' WHEN 8 THEN 'Cleared' ELSE 'Unknown' END AS EventType, AlertObjects.RelatedNodeCaption, AlertObjects.EntityNetObjectId, AlertConfigurations.Severity,                         AlertHistory.Message, AlertHistory.TimeStamp, AlertObjects.AlertID, AlertStatusView.AlertMessage, AlertHistory.AlertObjectID, AlertConfigurations.ObjectType, AlertObjects.EntityCaption
FROM            AlertConfigurations INNER JOIN                         AlertObjects ON AlertConfigurations.AlertID = AlertObjects.AlertID FULL OUTER JOIN                         AlertStatusView ON AlertObjects.AlertObjectID = AlertStatusView.AlertObjectID FULL OUTER JOIN                         AlertHistory ON AlertObjects.AlertObjectID = AlertHistory.AlertObjectID
WHERE        (AlertHistory.EventType = 0) OR                         (AlertHistory.EventType = 1)
ORDER BY AlertHistory.AlertHistoryID DESC

NCM Account Limitations using SWISv3

$
0
0

Hi all,

 

We are using the API to retrieve some node data from NPM with an Orion account limited by an account limitation (based on a Node custom property)

Testing in SWQL studio everything works for Orion.Nodes entity:

However, the same does not apply for NCM.Nodes or Cirrus.Nodes where every node is visible to the (limited) user account:

 

NCM.Nodes:

Cirrus.Nodes:

 

Has anyone came across this before? SolarWinds does not support the API so we've hit a dead end here.

any way to close tabs in swql studio?

$
0
0

I cannot figure out a way to close tabs in swql studio, is there a way?  am I nuts?

 

Thanks!

CreateLimitation not working

$
0
0

Hi,

 

For internal use i have created a gui where my colleagues can create accounts and assign groups of nodes to that account without having to login via the admin panel.
This has been in use for roughly a year now, but recently, as in today, a issue has come up where the create limitation function called via rest suddenly stopped working correctly.

 

Example of the data for the rest call :

 

            $action = 'https://exampleserverip:17778/SolarWinds/InformationService/v3/Json/Invoke/Orion.Limitations/CreateLimitation';

            $data = [18, null, [$assignmentId], null, $accountId];

 

 

This creates a group of groups limitation for a specified account.

When i check on the admin panel is see that under the account the limitation gets correctly created. But when i login with the created user all the nodes are visible.

When i simply edit and save the limitation via the admin panel without changing anything the account can only see the nodes that are in the limitation.

I know that there is a delay when creating the limitation via rest before the changes applies, but my colleagues made a account before lunch and when they returned the limitation was still not applied

 

The strange thing is that deletelimitation and updatelimition both work fine.

 

I'm a bit stuck now so i don't know if anyone has a idea what the issue may be?

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....

CreateLimitation not working

$
0
0

Hi,

 

For internal use i have created a gui where my colleagues can create accounts and assign groups of nodes to that account without having to login via the admin panel.
This has been in use for roughly a year now, but recently, as in today, a issue has come up where the create limitation function called via rest suddenly stopped working correctly.

 

Example of the data for the rest call :

 

            $action = 'https://exampleserverip:17778/SolarWinds/InformationService/v3/Json/Invoke/Orion.Limitations/CreateLimitation';

            $data = [18, null, [$assignmentId], null, $accountId];

 

 

This creates a group of groups limitation for a specified account.

When i check on the admin panel is see that under the account the limitation gets correctly created. But when i login with the created user all the nodes are visible.

When i simply edit and save the limitation via the admin panel without changing anything the account can only see the nodes that are in the limitation.

I know that there is a delay when creating the limitation via rest before the changes applies, but my colleagues made a account before lunch and when they returned the limitation was still not applied

 

The strange thing is that deletelimitation and updatelimition both work fine.

 

I'm a bit stuck now so i don't know if anyone has a idea what the issue may be?


Orion SDK & Python

$
0
0

Hello Orion Community

 

I am new to Solarwinds and Solarwinds SDK. I have been presented with the challenge of finding a way to automate the adding of nodes to Solarwinds.

I have experience with python and I feel fairly comfortable with it. However, I am finding difficultly using Orion SDK python methods.

I've been able to find instructions and general guidance with most python methods I've used. I am not able to find any details on how Orion's methods are used.

I am reviewing the examples and trying to reverse engineer them. However, it would be nice if some one could explain them. Please help if you can.

NCM Account Limitations using SWISv3

$
0
0

Hi all,

 

We are using the API to retrieve some node data from NPM with an Orion account limited by an account limitation (based on a Node custom property)

Testing in SWQL studio everything works for Orion.Nodes entity:

However, the same does not apply for NCM.Nodes or Cirrus.Nodes where every node is visible to the (limited) user account:

 

NCM.Nodes:

Cirrus.Nodes:

 

Has anyone came across this before? SolarWinds does not support the API so we've hit a dead end here.

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.

Update IPAM records using Orion SDK - not supported?

$
0
0

Hi,

I'm establishing automation for our infrastructure, where on of the automated actions will be to reserve IP address in IPAM.

i have already managed to get free Ip address by network, but i also need to change the status of the ip record to 1 (reserved)

Update function not supported by SWQL, so being advised by this page https://github.com/solarwinds/OrionSDK/wiki/REST i have tried this HTTP request:

POST https://ipam.domain.com:17778/SolarWinds/InformationService/v3/Json/swis://ipam.domain.com/Orion/IPAM.IPNode/IpNodeId=40…

with body:

{"Status":1}

 

The response i got:

{

  "Message": "Operation not supported on IPAM.IPNode",

  "ErrorCode": 20,

  "UserMessage": "Operation not supported on IPAM.IPNode",

  "ExceptionType": "SolarWinds.Data.AccessDeniedException",

  "FullException": "SolarWinds.Data.AccessDeniedException: Operation not supported on IPAM.IPNode\r\n   at SolarWinds.InformationService.Core.CrudProcessor.CheckAccessControl(AccessControlOperations operations, IEntityType entity, IEnumerable`1 propertyNames, IAccessControlResolver accessControlResolver)\r\n   at SolarWinds.InformationService.Core.CrudProcessor.UpdateInternal(Boolean bulkMode, SwisUriResolver uriResolver, IDictionary`2 propertiesToUpdate, IQueryExecutionContext context)\r\n   at SolarWinds.InformationService.Core.CrudProcessor.Update(SwisUri uri, IDictionary`2 propertiesToUpdate, IQueryExecutionContext context)\r\n   at SolarWinds.InformationService.Core.InformationService.Update(String uri, IDictionary`2 propertiesToUpdate)"

}

 

Could you please help me to understand what am i doing wrong?

 

Thanks in advance

PowerShell: Correct SQL Select Statement with LIKE

$
0
0

I'm trying to get my PowerShell select statement correct, I can get the correct response with the SWQL, but it does not work for me in the PS script.  I'm sure it's easy, but not sure what I'm missing. 

 

SQL statement that works in SWQL Studio is:

 

SELECT DefinitionID, ContainerID, Expression, Definition

FROM Orion.ContainerMemberDefinition

WHERE ContainerID='23' AND Expression LIKE '%362'

 

Result 140

 

In PowerShell

 

$MemberPrimaryID = '362'

$ContainerID = '23'

 

$definitionID = get-swissdata $swis 'SELECT definitionID from Orion.ContainMemberDefinition Where ContainerID='$ContainerID' AND 'Definition' LIKE '%$MemberPrimaryID'"

 

It runs with no issues, but it does not return a valid value.  With the SQL statement I get 140 as the result with PowerShell I get nothing..

Viewing all 3719 articles
Browse latest View live


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