UNSOLVED

habadir

updated

13 years ago

H

habadir

1 Rookie

•

21 Posts

0

3209

January 8th, 2014 13:00

What's the Smarts Command to list different network devices?

Hello, I need to list different devices by class. i.e routers, switches, etc.

  • christopher_ime

    6 Operator

    •

    1962 Posts

    1778

    0

    Posted January 8th, 2014 23:00

    Please consider moving this question as-is (no need to recreate) to the proper forum for maximum visibility.  Questions written to the users' own "Discussions" space don't get the same amount of attention and can go unanswered for a long time.

    You can do so by selecting "Move" under ACTIONS along the upper-right.  Then search for and select: "Smarts Support Forum".

    Smarts Support Forum

  • 1778

    0

    Posted January 13th, 2014 10:00

    The way to do this is either via DMCTL or ASL.  DMCTL will require you to run the command for each class, while ASL is a scripting language where you can list out all the member of each class with one command after the script is written.

    The DMCTL command would be:

    ./dmctl -s getInstances

    You would need to execute this for each class.

    An example ASL, lets call it printRouter.asl, would be:

    START { .. eol }

    do {

         print("Routers in topology:"

         foreach routerMember ( getInstances("Router") ){

              routerMemberObj = object("Router", routerMember);

              if(!routerMember->isNull()){

                   print("\t".routerMember->Name);

              }

         }

    }

    This code would cause all the routers to be printed to the screen by name.  The script would be executed using the command:

    ./sm_adapter -s /printRouter.asl

    If you want to find out more about ASL scripting then you should read the ASL reference Guide that is part of the Smarts product documentation.  You can use the following ASL reference guide:

    https://support.emc.com/docu46002_Smarts_Foundation_9.2_ASL_Reference_Guide.pdf?language=en_US

  • 1778

    0

    Posted January 13th, 2014 11:00

    The command is:

    ./sm_tpmgr -s --select=C

    It will print out everything.  No way to select the output unless you pipe it to grep.

  • smithrl7

    2 Posts

    1778

    0

    Posted January 13th, 2014 11:00

    You can also try "./sm_tpmgr -s --select=C" to list out all devices. It gives a nice output of a summary, then all devices, what class they are in and a few other details.

  • habadir

    1 Rookie

    •

    21 Posts

    1778

    0

    Posted January 13th, 2014 11:00

    I got the following error

    ./sm_tpmgr -s Switch --select=C

    [January 13, 2014 2:12:36 PM EST +066ms] t@3215719008

    ASL-E-ERROR_INIT_BACKEND-While initializing server connection to 'Switch'

    SM-BROKER-Broker location: localhost:426/dmbroker

    SM-ENOTREGISTERED-Domain Manager is not registered with the DM Broker

  • habadir

    1 Rookie

    •

    21 Posts

    1778

    0

    Posted January 13th, 2014 11:00

    Thank you

  • habadir

    1 Rookie

    •

    21 Posts

    1779

    0

    Posted January 13th, 2014 11:00

    This one works:

    ./sm_tpmgr -s INCHARGE-AM-PM --select=C| grep -i switch

  • Chash1

    3 Posts

    1778

    0

    Posted April 7th, 2015 23:00

    Another option is to use below command:

    sm_tpmgr -S --dump-agents > D:\NetworkDeviceList.txt

    OR

    sm_tpmgr -S --output=NetworkDeviceList.log