Getting disk information from multiple servers


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Getting disk information from multiple servers
# 1  
Old 06-27-2008
Getting disk information from multiple servers

Hey guyz hw u all doing.
I need some help regarding "df -m".I have to check 10 servers thrice a day and have to make a text file.The only problem is I have to log into those 10 servers * 3 =30 times every time .Is there any way ,we can write a script that will automatically run on all 10 server( the command "df -m") and email the result to me ,instead of me logging into each server and run df-m.

Appreciate your help guys.. (by the way the username and password are same for all 10 servers)

--CK
# 2  
Old 06-27-2008
I don't understand the issue.... Why not write a script and put a copy on each server under cron control to run 3 times a day and email you? You can even get the date in the subject......

Z=`date`
df -m | mail -s "From server X on $Z" youremailaddress

something like that... Quotes around email subject (the -s parm) have to be double quotes or the $Z will not be expanded....
# 3  
Old 06-27-2008
Quote:
Originally Posted by quine
I don't understand the issue.... Why not write a script and put a copy on each server under cron control to run 3 times a day and email you? You can even get the date in the subject......

Z=`date`
df -m | mail -s "From server X on $Z" youremailaddress

something like that... Quotes around email subject (the -s parm) have to be double quotes or the $Z will not be expanded....
That sounds reasonable..sometimes I have to see the logs as well if the disk usage is more.Wht I thought is if it is a script we can uncomment that part and run the script so tht the script will gather all logs as needed.sorry iam novice in unix , i dont know we can address this issue as well using cron or not.I really want to use a script than keeping in cron.

Really appreciate ur help guys.

--CK
# 4  
Old 06-27-2008
You put those 2 lines into a script, and then you run the script (a copy on each server) with cron...

It sounds like you want some way to trigger these things, all 10 of them, from one place when ever you feel like it. That means you have to log-in to each server in turn and execute the command, etc. There is a unix utility called "rsh" (remote shell). You might want look at that, but I'm usually for the KISS principle.
# 5  
Old 06-30-2008
You should learn Expect:
Expect - Expect - Home Page

It can automate interactive sessions
# 6  
Old 06-30-2008
The only reasonable choice for your method would be generating ssh certificates for passwordless login with forced commands only (for security reasons). This would allow you tu run df -m on remote machines from your script without the need to enter password each time.

For disk usage monitoring you can also use plugins from nagios or net-snmp...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to apply the update statement in multiple servers on multiple dbs at a time .?

Hi , Can any please help the below requirement on all multiple servers and multiple dbs. update configuration set value='yes' ;1) the above statement apply on 31 Databases at a time on different Ip address eg : 10.104.1.12 (unix ip address ) the above ip box contains 4 db's eg : db... (2 Replies)
Discussion started by: venkat918
2 Replies

2. UNIX for Advanced & Expert Users

Inconsistent disk information.

On one of the Unix server B.11.31. a disk that has been provisioned from the VMAX, but according to the diskinfo its show coming from clarion. sudo /opt/emc/SYMCLI/bin/symvg sho /dev/vg_<name> Volume Group Name : /dev/vg_<name> Volume Group Type : HP-UX LVM Volume Group State ... (0 Replies)
Discussion started by: kpatel786
0 Replies

3. AIX

read lv mountpoint information directly from disk

Hello, I need to get the lv mountpoint from the hdisk directly (from vgda i guess) and not from odm or /etc/filesystems I knew the command, but unfortunately I forgot it ;) cheers funksen (5 Replies)
Discussion started by: funksen
5 Replies

4. Red Hat

Information About Solid State Disk in Linux

Hello, I have few HDD and SSD installed in my RHEL 5 server. I want to know which disk are SDD and which are HDD. What command should I use? Thanks (3 Replies)
Discussion started by: fahdmirza
3 Replies

5. Red Hat

Finding disk information

Hi, I would like to know how to find out whether hard disk is local or mapped from storage, on my server both hard disk are there, Please guide me. Regards, Manoj (1 Reply)
Discussion started by: manoj.solaris
1 Replies

6. Homework & Coursework Questions

Using USERNAME variable for getting disk quota information

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. I am trying to write a script where my professor will log in and the script will give him his quota info with the LOGNAME variables, etc. 2. standard I'm not exactly... (0 Replies)
Discussion started by: cchapma1
0 Replies

7. Solaris

Command to List Hard Disk Information

I have a SparcStation5 that is making sounds that make me think the disk drive(s) may be on the verge of quiting. What is the command to list the disk types and sizes? I'm thinking I can possibly pick up another drive or two and compy the exisiting drives while they are still working. (1 Reply)
Discussion started by: muletrainman
1 Replies

8. Shell Programming and Scripting

Calculate disk usage in different servers

Hello, I'm writing a script to monitor different filesystems in multiple servers. And depending on the % free, my script will send an Alert email if % free is less than threshold. I want to keep a input_feed_file which would have "server,filesystem". If I run a script a host 'a', then I can... (3 Replies)
Discussion started by: bperl
3 Replies

9. Shell Programming and Scripting

rsh to change multiple ip in multiple servers?

good day. i jsut wanted to know what is the best script or the best way changing a lot of Ip's in all servers. Do you have any idea? im using awk to change IP,what if, you have lots of servers. You need to change it one by one? It will take time to change it manually. (2 Replies)
Discussion started by: kenshinhimura
2 Replies

10. AIX

hard disk information in AIX

Hi, Other than df -k, is there any command that will tell me all physical hard drives installed on the system as well as the size of each one? I'm using AIX 5.1 Thanks, (3 Replies)
Discussion started by: quickfirststep
3 Replies
Login or Register to Ask a Question