Can we add node (snmp v3 ) using java ?
I added discovery to the java sample: https://github.com/solarwinds/OrionSDK/commit/e370abdf84c46c74457e69ae18cfd0ab48b0475b
Don't be intimidated by the size of the diff - most of it is just model classes for various discovery configuration objects. The actual logic involved is small.
This is a port of the powershell sample for the same task: https://github.com/solarwinds/OrionSDK/blob/master/Samples/PowerShell/DiscoverSnmpV3Node.ps1
Thank you for your kind help..!!
Using Power shell (Link above you share)
Error :
Import-Module : The specified module 'SwisPowerShell' was not loaded because no valid module file was found in any module directory.
+ Import-Module SwisPowerShell
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (SwisPowerShell:String) [Import-Module], FileNotFoundException
+ FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
Connect-Swis : The term 'Connect-Swis' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a
path was included, verify that the path is correct and try again.
At C:\MSCI\Inventory_Sources\NodeAddition_Linux.ps1:21 char:10
+ $swis = Connect-Swis $OrionServer -UserName $Username -Password $Password
+ ~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Connect-Swis:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Kind regards,
Aftab
See this page for background on how to work with SWIS from PowerShell: PowerShell · solarwinds/OrionSDK Wiki · GitHub
In short, you need to run Install-Module -Name SwisPowerShell to get that script to work.
Hi tdanner,
Everything is working as expected.... Thanks !!
One error we are getting that is :
SwisPowerShell was not loaded because no valid module file was found ?
Can you please help ? if mssing how to downaload and from where to download ?
Thank you for help.
Hi,
One more help please.
We are planning to add bulk device best possible way to this ? Preferred viascripting.
Please guide as we are new to Powershell.
This page has instructions for setting up Install-Module on various versions of PowerShell: https://docs.microsoft.com/en-us/powershell/gallery/installing-psget
Finally its woirking....!!
Thank you sir.
This script is working well. One further question.
Is it possible to set some filters for volumes and interfaces?
I'm not sure if there are some XML-Tags for that.
Greetings
Domi
Best way to learn and understand the XML is to build a discovery with the settings you want in the GUI, and then look at the database table called discoveryprofile and there is a configuration column there with all the XML that defines the discovery. Make changes in the GUI then observe how those changes affect the settings in the DB so you can make those same edits with your scripts.
When doing a discovery via API, you can definitely use filters for interfaces (not sure about volumes though). We do this with Python, and here is an example (look for interfacesPluginContext, where you'll see various interface filters (AutoImportExpressionFilter). We found that basically anything you can do on that screen (Status, Port Mode, Hardware, Advanced filters) can all be accomplished inside the interfacesPluginContext.
Python example (look for my post on Nov 16, 2017): Re: Node Resource Discovery Via JSON API
This link documents how the Interfaces Plugin Configuration works specifically when using PowerShell for API discovery: Discovery · solarwinds/OrionSDK Wiki · GitHub
Thanks, I'll try.
I searched with SWQL Studio for the attribute but it looks like there is no xml stored. Instead I found some columns e.g. in Orion.DiscoveryProfiles which contains the data I searched for.
So I have still the problem that i dont know which attributes are valid for the xml