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

Orion SDK does not provoke Auditing Events?

$
0
0

I'm working on a perl library that will, among other things, slurp a family of Custom Properties out of our CRM and into SolarWinds NPM Nodes.  I'm noticing that when I use the web interface to manually edit a Custom Property, an Auditing Event appears in the Node Summary widget we have defined for 'Last 5 Audit Events', which selects from all possible event types related to the node.  When I run my perl script to edit these same Custom Properties, no Audit Events appear.

 

From playing in the Message Center, I find that if I do a search for events generated by my own username (using %jlellis% rather than the *jlelllis* I expected) then I do get my own events for actions performed through the web gui.  If I do the same search for actions taken by the account I created specifically for use by perl scripts, I get zippo.  It appears that nothing done through the perl SDK is being tracked by the Auditing system.

 

My assumption is that SWIS and/or the SDK has not been updated to automatically create the Auditing Events new in 10.4.  For security purposes, I would expect that something beyond the SDK would be responsible for tracking these events.  Are there plans to ensure SWIS/SDK operations are also generating appropriate Auditing Events without us having to generate them in our own code?

 

This seems like an Auditing hole big enough to drive a semi through.  I could write a script to destroy our tables and there would be nothing tracking it.  Tsk.


Where to add Access-Control-Allow-Origin?

$
0
0

Hi all, I'm trying to poll data from the REST API, only I can't get that data because of an access-control-allow-origin header error.  I've tried adding the appropriate xml data to the web config for both the inetpub and solarwinds web.config files, but I still see the error.  Does anyone know where I should add the header info to talk Solarwinds into allowing the ajax request cross-domain? 

 

I'm running IIS 7.5.  I restarted the server after making the change below.

 

The information I added to the web.config file is below. (I would swap the "*" for a specific origin once I got this working.)

 

<customHeaders>

      <add name="Access-Control-Allow-Origin" value="*" />

      <add name="Access-Control-Allow-Methods" value="GET,PUT,POST,DELETE,OPTIONS" />

      <add name="Access-Control-Allow-Headers" value="Content-Type" />

      </customHeaders>

    </httpProtocol>

 

 

Any one have any ideas? 

Can I have query get NPM(i.e, interface and node) related data by using queyXML()?

$
0
0

Hi ,

 

   I am trying get Network Performance related monitoring data from server using Orion SDK'squeryXML() method.

Here I have Interface, Node and InterfaceTraffic tables in Orion SDK's data base.

What are tables need to join to prepare the query to get data?.

what is the relationship between these three tables above mentioned.

 

Please help on this.  It will be  much appreciated .

 

Thanks .

Connect version 3 of the Orion/SWIS DB from a Java application

$
0
0

Hello,

I'm currently accessing the Orion/SWIS DB for reporting purpose on our Web application. I took the Java sample of the SDK (V1.8) and this sample uses the version 2 of the Orion DB. The one of the SDK 1.9 also uses the version 2.

We would like now to add the netflow data that seem to be available from the version 3. But when I simply add "v3" as indicated in the documentation it doesn't work. I don't get any exception but no data is returned (even for the non-netflow tables like for instance Orion.NPM.Interfaces).

SWISv3: https://servername:17778/SolarWinds/InformationService/v3/OrionBasic

I can get successfully the netflow data using SWQL (table: Orion.Netflow.Flows).

 

Could you please tell me what I have to change in my Java app in addition to the URL above or tell me where I could get a sample using the version 3?

 

Thanks a lot for your help, kind regards

Livio

How to use "Alert data sharing" with SDK?Where can I find the sharing data?

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

Trying to create custom swql query

$
0
0

I am trying to take an SQL Query and plug it into the SWQL Custom Query on one of our Orion views.

 

this is what i have.. replaced names in brackets..

 

use [database]

SELECT ComputerName, SourceName, Message

from dbo.APM_WindowsEvent_Detail

where ComputerName IN ('[list of all our domain controllers]')

and message like '%locked out%';

 

