This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Auto Grouping by Node Location.

Dears,

Good day to all, i wondering if we can do auto Grouping to all nodes under each area by few steps rather than creating 100 groups and each group we have to create the query to list the nodes under it.

My point is:

Creat some kind of query to list all the 100 areas as a groups and will list all nodes under the correct area without manually creating all the groups and listing all nodes under a specific area manually.

Please help me with this. Thank you very much in advance.

  • If you are wanting groups you would have to build them manually and then create query that says automatically put anything with location=X (if your SNMP is reporting location) in this group.  You cannot have it automatically create groups, but you can kinda do what you are looking for just using node list.  In the "All Nodes" list you can display all nodes grouped by location, which gives you basically what you are looking for.

  • Hello, this is scenario, which is the group management not ready for, however you're able to simply achieve this by using Orion SDK. Some info is here: Orion SDK Information and is hosted currently on GitHub GitHub - solarwinds/OrionSDK: SDK for the SolarWinds Orion platform, including tools, documentation, and samples in Powe…

    To get you quickly on board, I prepared PowerShell script, which should do what you need. Just modify the IP of your Orion ($Target variable) and the access admin Orion credentials (Connect-Swis part).

    What the script does:

    1. Get distinct values of Location, which are set for Nodes
    2. For each location create dynamic group (Location = 'xyz'). Group is named the same as location and checks if such group doesn't already exist.

    I hope it helps.

    Honza

    CreateGroupsForLocations.ps1
  • Thank you very much brother. unfortunately I need to automate the creation of the groups by location.

    thanks anyway for your reply and support. appreciate it.

  • Is your location set on the devices?  Or are you looking to set a location via custom property or something?

    For example, on a Cisco device, you can set the following command:

    snmp-server location Home Office

    This sets the SNMP location as "Home Office" and this is automatically populated by Solarwinds.  You can then view the "All Nodes" list and group based on location.  This essentially gives you what you are looking for, but isn't a Solarwinds "group" however.

    .thwack.PNG

  • Thanks brother, yes we are using this on all our devices. the point is creating groups under NPM for all of our locations to create alarm based on locations and other management things.

    thank you once again brother.

  • THANKS a lot brother for your support and time to reply back. I love your idea and it was my wish. but unfortunately it doesn't work well and I faced many errors and this is the most error I got.

    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:\Users\Administrator\Desktop\CreateGroupsForLocations.ps1:43 char:10

    +     $swis = Connect-Swis -host $Target -UserName ******* -Password "*******"

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

        + CategoryInfo          : ObjectNotFound: (Connect-Swis:String) [], CommandNotFoundException

        + FullyQualifiedErrorId : CommandNotFoundException

    Get-SwisData : The term 'Get-SwisData' 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:\Users\Administrator\Desktop\CreateGroupsForLocations.ps1:45 char:28

    + [System.Array]$locations = Get-SwisData $swis "SELECT DISTINCT Location FROM Ori ...

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

        + CategoryInfo          : ObjectNotFound: (Get-SwisData:String) [], CommandNotFoundException

        + FullyQualifiedErrorId : CommandNotFoundException

    Get-SwisData : The term 'Get-SwisData' 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:\Users\Administrator\Desktop\CreateGroupsForLocations.ps1:46 char:29

    + [System.Array]$groupNames = Get-SwisData $swis "SELECT Name FROM Orion.Groups"

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

        + CategoryInfo          : ObjectNotFound: (Get-SwisData:String) [], CommandNotFoundException

        + FullyQualifiedErrorId : CommandNotFoundException

    I hope its easy for you to help me with. Tank you a lot brother so much.

  • Hi matrook​,

    you will need to download and install the SDK from Github. That includes the snapin with the relevant cmdlets that will be used.

  • Hi Michael

    thank you for the reply and support, I will give it a try today.

    Thanks brother.