Quantcast
Channel: THWACK: All Content - Orion SDK
Viewing all 2677 articles
Browse latest View live

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.


Move a Sub-Container from one Container to Another Container

$
0
0

To first understand my situation, I have a Group (container) for Office Locations.  Under that I create a sub-Group for each office we have.  When an office is closed, we do not immediately remove the info for the office, data stored in Custom Properties, but also want that office to be moved from Office Locations to a Closed Office Locations Group.  So, what I want to do is change the parent of that closed office sub-Group to be Closed Office Locations instead of Office Locations without having to recreate the office Group in the new location.  I also have other similar needs like equipment that is taken out-of-service or decommissioned and we want to move it out of the active equipment Groups.

 

Within the Orion website there is no ability to change the parent of a Group (container).  In the database there are nine "Container" tables.  Five of those are "dbo.ContainerStatus" tables.  One table is for related "dbo.ContainerCustomProperties".  Then there are tables called "dbo.Containers", "dbo.ContainerMemberDefinitions" and "dbo.ContainerMemberSnapshots".

 

The Snapshots table appears to be where the relationship between containers is stored.  In that table the "ContainerID" appears to contain the parent container's ID number and the "EntityID" contains the ID number belonging to the container represented on that row.

 

In my case, the container I want to move is 573 and the current parent is 572.  I want to change the parent to be 153.  However just changing the "ContainerID" from 572 to 153 for the row with "EntityID" equal to 573 did not change how it appears in the website when looking at the Groups resource.

 

Is there something more or someplace different I would need to change this?

 

Or is there a different way I can go about this?

 

 

 

Mike

Is there any rest api for installing swiagent through python code?

$
0
0

I want to install swiagent through python code. So anyone can provide me the solution.

So please suggest the api to call the swiagent installation script through python.

 

Thanks in advance

Solarwinds exporting to ServiceDesk

$
0
0

Hey team, so I'm looking into linking solarwinds with manageengine service desk so I can produce tickets faster. I found that the easiest way to do this is to be able to produce an xml file and sending it directly to service desk.

What I was wondering was, is there already a service provided by solarwinds that outputs xml data for curtain nodes?

Can one create Groups with the SDK?

$
0
0

I am very new to the SDK and I want to know if it is possible to create Groups using the SDK. I have more than 1500 to do and I would be using a custom property to reference in  dynamic query, but I certainly don;t want  to do this manually if I can avoid it. Can anyone point me in the right direction? Thanks for any help and advice.

SDK/PowerShell - Group Creation Script Issue

$
0
0


Trying to use the following script (based on the 'Groups' example in the SDK) to add groups based on Nodes.Location and a CustomProperty !=

 

