script for adding a new node

tsmuser10

ADSM.ORG Member
Joined
Oct 11, 2004
Messages
210
Reaction score
0
Points
0
Website
Visit site
First of all not much of scripter......but I'm looking for a script or tips on creating a script for others to use to add a node. Would like it to maybe prompt for domain name/password. Again just looking for pointers

THX
 
Something like this for DOS:

@echo off

set /P node=Enter node name to register:
set /P pass=Enter password to set for node:
set /P domain=Enter Domain to register node:

dsmadmc /id=admin /pa=password "register node %node% %pass% do=%domain% passexp=0 maxnummp=4"
 
Last edited:
i've created such script for every domain

reg node $1 PASSWORD do=DOMAIN passexp=0 maxnummp=4
def assoc DOMAIN $2 $1

the run the script `run r_node NODENAME SCHEDULER_NAME`
 
I am new to scripting and automation in TSM, i am looking to automate the TSM decommission process so that it should prompt for node name to decommission and prompt to update the contact information.. any help is appreciated...
thanks in advance...
 
I am new to scripting and automation in TSM, i am looking to automate the TSM decommission process so that it should prompt for node name to decommission and prompt to update the contact information.. any help is appreciated...
thanks in advance...

Unix or DOS?

When you say 'decommission', do you delete the node and its backup? If you do this, why update the contact information?

The simplicity or complexity of the script depends on your answer to the questions above.
 
I am decommissioning the node which are registered in TSM and I am doing it from TSM end.. we maintain 90 days of client data after final backup of the server which is going to decommission.. we are updating the contact information with the incident/Ticket details so that we come to know who requested us to decommission the client..

Thank you...
 
You haven't mention if you want this to run on DOS or UNIX.

Reason: the script would most likely be ran outside of TSM

If you are just decommissioning a few nodes, why don't you just do this manually.
 
We use a TSM script to decommission nodes to make sure the contact field is in a standard format. We then run another script on a regular basis to determine when the decommissioned nodes can be deleted. Here's our decommission script:

Code:
/* Parameters:                                 */
/*   $1 = Node to be deactivated               */
/*   $2 = Date node is to be deleted in the    */
/*        format MM/DD/YYYY                    */
update node $1 contact="[DELETE NODE ON $2]"
lock node $1
 
We are using TSM 6.3 on Linux machine, below i what i am looking for... we are looking to run this script as TSM script..

Commands to run..
Rename node "node_name" [it should prompt for the node name] "node_name_keep90" [same node_name should be entered with _keep90] contact=" " [prompt for the information]

Thank you all for the response..

Awaiting for the reply.
 
We are using TSM 6.3 on Linux machine, below i what i am looking for... we are looking to run this script as TSM script..

Commands to run..
Rename node "node_name" [it should prompt for the node name] "node_name_keep90" [same node_name should be entered with _keep90] contact=" " [prompt for the information]

Thank you all for the response..

Awaiting for the reply.
Don't think TSM scripts can prompt for anything, you must use "external" scripting (batch on Windows, shell on Linux).
 
Hello Rigido,

could you please help me in building the external scripting as I am new to scripting..
 
#!/bin/ksh

## Environmental variables ##

ID=admin_id
PA=admin_password

COMD="dsmadmc -id=$ID -pa=$PA -noc -dataonly=yes -display=table -tab"

## Main

echo -e "Enter node name to rename: \c"
read NODE
echo " "
echo -e " The name of the node entered is "`echo $NODE|awk '{print toupper($0)}'`""
echo " "
echo "$NODE will now be renamed to $NODE"_keep90""
echo " "
$COMD "rename node $NODE $NODE"_keep90""
echo " "
echo -e "Enter the contact information: \c"
read CONT
$COMD update node $NODE"_keep90" contact="`echo ${CONT}`"

This should change the name.

Caveat:

1. The contact info should be enclosed in quotes like: "This node is to be kept for 90 days"
2. The schedule is still active even if the node has been renamed. To eliminate backup reports from this node, add lines to the script to delete schedule association
3. Run this from within the TSM server using the instance owner account (with access to dsmadmc) or root
 
Last edited:
thank you moon buddy... will let you know the result..
 
Hello Moon buddy,

It worked thank you very much, as suggested I will make some adjustments to remove the nodes from the schedule before renaming.
 
Here is the script which also deletes the schedule:

#!/bin/ksh

## Environmental variables ##

ID=admin_id
PA=admin_password

COMD="dsmadmc -id=$ID -pa=$PA -noc -dataonly=yes -display=table -tab"

## Main

echo -e "Enter node name to rename: \c"
read NODE
echo " "
echo -e "The name of the node entered is "`echo $NODE|awk '{print toupper($0)}'`""
echo " "
echo "A search for the schedule will now take place, and the schedule will be deleted"
$COMD "select schedule_name from associations where node_name='`echo $NODE|awk '{print toupper($0)}'`'" > SCHED
$COMD "select domain_name from associations where node_name='`echo $NODE|awk '{print toupper($0)}'`'" > DOM
echo "The schedule for "`echo $NODE|awk '{print toupper($0)}'`" is "`cat SCHED`" on domain "`cat DOM`""
echo "Deleting the schedule"
echo " "
$COMD "delete association `cat DOM` `cat SCHED` `echo $NODE`"
echo " "
echo "$NODE will now be renamed to $NODE"_keep90""
echo " "
$COMD "rename node $NODE $NODE"_keep90""
echo " "
echo -e "Enter the contact information: \c"
read CONT
$COMD "update node $NODE"_keep90" contact="`echo ${CONT}`""
exit 0
 
I am trying to write a script to check the disk pool status and start the migration if it is above threshold.... I am not sure how to open a new thread... can you please check the below script and let me know if it works fine..

I am getting the error at below line.. count.rn file in not updating..
grep $i.rn >> count.rn
VAL=`cat count.rn`
if [ $VAL -lt 60 ]


Script

_dat=`date +"%Y-%m-%d %HH:%MM"`
_sub=`printf "%s" "Disk Pool Utilisation @ $_dat "`
echo "Team," > mail.rn
echo "Please migrate the data " >> mail.rn
echo " ===================================== " >> mail.rn
for i in `cat /home/xtkumar/tsmserver.txt`
do
_i=`dsmadmc -se=$i -id=user -pa=paswd -dataonly=yes "SELECT STGPOOL_NAME, pct_utilized FROM stgpools WHERE stgpool_name like '%LD%'"`
echo $_i > $i.rn
grep $i.rn >> count.rn
VAL=`cat count.rn`
if [ $VAL -lt 60 ]
then
echo "diskpools are within threshold" >> mail.rn
else
echo "Need to migrate the data"
_n=`dsmadmc -se=$i -id=user -pa=paswd -dataonly=yes -display=table -tab "migrate stgpool $1 lo=0"`
else
grep -q ANR4922E "$i.rn";
then
echo " Migration is in progress please monitor "
done
 
Back
Top