in the SQL manager this gives a report of all account lockouts... the goal is to have a solarwinds page for the help desk where they can go Search the username and see what device caused the lockout on any of the domain controllers..

 

any help is greatly appreciated.

 

thanks you.

 

Also, where can one download the SWQL Studio I have read about in other posts?


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

SOAP and JSON APIs return different results for the same endpoint.

$
0
0

We've been making use of the API for various scripting things, and have had some luck. I built a perl-based script to do some automated tasks, and leveraged the sample code in the SDK. Worked!

 

Now I'm attempting to build a more robust toolkit, but in Ruby. There isn't any ruby sample code in the SDK, so I'm relying on the documentation to build what I need. Due to complexity, I'd hoped to use the REST api as that's pretty easy to get going in Ruby. However, the work has gone slow.

 

Right now I have a POST request that looks like this:

 

POST /SolarWinds/InformationService/v3/Json/Query HTTP/1.1

Accept: */*

Accept-Encoding: gzip, deflate

Authorization: Basic [creds]

Content-Type: application/json

Content-Length: 110

User-Agent: Ruby

Host: 192.0.2.45:17778

 

{"query":"SELECT NodeID from ORION.Nodes Where NodeName=@NodeName","parameters":{"NodeName":"dub-p-master"}}

 

This is returning 403-Forbidden. This is the same query I'm successfully using in the SOAP script, using the same user. The above request matches the documented POST request pretty closely:

 

POST https://localhost:17778/SolarWinds/InformationService/v3/Json/Query HTTP/1.1

Authorization: Basic YWRtaW46

User-Agent: curl/7.20.0 (i386-pc-win32) libcurl/7.20.0 OpenSSL/0.9.8l zlib/1.2.3

Host: localhost:17778

Accept: */*

Content-Type: application/json

Content-Length: 130

 

{"query":"SELECT Uri FROM Orion.Pollers WHERE PollerID=@p ORDER BY PollerID WITH ROWS 1 TO 3 WITH TOTALROWS","parameters":{"p":9}}

 

There are a few differences, such as the existence of the Accept-Encoding header, a different User-Agent, and the lack of a full URL on the POST line. Are these differences meaningful for the REST API, or are permissions handled a bit differently using that method?

 

Orion Platform 2014.2.1, SAM 6.1.1, QoE 1.0, IPAM 4.1, NPM 11.0.1, WPM 2.1.0, IVIM 1.11.0

Help with SWIS/JSON node addition

$
0
0

Hello,

 

I have just started to dabble with the Orion SDK and am looking for a way to integrate Solarwinds with some Python scripts we have to automatically provision gear, etc.

 

I followed the Python Client sample and have successfully added my nodes and assigned generic SNMP/Uptime/Interface pollers and changed custom properties.  My first problem is that these nodes never have any interfaces added.  I even tried running my nightly import job, and they didn't even show up on the scan.  Interestingly, the rediscovers look to be running, but I'm not sure why the poll is always stuck at when I added the node.  Subsequently, it never seems to discover the machine type, etc.  If I do a list resources from the GUI, I can manually add in all the interfaces.

 

In the end, I'd also like to automatically add these nodes to NCM and, if possible, set it as a device to be scanned for Layer 3 networks in the IPAM module.  I haven't found a ton of documentation on this yet....  Any help would be greatly appreciated.

 

-Scott

Polling Details

Polling IP Addressxxxxxx
Polling Enginexxxxxx
Polling MethodSNMP
Polling Interval120 seconds
Next Poll04:41 PM  (this is in the past)
Statistics Collection10 minutes
Enable 64 bit CountersYes
Rediscovery Interval30 minutes
Next Rediscovery05:59 PM
Last Database UpdateFriday, August 22, 2014 5:50 PM

How to use "Alert data sharing" with SDK?Where can I find the sharing data?

DateTime SWQL Question

$
0
0

I need help converting this to SWQL : This is how far i got.....

 

convert(varchar(10),(DATEDIFF(HH,0,GETDATE()-MAX(Events.EventTime))%24 ))+' Hours '


This is how far i got.....


