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

Change node status with API

$
0
0

Hello,

 

Hopefully an easy question for SDK gurus - is it possible to change the status of a node using the API?  I'm thinking of how UnmanageRunner.exe (scheduled Unmanage tool) works, but being able to set any status value, not just unmanaged (status 9).

 

Thanks

 

Stuart


Third Party Application Acknowledge SolarWinds Event

$
0
0

Hello,

 

I am currently working to find a solution for acknowledging SolarWinds events from an IBM Tivoli Netcool server. I am already generating SNMP alerts using the SolarWinds Advanced Alert Manager. Netcool processes these alerts and they are displayed in a color coded dashboard. Using Tivoli Netcool I can click on an SNMP alert received from SolarWinds and run an executable to "do something." Currently I have the tool configured to start a command prompt and run the command:

 

start "" "http://<SolarWindsServerHostname>/Orion/NetPerfMon/AckAlert.aspx?AlertDefID=@AlertKey:@NodeAlias:@AlertGroup"

 

where:

@AlertKey = SolarWinds ${PropertyValue}

@NodeAlias = SolarWinds ${NodeID}

@AlertGroup = SolarWinds ${NetObjectType}

 

However, this causes the browser to be launched every time and the user is prompted to authenticate with either Windows logon credentials or a SmartCard. Ideally, I would like to hide the browser and only prompt the used for their credentials on the first authentication attempt (or somehow use cached credentials on the client). I havent been able to find anything that works like this. I created a PowerShell script that attempts to use System.Net.WebClient to accomplish the task, but that throws back a 401 error when authenticating with the SolarWinds server's IIS platform. I think this is attributed to the fact that I have Windows authentication required, but I am not sure. IIS doesn't appear to complain in its logs about anything.

 

Does anyone know of a better way to do what I am trying to accomplish? I have looked into using the SolarWinds SDK, but it doesnt appear to provide anything to tweak the database or acknowledge events.

 

 

I want to change C# source code of Orion website.

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

Acknowledge Events Log Table via API

$
0
0

I would like to acknowledge events in the events log table via the invoke command.   Is this possible?  If not?

 

How do a get a list of Alerts for a specific node,  I then would like to use that information to pass into a ticketing system.

 

I already have the form interface, I just need to either know how the Acknowledge the Events in the Events log using the swis or SWQL or get the list of Alerts associated with a node and then Acknowledge them.

 

Thank you for your help.

 

Charles

Acknowledge Alert via SDK Perl

$
0
0

I am calling the Acknowledge Alert syntax using the example from the sample.pl file for the Perl example.

When I do the following

 

      my $alertDefId = $alert->{alertdefid};

       my $alertNodeId = $alert->{activeobject};

       my $node_alerts = \SOAP::Data->name('ArrayOfAlertInfo')->value(

                      SOAP::Data->name('AlertInfo')->attr({xmlns=>'http://schemas.solarwinds.com/2008/Orion'})->value(

                      SOAP::Data->name('DefinitionId')->type('')->value($alertDefId),

                      SOAP::Data->name('ObjectType')->type('')->value('Node'),

                      SOAP::Data->name('ObjectId')->type('')->value($alertNodeId)

                     )

                   );

       my $result = $swql->swis->Invoke( 'Orion.AlertStatus', 'Acknowledge', [$node_alerts] );

 

I get a return value of 'false' and the Alert is NOT Acknowledged. 

 

How can I acknowledge the Alert through the SDK, remember I am doing this with PERL and I am using the InformationService.pm and Orion.pm modules?

 

Thank you,

Charles

Orion SDK --Perl -- Add node issue

$
0
0

Using below Perl code against our standalone NCM setup, I can create new node and attach "SNMP" pollers to it. I can see, through querying SWQL, that the software (NCM 7.2.1) populate node data in Orion.Nodes (vendor, vendor icon, systemoid, location..) but only when it due for next discovery (30mins), I dont see the software discover it at first place after added. Also when drilling into node detail page, all the information under Node details are suppressed. Checking the Orion.DiscoveredPoller and DiscoverNodes, I could not see my new node in either of them, Am i missing anything?

 

 

 

***** extracted code ****

 

