Start a Conversation

This post is more than 5 years old

Solved!

Go to Solution

4056

September 21st, 2010 13:00

how to remove several devices at once in SMARTS

I currently work as an Smarts administrator. I frequently have to add and remove several devices from the system at once. I was wondering if there is an ASL script I can use to remove multiple devices from the system at once. Currently I have to use the "Administrator Instances" screen which is ok but when I remove more than 3 devices it takes 3-5 minutes. Im just looking for a faster way to complete this task.

Thanks!

18 Posts

September 21st, 2010 18:00

Hello,

To perform the same bulk device removal task via CLI or scripts (e.g. dmctl, ASL respectively) should theoretically take at least the same amount of time (depending on how efficiently the script/commands are coded).  So I would say the only real advantage to CLI and scripts is if you wanted to automate the task somehow.

Even so, with dmctl you can remove a device on the CLI with the following dmctl command:

# dmctl  --server    invoke  ICIM_UnitaryComputerSystem::   remove

Similarly, in an ASL script you can invoke the remove() function of a device object, e.g.  objRef->remove();

NOTE:

Do not perform a "delete" operation in dmctl or ASL on a device object because this removes only the object itself from the topology and not any of its related objects.  E.g. removing a switch object and leaving behind its associated card objects in the topology.  The object's "remove" method takes care of this.

Kind Regards,

Louie Cavaliere

EMC Global Support

January 20th, 2012 11:00

Can u pls tell me how to remove a device thru GUI.(from all domains)

Currently i am doing like this............from domain manager administration console first i am unmanaging the device and then deleting is it correct let me know

13 Posts

May 25th, 2012 07:00

And I am questioning this "Administrator Instances", never heard of it. Was actually checking if I there are other solutions or better paths to remove instances in bulk...

I am actually looking at some transfers between domains (classification changes) and setup a rather automatic way to remove and reload devices by 1ste level operators.. So "Administrator Instances" could be the tool for them?

138 Posts

May 29th, 2012 15:00

U should to remove device only from AM-PM server and after reconfiguration all connected domain managers will syncronize with APM

138 Posts

May 29th, 2012 15:00

Hello, i think u can write CGI script or some perl script that in input get regex of devices u want to remove.

U can modify this script and add some function that test your REGEX, then if right deleted all.

Code example (this code use other PM for server connecting)

# -- connect to Ionix AM-PM server. U

$session = dmConnect($broker, $dmName , $dmUsername, $dmPassword);

# -- get Regex param if you run perl script via CLI you should to get REGEX by $ARG[0]

          $regex = param('Regex');

 

                    my @instances;

                    if ( $regex eq "" ) {

                              @instances = $session->findInstances( $class, "*" );

                    } else {

                              @instances = $session->findInstances( $class, $regex );

                    }

foreach my $instance ( @instances ) {

                              $obj = $session->object( $instance );

$obj->remove();

}

13 Posts

May 30th, 2012 00:00

I just created myself a very simplified script, but if something goes wrong I will get all messages...

Where harvestfile.txt is the list of bulk removals and harvesting.sh is the shellscript. Based part of the checks on existing scripting from EMC, as I like the extra checks. Plus I am not really a programmer.

cat /opt/scripts/lists/harvestfile.txt|xargs -l1 /opt/InCharge7/IP/smarts/local/script/harvesting.sh $i

#!/bin/sh

# 2012 TRU HHE / for EMC IONIX IP MANAGER /

progname=`basename $0`

icd=IC-IP

icdev=$1

SMHOME=/opt/InCharge7/IP/smarts

# Check SMHOME

if [ ! -d "$SMHOME" -o ! -x "$SMHOME/bin/dmctl" ]

then

        echo "Directory does not exist or is not a valid InCharge Installation Directory!"

        echo "Usage $progname "

        exit

fi

# Check Domain

$SMHOME/bin/dmctl -s $icd ping > /dev/null 2>&1

if [ $? -ne 0 ]

then

        echo "Domain >$icd< is either not existent or not running!"

        echo "Usage $progname "

        exit

fi

#the actual removal of the device, removal because delete option keeps components

$SMHOME/bin/dmctl -s $icd invoke ICIM_UnitaryComputerSystem::$icdev remove

echo "$icdev removed from $icd"

No Events found!

Top