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

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


How do I add CPU, RAM, and Disk pollers to a new SNMP node via the Python API?

$
0
0

I am attempting to add nodes via SNMP using python.  I have previously been using ICMP to add the nodes only for Status and response time polling, but would like to expand further and gather more information automatically.  Is there a good way to try to authenticate over SNMP using the SNMP string, and if the string verifies, add the node?  I currently am using this snippet of code, and it does successfully add an SNMP node, but the only statistics that show up on the node page are for Average Response Time and Packet Loss, but CPU load, Memory, and any disks are not detected.  I may not be fully understanding the polling aspect and how it works in regards to the API, but I would like to essentially recreate what happens when I "List Resources" on a node and select which disks, CPU, RAM, and other properties to monitor.  If someone could take a look at my poller options and let me know if I am making a mistake somewhere that would be great.


Also, can I use some sort of try/catch exception handling when adding SNMP nodes, in case the string does not authenticate, I can revert back to adding the node via simply ICMP?


Thanks!


uri = swis.create(EntityType,   IPAddress = IP_input,   IPAddressGUID = ip_to_guid(IP_input),   Caption = str(IP_input),   DynamicIP = False,   EngineID = 1,   Status = 1,   UnManaged = False,   Allow64BitCounters = True,   ObjectSubType = "SNMP",   MachineType = "",   VendorIcon = "",   RediscoveryInterval = 30,   PollInterval = 60,   StatCollection = 1,   City = "REDACTED",   Managed_Monitored = "REDACTED",     Node_Type = "TBD",   ALERT_CPU = 90,   ALERT_RAM = 90,   Community = 'REDACTED',   SNMPVersion=2   )  # Get all object properties for new node added  obj = swis.read(uri)  snmpDetailsUri = swis.create("Orion.Pollers", PollerType = "N.Details.SNMP.Generic", NetObject="N:" + str(obj["NodeID"]), NetObjectType="N", NetObjectID=obj["NodeID"])  snmpUptimeUri = swis.create("Orion.Pollers", PollerType = "N.Uptime.SNMP.Generic", NetObject="N:" + str(obj["NodeID"]), NetObjectType="N", NetObjectID=obj["NodeID"])  snmpCpuUri = swis.create("Orion.Pollers", PollerType = "N.Cpu.SNMP.HrProcessorLoad", NetObject="N:" + str(obj["NodeID"]), NetObjectType="N", NetObjectID=obj["NodeID"])  snmpMemoryUri = swis.create("Orion.Pollers", PollerType = "N.Memory.SNMP.NetSnmpReal", NetObject="N:" + str(obj["NodeID"]), NetObjectType="N", NetObjectID=obj["NodeID"])  snmpAssetInventoryUri = swis.create("Orion.Pollers", PollerType = "N.AssetInventory.Snmp.Generic", NetObject="N:" + str(obj["NodeID"]), NetObjectType="N", NetObjectID=obj["NodeID"])  snmpResponseTimeUri = swis.create("Orion.Pollers", PollerType = "N.ResponseTime.SNMP.Native", NetObject="N:" + str(obj["NodeID"]), NetObjectType="N", NetObjectID=obj["NodeID"])  snmpStatusUri = swis.create("Orion.Pollers", PollerType = "N.Status.SNMP.Native", NetObject="N:" + str(obj["NodeID"]), NetObjectType="N", NetObjectID=obj["NodeID"])  snmpTopologyUri = swis.create("Orion.Pollers", PollerType = "N.Topology_Layer3.SNMP.ipNetToMedia", NetObject="N:" + str(obj["NodeID"]), NetObjectType="N", NetObjectID=obj["NodeID"])

VerbArgument Example for 'AddResourceToView'

$
0
0

Hello Thwack Community,

 

Looking to automate the creation of custom query / swql resources. Here is what I have from the Metadata.VerbArgument table in SWQL Studio filtering on the 'AddResourceToView' activity -

 