if (! (Get-PSSnapin | where {$_.Name -eq "SwisSnapin"})) {    Add-PSSnapin "SwisSnapin"
}
# Connect to SWIS
$hostname = "localhost"
$username = "username here"
$password = "password here" | ConvertTo-SecureString -asPlainText -Force
$cred = New-Object -typename System.Management.Automation.PSCredential -argumentlist $username, $password
$swis = Connect-Swis -host $hostname -cred $cred
#Set the locatoin of the csv
Set-Location 'C:\Users\username here\Desktop'
# read in csv file
$importFile="./MakeGroups.csv"
$importList=IMPORT-CSV $importFile
#iterate through each entry in csv file
FOREACH($import in $importList)
{    $SiteCode = $import.Location    $members = @(  @{ Name = "$SiteCode"; Definition = "filter:/Orion.Nodes[Location='$SiteCode' AND CustomProperties.Device_Type != 'Router']" }
)
$groupId = (Invoke-SwisVerb $swis "Orion.Container" "CreateContainer" @(    # group name    "$SiteCode",    # owner, must be 'Core'    "Core",    # refresh frequency    60,    # Status rollup mode:    # 0 = Mixed status shows warning    # 1 = Show worst status    # 2 = Show best status    0,    # group description    "Group created by the PowerShell sample script.",    # polling enabled/disabled = true/false (in lowercase)    "true",    # group members    ([xml]@(       "<ArrayOfMemberDefinitionInfo xmlns='http://schemas.solarwinds.com/2008/Orion'>",       [string]($members |% {         "<MemberDefinitionInfo><Name>$($_.Name)</Name><Definition>$($_.Definition)</Definition></MemberDefinitionInfo>"         }       ),       "</ArrayOfMemberDefinitionInfo>"    )).DocumentElement  )).InnerText    
}

 

 

Keep getting this error:

 

Invoke-SwisVerb : Entity Orion.Nodes does not contain requested property A

At C:\Users\username here\Desktop\MakeGroups.ps1:32 char:14

+  $groupId = (Invoke-SwisVerb $swis "Orion.Container" "CreateContainer" @(

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

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

    + FullyQualifiedErrorId : SwisError,SwisPowerShell.InvokeSwisVerb

 

 

Looking in the DB, the script is creating the group under 'Containers', but there is not an entry being created under 'ContainerMemberDefinitions'

 

All help is appreciated

Updating and Synchronizing Custom Properties with CMDB

$
0
0

My company has the usual CMDB sprawl issue.  They have been working on designating an authoritative source to hold this information going forward.   We use Custom Properties on our nodes in Orion to hold a lot of this same CMDB info.  Being able to keep sources in sync is a recent project.  I'm curious if anyone else has been down this road and has any ideas?  What the team involved specifically asked me was whether Orion would be capable of pulling the information from the CMDB via API and then having custom property fields updated.  I know these fields can be updated via the API on the Orion side.  Does that mean the best option would be to have the data pushed to Orion and updated via the API?  Is there perhaps another method?  My apologies for lack of API experience.   Any guidance or ideas would be appreciated.

Trigger NCM configuration download from SDK

$
0
0

Is there any way with the SDK to start a configuration download?

 

For some reason my nightly backup of configs runs into some issues, but when I manually download from node details, it always works fine.

 

So, I take my email report, put it in a text box in vb, parse it and get the few that had errors.  Would like to be able to take that and click 'try again on all' kind of thing.


has anyone automated changing DB password with PowerShell script instead of using configuration wizard?

$
0
0

We have to change the password for DB user every 42 days and would like a way to automate it. We currently use SecretServer to store our passwords and it has the capability to enlist powershell scripts to update applications with the new password after SecretServer changes it. Has anyone created a script that can automate the password change for the SolarWinds DB password?

[python] subnet CRUD operations problem

$
0
0

Hi,

 

I'm trying to update the 'Comments' property on an already existing subnet using the orionsdk python 'update()' method, but it fails miserably (see code below).

What on earth am I doing wrong?

Also, I am trying to figure out if it is possible to create supernets or subnets within an already existing supernet using the Orion API?

 

Any help would be very much appreciated.

 

/BR, Espen

 

My python test code looks like this:

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

import orionsdk

swis = orionsdk.SwisClient('hostname', user, passwd)

uri = 'swis://localhost/Orion/IPAM.Subnet/SubnetId=6244,ParentId=109'

comments = 'MY-TEST-COMMENT'

swis.update(uri, Comments=comments)

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

 

API responds with this error (running inside ipython):

 

In [51]: swis.update(uri, Comments=comments)

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

HTTPError                                 Traceback (most recent call last)

<ipython-input-55-133cfe3d54f8> in <module>()

----> 1 swis.update(uri, Comments=comments)

 

 

/home/eto/dev/venv-orionsdk/lib/python2.7/site-packages/orionsdk/swisclient.pyc in update(self, uri, **properties)

     38

     39     def update(self, uri, **properties):

---> 40         self._req("POST", uri, properties)

     41

     42     def delete(self, uri):

 

 

/home/eto/dev/venv-orionsdk/lib/python2.7/site-packages/orionsdk/swisclient.pyc in _req(self, method, frag, data)

     57                 pass;

     58

---> 59         resp.raise_for_status()

     60         return resp

 

 

/home/eto/dev/venv-orionsdk/lib/python2.7/site-packages/requests/models.pyc in raise_for_status(self)

    933

    934         if http_error_msg:

--> 935             raise HTTPError(http_error_msg, response=self)

    936

    937     def close(self):

 

 

HTTPError: 400 Client Error: The incoming request has too many parameters. The server supports a maximum of 2100 parameters. Reduce the number of parameters and resend the request. for url: https://hostname:17778/SolarWinds/InformationService/v3/Json/swis://localhost/Orion/IPAM.Subnet/SubnetId=6244,ParentId=109

 

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

Solarwinds Orion Installer

Big Panda integration

How to add application monitor using python

$
0
0

I am trying to add predefined application monitors to an existing node using python scripts

Create SNMP and WMI credentials using Orion SDK

SWQL Functions Feeback... Enhancments?

$
0
0

Having worked with the SDK (namely SWQL) nearly since its release to the public I have say that I find the SDK/API feature rich, extraordinarily reliable and key path to a Solarwinds installation that meets the unique needs of each environment I've worked with it.

 

However, there are a few things I would like to mention that I feel are unfortunate oversights or omissions from the SWQL language.

 

  1. SWQL has no CHARINDEX() type function.
    1. This is a frustrating short coming of the query language. Unless I want an extraordinarily large list of custom properties, one for each value pair, there is no way to parse a custom property value based on a know string.
      Also, let's be honest with ourselves, the array functions require manual delimination and string entry... unless someone knows something I don't... which is completely possible.
  2. CONCAT() can not be used in the 2nd argument of SUBSTRING() (more specifically a varchar(max))
    1. This is almost as frustrating as #1 and some days even more so. If it was possible to use CONCAT() in the 2nd argument it would alleviate some of the frustration and lack of functionality created by the complete absence of a CHARINDEX() type function.
  3. SWQL has no REPLACE() type function.
    1. This is another frustrating handicap of the SWQL language. REPLACE() is another mainstay in the string manipulation family of functions that is sadly absent from the SWQL function library.

 

I can live without the ability to use the local variables, temporary tables, the inability to CAST() a datetime and the advanced string by type parsing that SQL offers. These 3 issues have me, more often then not, using SQL queries rather than SWQL queries. It's unfortunate as I prefer to use the native query language when ever possible.

 

My hats off to the developers and maintainers of the SDK. It's a heck of thing you've got there.


Schema Documentation - Properties-Type

$
0
0

In the example blelow, what is the "type" definition of "System.Double"?

 

Trying to determine if the value of "AveragePacketLoss" is in whole number, percentage, etc.

 

For example:

In the highlighted example, is this value .0004% or is it .04% (value X 100)?

Trigger NCM configuration download from SDK

$
0
0

Is there any way with the SDK to start a configuration download?

 

For some reason my nightly backup of configs runs into some issues, but when I manually download from node details, it always works fine.

 

So, I take my email report, put it in a text box in vb, parse it and get the few that had errors.  Would like to be able to take that and click 'try again on all' kind of thing.

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.

What is syntax for "Usages" dictionary?

$
0
0

Hello,

 

Table Orion.NodesCustomProperties has a verb "CreateCustomProperty". This verb has an argument "Usages" that specified to be dictionary. What is format of this dictionary? For example if I want to specify custom property usage "IsForAlerting"  to be false, how would i specify that in that hash table?

thanks,

 

Albert.

using OrionSDK with jython

$
0
0

Hello,

I want to create an integration with HP's ucmdb so I need to code my discovery with jython, which is basically the same as python.

I cannot find any version requirements for the Orion python sdk,

what is the oldest python version that supports the python sdk ?

 

thanks

David.

Viewing all 2677 articles
Browse latest View live


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