Start a Conversation

Unsolved

This post is more than 5 years old

H

2959

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.

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

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

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.

2 Posts

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.

21 Posts

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

21 Posts

January 13th, 2014 11:00

Thank you

21 Posts

January 13th, 2014 11:00

This one works:

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

3 Posts

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

No Events found!

Top