my $AddedNode = $swis->Create('Orion.Nodes',

    {

    IPAddress=> $ip,

    IPAddressGUID=>ip2guid($ip),

    EntityType=>'Orion.Nodes',

    Caption=>$node_name,

    DynamicIP=>$False,

    EngineID=>$True,

    Status=>$True,

    UnManaged=>$False,

    Allow64BitCounters=>$True,

    External=>$False,

    ObjectSubType=>"SNMP",

    Community=>"xxxxxxxx",

    SNMPVersion=>2,

    Comments=>"added by script",

    });

 

$swis->Create("Orion.Pollers", {

            'PollerType'=>$poller,

            'NetObject'=>"N:$node",

            'NetObjectType'=>'N',

            'NetObjectID'=>$node

            });

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!


SolarWinds to Service-Now Integration

$
0
0

SolarWinds & Service-Now

=====================

We’re trying to do the following (option 1 is our preferred while option 2 is a fallback):

1)

A) SolarWinds generates alert

B) SolarWinds uses a “webservice/api/sdk/other tool” to “communicate with/connect to” with the appropriate information so ServiceNow can open a ticket with the appropriate categorization, priority, whether it is internally or externally managed (ticket assignment changes depending), etc.

C) ServiceNow will communicate to the “response team” that there is a new ticket that must be addressed

D) ServiceNow will “communicate with/connect to” SolarWinds to acknowledge the alert and to record the ServiceNow ticket in to the acknowledgement notes

E) SolarWinds will register alert and set alert to acknowledged status and will include the ServiceNow ticket number

*END*

 

2)

A) SolarWinds generates alert

B) SolarWinds sends email notification to ServiceNow – email will need to be in appropriate form to be “absorbed”

C) ServiceNow “absorbs” email and generates a ticket with the appropriate categorization, priority, whether it is internally or externally managed (ticket assignment changes depending), etc.

D) ServiceNow “responds” to email with acknowledgement and ticket number

E) SolarWinds registers the response and sets the alert to acknowledged status and will include the ServiceNow ticket number

*END*

 

At this time, we’re looking for foundational materials to help us get started and determine the easiest/best way to perform one of these options and we’re hoping SolarWinds support can give us some pointers on where to researching documentation and what documentation may exist. Our hope is this is a relatively straight forward activity since it seems like it would be fairly standard that companies would want their monitoring and ticketing systems to interact. We have been rather ineffectually researching SolarWinds documentation and Thwack for roughly a week and have been unable to find the “start here” materials. We understand that the referenced SDK is not supported and we will have to use Thwack as support, however, at this point, we don’t have enough information to understand whether the SDK is our best/only option. We see in the release notes that there is the VBClient, etc. however it is unclear if this is the proscribed technique or just *A* technique.

 

Thanks in advance for your feedback and guidance!

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

Get-SwisObject : An error occurred when verifying security for the message.

$
0
0


I am trying to connect to SolarWinds server from a different server and run a powershell script.  My ultimate goal is mark an IP address as available.  I can get the connection established, but as soon as I do a Get-SwisObject I get a security message.

 

Get-SwisObject : An error occurred when verifying security for the message.

 

If I put in a bogas password, I get the same message, so I guess I am not convinced that I am actually getting connected to my solarwinds server.

 

Here is my script:

 

If (!(Get-PSSnapin | where {$_.Name -eq "SwisSnapin"})) {
    Add-PSSnapin "SwisSnapin"
}

 

$hostname = "solar.mycompany.com"
$username="admin"
$password="1234567"

 

$cred = New-Object -typename System.Management.Automation.PSCredential -argumentlist @($username,(ConvertTo-SecureString -String $password -AsPlainText -Force))

 

#Connect to the System
$target = Connect-Swis -v2 -Credential $cred -Hostname $hostname

 

#Get all URIs of Nodes in the System
$UriBasket = Get-SwisData $target "SELECT Uri FROM Orion.Nodes"

 

I searched high and low and I can not find what this error means (An error occurred when verifying security for the message.).

 

FYI, I am able to log on with the same account via a web browser, so I know the account has access.

 

Any help would be greatly appreciated.

 

Not sure I put this in the right group either.

 

Thanks, Jon

Acknowledging Alerts with SWIS in C#

$
0
0

Hello

I am trying to acknowledge alerts using the invoke method. The only example I have is in java. I need to do this in C#. I thought I converted the code but the code I have is not acknowledging the alert. Do you have a code sample of how to acknowledge alerts in C#.

 

Thanks

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

Executing CLI for NCM with Python language

$
0
0

http://t.co/JUyJEt8oWu