**REQUIRED - Name: viewID  = ViewID to add resource to - I’m good on this.

 

**REQUIRED -  Name: config = This is what I need Assuming what is needed: PropertyName, PropertyValue

Can someone provide an example string/format/syntax to get me started with creating a resource?

 

Name: moveColliding = Not sure what this does

 

Great Thanks,  =swql

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!

SDK Introduction

$
0
0

Would anyone be able to point me to an article or reference material where some very basic and easy tasks are completed using the API ? 

ValidateCustomProperty Verb

$
0
0

Both Orion.NodesCustomProperties and Orion.VolumesCustomProperties have a Verb named, "ValidateCustomProperty".  Does anyone know what this verb does?  Can anyone provide the parameters required for it and the expected output?

 

From a lot of trial and error it seems that the verb expects 5 parameters: 3 strings, an integer, and a list of strings.  The output I get is a property bag with 2 properties: {"Status":3,"ErrorMessage":null}.  However, the format of the input and the meaning of the output remain vague.

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.

Database model

$
0
0

Is there an overview of the exposed tables where I can see how the entities in each table relate to each other?

 

It some times take a bit of guess work to figure out that for instance Orion.Nodes.NodeID and Orion.Events.NetObjectID relate to each other. And if Cirrus.Nodes.NodeID of type System.Guid match up with Orion.Nodes.NodeID of type System.Int32

 

The Schemas that are installed together with the SDK does not specify relationships.


Active Alert Manager Alternatives

$
0
0

We are growing our solarwinds world and are trying to transistion our previous monitoring platform (nagios and check_mk) into it.  However, we are also bringing other groups on campus into solarwinds and I've been able to use information I learned on thwack to create them their own sections by using the basic limitations that solarwinds supports.

 

I have had success with that, what is giving me problems is that the central site operators are using the builtin alerts.aspx page for the management of active alerts and they are seeing all the alerts, which is getting more and more difficult as more alerts are being added.

 

I've seen others mentioning using alternatives to the active alert manager 'alerts.aspx' and was wondering if anybody was using Drupal or Ruby Rails for active alert management.  The campus already uses 'bmc footprints' so servicenow is not an option.

Fetch table of Restriced Values for a Custom Property through REST

$
0
0

I'm working on code to use the REST API to automatically add our servers to Orion.  I want part of this code to add the Custom Properties to the node.  I've put together what I need to do that, assuming that the code user knows (and correctly enters) the Custom Property's name and value.  However, most of our Custom Properties are, in the GUI, restricted to a certain set of possible values.  I haven't found a way for the REST API to validate a possible Custom Property value against the table of Restricted Values itself.  Is there any way to fetch the table of Restricted Values for a Custom Property using the REST API so that I can have my code do the validation instead?

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. 

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

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

 


Scheduled task using Powershell or similar to disable/enable alerts during maintenance windows

$
0
0

Hello all,

 

We have scheduled maintenance windows typically once a month that start at 4 AM and end at 7 AM. We integrate SolarWinds NPM with PagerDuty to send alerts so during the maintenance window, we manually disable the SolarWinds alerts that would typically generate alerts in PagerDuty for obvious reasons.

 

At least twice now, we have forgotten to enable those alerts after the maintenance window has finished (this time for over 2 weeks before we noticed) so we'd like to automate this process.

 

After some research and playing around, I installed the SWQL Studio tool and was able to get the URI of the 2 alerts that need to be disabled and enabled. I was even able to use the Postman REST client to change the "Enabled" value of an alert to False and then back to True.

 

Now comes the part where I'm out of my depth... Well I was out of my depth initially as well. I'd like to schedule this as an scheduled task on our Orion server. I'm assuming this must be done in PowerShell but if there's another way, please feel free to correct me. Also, I have little to no PowerShell experience besides running some Cmdlets so if someone could provide some direction, I would really appreciate it.

 