ToString(HourDiff(GETDATE(),MAX(Events.EventTime))%24)+' Hours '


The % 24 is giving me the issue, i guess that function doesn't exist in SWQL unless it does and i need to know the equivalent any help would be awesome!

Is there a unique ID for alerts?

$
0
0

I am acknowledging alerts using the method described in this questions: Is it possible to acknowledge alerts programmically from a linux server?

 

I am looking for a unique ID that is attached to an alert so that I can place it into the subject of emails sent out via Trigger Actions. I noticed that AlertDefID is not unique. Is there something that I can place into the subject using the ${ } syntax?

SOAP and JSON APIs return different results for the same endpoint.

$
0
0

We've been making use of the API for various scripting things, and have had some luck. I built a perl-based script to do some automated tasks, and leveraged the sample code in the SDK. Worked!

 

Now I'm attempting to build a more robust toolkit, but in Ruby. There isn't any ruby sample code in the SDK, so I'm relying on the documentation to build what I need. Due to complexity, I'd hoped to use the REST api as that's pretty easy to get going in Ruby. However, the work has gone slow.

 

Right now I have a POST request that looks like this:

 

POST /SolarWinds/InformationService/v3/Json/Query HTTP/1.1

Accept: */*

Accept-Encoding: gzip, deflate

Authorization: Basic [creds]

Content-Type: application/json

Content-Length: 110

User-Agent: Ruby

Host: 192.0.2.45:17778

 

{"query":"SELECT NodeID from ORION.Nodes Where NodeName=@NodeName","parameters":{"NodeName":"dub-p-master"}}

 

This is returning 403-Forbidden. This is the same query I'm successfully using in the SOAP script, using the same user. The above request matches the documented POST request pretty closely:

 

POST https://localhost:17778/SolarWinds/InformationService/v3/Json/Query HTTP/1.1

Authorization: Basic YWRtaW46

User-Agent: curl/7.20.0 (i386-pc-win32) libcurl/7.20.0 OpenSSL/0.9.8l zlib/1.2.3

Host: localhost:17778

Accept: */*

Content-Type: application/json

Content-Length: 130

 

{"query":"SELECT Uri FROM Orion.Pollers WHERE PollerID=@p ORDER BY PollerID WITH ROWS 1 TO 3 WITH TOTALROWS","parameters":{"p":9}}

 

There are a few differences, such as the existence of the Accept-Encoding header, a different User-Agent, and the lack of a full URL on the POST line. Are these differences meaningful for the REST API, or are permissions handled a bit differently using that method?

 

Orion Platform 2014.2.1, SAM 6.1.1, QoE 1.0, IPAM 4.1, NPM 11.0.1, WPM 2.1.0, IVIM 1.11.0


How to use "Alert data sharing" with SDK?Where can I find the sharing data?

Is it possible to acknowledge alerts programmically from a linux server?

$
0
0

We are using OpsGenie to aggregate all the alerts for our alerting. We'd like to integrate Solarwinds too. I was wondering if there is a way to programmically acknowledge alerts from a linux server? I was hoping there would be some sort of API for Solarwinds but it doesn’t look like that is the case. I contacted Solarwinds tech support and they pointed me here.

Help with SWIS/JSON node addition

$
0
0

Hello,

 

I have just started to dabble with the Orion SDK and am looking for a way to integrate Solarwinds with some Python scripts we have to automatically provision gear, etc.

 

I followed the Python Client sample and have successfully added my nodes and assigned generic SNMP/Uptime/Interface pollers and changed custom properties.  My first problem is that these nodes never have any interfaces added.  I even tried running my nightly import job, and they didn't even show up on the scan.  Interestingly, the rediscovers look to be running, but I'm not sure why the poll is always stuck at when I added the node.  Subsequently, it never seems to discover the machine type, etc.  If I do a list resources from the GUI, I can manually add in all the interfaces.

 

In the end, I'd also like to automatically add these nodes to NCM and, if possible, set it as a device to be scanned for Layer 3 networks in the IPAM module.  I haven't found a ton of documentation on this yet....  Any help would be greatly appreciated.

 

