cancel
Showing results for 
Search instead for 
Did you mean: 

How to check free space on client from master before upgradation

vg_janakiraman
Level 2
Hello all.. I would like to automate the process of client upgradation for which i need to check for the free space in the the following filesystems,

/usr/openv
/tmp

on the clients. Is there any command that can be executed from the master server for checking the free space information? as the script is run from the master.

Appreciate any help from all experts and gurus of UNIX, Netbackup.
11 REPLIES 11

Sriram
Level 6
If you ask is there a netbackup command in version 6 and above NO.  If you really find one let me know.

What is the netbackup version you use?

commands were there in netbackup 5.1 to manage include/exclude list and some commands which were against security policy.  So those were obselete from netbackup 6 and above. 

It was again made possible to manage include/exclude from 6.5.3

Hope this helps


vg_janakiraman
Level 2
Hello Sriram thanks for the reply.

I use the Netbackup 6.0 MP7 on master and all clients need to be upgraded from MP6 to MP7.

The script that i use extracts for the clients's "Version, Patch and Platform" and upgrades the same on the script on the master.

The problem that i am facing is the free space available that needs to be checked on the following file system on clients,

/usr/openv
/tmp

So my problem is not with the include/exclude list but for the command that checks for the free space on /usr/openv on each and every client.

Is there anyway to check this from Netbackup(if not is there any UNIX command that could be run from master)?
Please help..

Sriram
Level 6
As i said earlier in my previous posting there is NO netbackup command can that get you the free space of the clients from master server.

Try this: 

Since your netbackup master is UNIX server hence try writting a shell script in which will login to the clients and get you the space utilized in the clients.

Let me know if its not possible from your end.  We are running the same kind of script which will let us know the space utilized by the netbackup clients if we need.

vg_janakiraman
Level 2
Two parts that needs to be coded:

1. Check for OS platform, version of Netbackup and Patch details,
2. Check for available free space on /usr/openv and /tmp on clients

1. Here is the script that i use on the master to check this,

for i in `bppllist -l -allpolicies | grep CLIENT | awk '{print $2}' | sort -u`
> do
> echo $i
> bpgetconfig -s $i -A -L | egrep "Version|Patch|Platform"
> done

2. For trying to check the disk space i need to login to each and every client.
I have the root login and passwords for all the clients but the problem is that ssh and rsh prompts for a password which i couldn eliminate from the script.

It will be very much helpful if you could let me know how to automate this task as in your script.

Sriram
Level 6
Step one of yours is fine.

For step 2 you can setup passwordless authentication between the master server and the clients you have. Find the steps below:

WARNING:

It is highly HIGHLY recommended that you only set up passwordless authentication to extremely neutered accounts on the target machine; perhaps an account with absolutely no privileges at all beyond sudo permission (if necessary) to run a single script which the account in question DOES NOT have write permission on. This limits the damage a potential rogue user who compromises the computer on the other end could cause.


To do this, you need to set up key-based authentication between the user account you'll be using on your local computer, and the user account you'll be logging into on the remote computer. Here's the steps:

1.  Creating a public/private keyset with ssh-keygen on the computer and under the user account you want to log in FROM:

ph34r# mkdir ~/.ssh
ph34r# chmod 700 ~/.ssh
ph34r# cd ~/.ssh
ph34r# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key ("your_local_home"/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in id_rsa.
Your public key has been saved in id_rsa.pub.
The key fingerprint is:
17:5a:e7:77:ad:2c:0b:8e:f3:97:f8:20:53:79:69:55 root@ph34r

2.  Getting the public half of the key to the REMOTE computer and user account you want to log in TO:

ph34r# scp ~/.ssh/id_rsa.pub <login>@<host name>:/home/<login>/id_rsa.ph34r.pub
ph34r# ssh <login>@<hostname>
Password:
% mkdir .ssh
% chmod 700 .ssh
% cat id_rsa.ph34r.pub >> .ssh/authorized_keys
% chmod 644 .ssh/authorized_keys

3.  Checking to make sure it worked:

% exit
ph34r# ssh <login>@<hostname>
%


Sriram
Level 6
Once you setup passwordless authentication your set to go and blast your way to get what you need.

Hope this helps.. 

Let me know the results.

Karthikeyan_Sun
Level 6
Basically am WIndows admin; Just Learning Unix :)

rj_nbu
Level 6
Employee Accredited Certified
If you want to know the free disk space on the remote machine, just run this commad:

ssh user@remoteclient /bin/df -kh


-Rajeev
"Unix IS user friendly... It's just selective about who its friends are"

vg_janakiraman
Level 2
Many thanks for you all for the replies.

The problem is that i need to automate the upgradation task and hence passwords should not be prompted or password entry needs to be automated.

Executing ssh user@remoteclient /bin/df -kh prompts for password
and
Creating a public/private keyset with ssh-keygen(as posted by Sriram) on all the clients is again a manual task as there are a large number of clients that needs to be upgraded.

Please help.

Will_Restore
Level 6
Run ssh with password or set up authorized keys.  Benefit of the latter is you set it up one time and subsequent upgrades are smoother.

jnardello
Moderator
Moderator
   VIP    Certified
If you don't want to have any password prompting, and you don't want to set up any kind of trust between your Master and the clients, then you're looking only a few more choices : 
1) look into automated deployment software
2) leverage a monitoring system of some kind to do your filesystem checks for you
3) find a server that's already been trusted everywhere and run your script off of that.
4) put together a software install script on a public share/server and make the client server owners responsible for upgrading their own stuff by calling the script themselves. Make it their problem.

I think that about covers all possiblities. =)