Essentially, what I want to do is this:

 

Set the Enabled field of swis://orionserver/Orion/Orion.AlertConfigurations/AlertID=99 and swis://orionserver/Orion/Orion.AlertConfigurations/AlertID=100 to False during the maintenance window and back to True when the maintenance window ends.

 

Regards,

Keith

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




How to configure Power supply alert in NPM 12 ?

$
0
0

Actually i am unable to generate power supply alert for any device

Please help !

How to get the latest configuration of a set of devices from Config database?

$
0
0

We always have up to date configuration of all devices in Solarwinds (via daily backup job). I want to run some scripts against some of these configs, but I do not want to download them directly from device. Can I query these configs using SWIS API?

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. 

Need Help Converting SQL Report Writer Code to SWQL - Down Time Duration

$
0
0

Here is Report Writer SQL code that produces the duration of down time for a node.  I need to be able to convert this to SWQL and populate the 'hours down' time into a custom property field.  I want to use the 'hours down' time custom property field in conjunction with changing Google map Icon colors once time frame meets specified thresholds.   I'm not very savvy with SQL or coding so all suggestions are welcome.  Thanks everyone.  

 

SELECT     DATEDIFF(hh, T1.DownTime, CURRENT_TIMESTAMP) AS HoursDown, Nodes.Caption, Nodes.IP_Address,

T1.DownTime, Nodes.NodeID

FROM         (SELECT     MAX(EventTime) AS DownTime, NetObjectID, NetworkNode

                       FROM          Events

                       WHERE      (EventType = 1) AND (NetObjectType = 'N')

                       GROUP BY NetObjectID, NetworkNode) AS T1 INNER JOIN

                      Nodes ON T1.NetworkNode = Nodes.NodeID

WHERE     (Nodes.Status = '2') AND (Nodes.Owner = 'RHD')

ORDER BY HoursDown DESC, Nodes.Caption, T1.DownTime DESC, Nodes.NodeID

 

Output from this Query:

HoursDownNodeIP AddressDownTimeNode ID
139rtr.316864.ph.us.tgr.net10.165.4.111/2/2012 14:1818188
131rt2.023675.ph.us.tgr.net10.180.119.211/2/2012 22:1316384
120rt2.013146.ph.us.tgr.net10.81.4.211/3/2012 9:5615487
63rt2.013426.ph.us.tgr.net10.250.112.211/5/2012 18:1315560
42rtr.023040.ph.us.tgr.net10.80.164.111/6/2012 15:4816194
41rt2.012626.ph.us.tgr.net10.81.76.211/6/2012 16:5515348
39rt2.013236.ph.us.tgr.net10.7.34.211/6/2012 18:2215534
39rtr.023016.ph.us.tgr.net10.80.141.111/6/2012 18:0116174
36rt2.008384.ph.us.tgr.net10.74.64.211/6/2012 21:1314776
24rt2.026530.ph.us.tgr.net10.76.43.211/7/2012 9:4617140
17rt2.013122.ph.us.tgr.net10.81.94.211/7/2012 16:1115475
17rt2.013139.ph.us.tgr.net10.81.103.211/7/2012 16:1815484
16rtr.012934.ph.us.tgr.net10.82.80.111/7/2012 17:4815429
15rt2.006231.ph.us.tgr.net10.13.12.211/7/2012 18:2814567

How to set topology data polling interval ?

$
0
0

Dear Sir or Madam -


In SAM version 5.2, a node property was introduced called  "Poll for Topology Data Every [  ] minutes"  (on the GUI).

 

I assume this property is only used if there is an associated poller for Layer 3 topology, correct ?

 

When adding a node via the SWIS interface from Powershell, how do we set the value of this property ?

 

I used SWQL and SQL Server Management Studio to look for the property in the Orion.Nodes, but I cannot find it.

 

Thank you.

 

James Troy

Viewing all 3719 articles
Browse latest View live


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