-Scott

Polling Details

Polling IP Addressxxxxxx
Polling Enginexxxxxx
Polling MethodSNMP
Polling Interval120 seconds
Next Poll04:41 PM  (this is in the past)
Statistics Collection10 minutes
Enable 64 bit CountersYes
Rediscovery Interval30 minutes
Next Rediscovery05:59 PM
Last Database UpdateFriday, August 22, 2014 5:50 PM

PowerShell Module based on the SDK

$
0
0

Hi All,

 

I started working on a PowerShell module, converting existing code examples in the SDK to “Cmdlets” Functions.  The ultimate goal is to just make it easier to re-use code. My own use case in particular arose from just wanting to simplify automating primarily working with SAM & NPM nodes, but I thought this may be of interest to others, so I’m going to share it on Codeplex as well. By posting it there not only can you can get a copy of the current code, but it also allows you to submit any changes you may make back in to the main code, which will ultimately lead to more functionality, and faster ( this is just a personal project, and not a SolarWinds one, so the code is offered as-is. Plus as I'm just doing this in free-time, so it may not get updated as frequently or as often as I would ).


Why A Module?

Converting this code into a module has several benefits:

  • By creating Cmdlets, actions can be performed much faster. For example, to add nodes, rather than editing a script and calling that, you can now just call something like

$swis=Connect-Swis-UserNameadmin-Password""-Hostname10.160.5.75

New-OrionNode-SwisConnection$swis-IPAddress10.160.5.10             

What this boils down to is when writing your own scripts, these can now be much smaller in size, and faster to develop, as a lot of the “plumbing” is already done (instead of having to copy and paste a 75 line script, you can now achieve the same in a couple of lines).    

  • It’s more intuitive, and fits conventional PowerShell Verb-Noun naming conventions. Plus, the  documentation is built-in, so calling the Get-Help command can return help and examples, the same as standard Cmdlets.

PowerOrionGet-Help Example.jpg

  • By building in error handling, and through the use of defaults and parameter sets, there is less chance for user error. For example, when building statements in either the console or the IDE it can prompt on possible options for parameters.

PowerOrion Parameters Populated.jpg


What functionality is available at present? 
At the moment it’s very much version 0.0.1, and contains a few helper Cmdlets, plus the ability to Add ICMP Nodes, Remove Nodes, and retrieve properties. Next on the to-do list is (and this is just a wishlist, so depending on time, these may or may not be completed)

  1. Adding in SNMP nodes
  2. Adding in volumes and interfaces
  3. Adding in WMI nodes
  4. Managing applications
  5. Setting custom properties

 

EDIT: Technically these are "advanced functions" and not "Cmdlets". From a users perspective they are essentially the same, the only difference being in how the code is written: Cmdlets are written in C#, advanced functions are written in PowerShell

Custom SWQL Query for Nodes Down Showing Every Time Node Went Down

$
0
0

I'm trying to tweak our nodes down resource to add the date/time the system went down.  I'm trying to figure out why it is listing all the times the nodes have went down and not just the most recent. 

 

Here is the query:

SELECT

NodeName AS [Node Name],

        '/Orion/images/StatusIcons/Small-' + StatusIcon AS [_IconFor_Node Name],

        DetailsUrl AS [_LinkFor_Node Name],

        DOWNEVENT.EVENTTIME AS [DOWN TIME],

  Nodes.CustomProperties.Alert_Team as [ALERT TEAM]

FROM ORION.NODES NODES

INNER JOIN ORION.EVENTS DOWNEVENT

ON NODES.NODEID = DOWNEVENT.NETWORKNODE

WHERE STATUS = 2

ORDER BY NodeName

 

I am getting the following:

Capture-nodesdown.JPG

 

For the P server I'd like to just have the most recent time it has been down and not came back up, 9/2/2014 in this case.  For S server, 8/27/2014. 

 

Is this possible to filter those others out?

Viewing all 3719 articles
Browse latest View live


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