Start a Conversation

This post is more than 5 years old

Solved!

Go to Solution

2386

October 27th, 2008 09:00

Best way to run multiple emcgrabs?

In preperation for a Enginuity upgrade I've been told I need to run an EMC Grab on all of our hosts to make sure everything is at the right level for the new code. I've got 77 HP-UX and 65 Windows servers that I need to capture this data on. Does anyone have any suggestions for the best way to do this? Can it be scripted easily, or am I just best off logging into all of the servers and kicking it off manually?


Thanks,
Christian

1 Rookie

 • 

20.4K Posts

October 28th, 2008 11:00

common Chris ..make computers do the work for ya ;)

do this:

create a file called "servers.txt" that contains a list of your 65 windows servers. File will look like this:

serverA
serverB
serverC

hopefully your windows guys have a service account that has admin rights to each and one of those 65 windows boxes. Create a network share that has NTFS and share permissions set to "Everyone". Put EMCRPTS_X86_V31.exe file there. Now you are ready :)

psexec.exe @servers.txt -u domainname\admin_account -p password cmd /c \\servername\emcgrabs\EMCRPTS_X86_V31.exe /C:"EMCRPT.CMD -nop -zip \\servername\emcgrabs\emcgrab-output\"


have a coke while it's running ;)

October 27th, 2008 10:00

Hi
Create a user which will be allowed to log into all servers automatically via SSH (using public / private keys)
Ensure all the servers either have sudo installed or work out how to use RBAC.
If using sudo, then update the sudoers configuration file to allow the user you have created to run the emcgrab command as root.
Then create a wrap around script which does this for all servers.
Once the user has been created then you can issue muliple commands across all the servers from one location.
We put a similar set-up for cfg2html in place, where the program was accessed via NFS.
Good luck - you have a lot of ground work to do but it will be worth it in the end.
Ben

1 Rookie

 • 

20.4K Posts

October 27th, 2008 11:00

October 27th, 2008 11:00

I've got the infrastructure in place (sudoers/SSH) for that to work on HPUX. Looks like using the -backup flag will work the best for kicking it off on all the servers?

Anyone have any ideas for the windows side? I was thinking about just logging into all of them, mapping a drive and running it from there. Any thoughts on how to automate that?

October 28th, 2008 08:00

Here is what I'm doing for HP-UX

#!/usr/bin/ksh -x
for h in $(cat emchosts);do
/usr/bin/scp -rp emcgrab_HP-UX_v3.9_1.tar $h:/tmp
/usr/bin/ssh $h "cd /tmp; /usr/local/bin/sudo /usr/bin/tar -xvf emcgrab_HP-UX_v3.9_1.tar; cd /tmp/emcgrab; /usr/local/bin/sudo /tmp/emcgrab/emcgrab.sh -backup"
/usr/bin/scp -rp $h:/tmp/emcgrab/outputs/* /home/cschm/scripts/emcgrab/grabfiles/
/usr/bin/ssh $h /usr/local/bin/sudo /usr/bin/rm -rf /tmp/emcgrab /tmp/emcgrab_HP-UX_v3.9_1.tar
done

I'm looking into psexec for windows now. I wish windows didn't have so many different security methods between the different releases. I might just end doing the intel boxes manually.

2.8K Posts

October 30th, 2008 07:00

Crazy like a horse .. however THE GREAT as usual :D

October 30th, 2008 07:00

That worked pretty well. 85% of the hosts will be taken care of in two loops of the command.
Stupid security stuff is going to require the rest to be done manually.
Thanks again for the help.

Christian
No Events found!

Top