http://thwack.solarwinds.com/thread/39001


c3849a86-c48d-11e3-8017-22000ab926d3-large.png




Hello, My name is David, Shin and Interested in the SDN and ACI for Cisco now,

Tis interface can programable with the python language, also SolarWinds provide API for free with python support.

to fullfill the functions from the another new customer requirements, should make a some script with python language.

 

Let me know how to control solariwinds product with sdk plz.

also we test the solarwinds API with Powershell, sample script works well,

 

Not plan to use the solarwinds api to connect to the cisco devices directly,

just want to use it connecting with the solarwinds NCM .

 

Running python script via solarwinds api to the NCM then operate ncm control the each registered cisco and other network devices.

hope to help understanding the concept.

 

when i execute the sample python script in the SDK 1.8 following error was occured, i have no idea why this is happened

i install the NPM 10.7 and NCM 7.2.2

 

 

 

Best Regards

David, Shin.

Third Party Application Acknowledge SolarWinds Event

$
0
0

Hello,

 

I am currently working to find a solution for acknowledging SolarWinds events from an IBM Tivoli Netcool server. I am already generating SNMP alerts using the SolarWinds Advanced Alert Manager. Netcool processes these alerts and they are displayed in a color coded dashboard. Using Tivoli Netcool I can click on an SNMP alert received from SolarWinds and run an executable to "do something." Currently I have the tool configured to start a command prompt and run the command:

 

start "" "http://<SolarWindsServerHostname>/Orion/NetPerfMon/AckAlert.aspx?AlertDefID=@AlertKey:@NodeAlias:@AlertGroup"

 

where:

@AlertKey = SolarWinds ${PropertyValue}

@NodeAlias = SolarWinds ${NodeID}

@AlertGroup = SolarWinds ${NetObjectType}

 

However, this causes the browser to be launched every time and the user is prompted to authenticate with either Windows logon credentials or a SmartCard. Ideally, I would like to hide the browser and only prompt the used for their credentials on the first authentication attempt (or somehow use cached credentials on the client). I havent been able to find anything that works like this. I created a PowerShell script that attempts to use System.Net.WebClient to accomplish the task, but that throws back a 401 error when authenticating with the SolarWinds server's IIS platform. I think this is attributed to the fact that I have Windows authentication required, but I am not sure. IIS doesn't appear to complain in its logs about anything.

 

Does anyone know of a better way to do what I am trying to accomplish? I have looked into using the SolarWinds SDK, but it doesnt appear to provide anything to tweak the database or acknowledge events.

 

 


Add node (or something) to NCM - NPM

$
0
0

Hi,

I have a question. Can be added a node via SWIS (Orion SDK) ? Can you help me about that? -like sample code-

(I'm working on ASP .Net / C# project about that subject.)

Thanks.

How can I execute CLI with python script.

$
0
0

Hello,

thanks for reading this articles.

i did test the executing CLI script via NCM with powershell is works well.

but want to know how can i execute the CLI via NCM with python script.

 

connection and some test is finished. but have no idea with how can i execute the cli.

still not developed using python for the NCM yet?



Adding health monitors to devices

$
0
0

Hello All,

 

I am trying to find where / how to add health monitors to devices with the SDK (or in the database) as I need to enable them on 2000 devices.

 

In the database, there isn't any poller assigned for it (tested turning it off / on, no change to pollers)

 

Anyone else done this?

How can I set application custom properties with the Orion SDK?

$
0
0

This might be an easy one, but I am getting an error when attempting to set SAM Application Custom Properties with the SDK.

 

Basically, I'm following the example for setting custom properties for nodes, but I'm replacing node-related information in the URI with application information.

 

Here is the resulting URI, which I'm guessing is invalid: "swis://my_orion_server/Orion/Orion.APM.Application/ApplicationID=replace_with_application_id/CustomProperties"

 

Simplified script:

$hostname = my_orion_server

$appID = app_id_of_interest

$swis = Connect-Swis -Trusted -Hostname $hostname

$customProps = @{ Comments="Custom comment"; }

$uri = "swis://$hostname/Orion/Orion.APM.Application/ApplicationID=$appID/CustomProperties"

Set-SwisObject $swis -Uri $uri -Properties $customProps

 

Error message: "Entity Orion.APM.Application is hosted by entity Orion.Nodes."

 

Thanks in advance for any help!

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#

Viewing all 3719 articles
Browse latest View live


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