This is a discussion on bash script to collect info within the Shell scripting forums, part of the Development/Scripting category; hi i need script that will ssh to some Linux red hat via ssh and collect configuration file (rpm list ...
|
|||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
|||
|
hi i need script that will ssh to some Linux red hat via ssh and collect configuration file (rpm list and /etc/hosts etc..)
I read about the ssh and there is some problem to save the password in the script for this moment i don't care about that, thanks moshik |
|
||||
|
That's quite easy to achieve (with pubkeys so you don't have to enter passwords everytime). Run Remote Commands with SSH should get you started. However, there are much better tools for monitoring multiple boxes out there. Zabbix, Munin, Monit and Nagios are just the ones coming to mind right now.
__________________
teh.geekosphere.org |
|
|||
|
thanks for the quick response,but i can't use those program only with bash script,
so. if you can supply some script that will collect information from Linux and then will move the information to other Linux via (scp, or rsync or sftp) |
|
|||
|
thanks
now i need to move some file to folder i use this : #!/bin/bash OUT="$(hostname)" mkdir "$(hostname)" `cp /etc/hosts` >> OUT #free -m >>$OUT #echo "Disk info: " >> $OUT #df -h >>$OUT #scp $OUT you@somewhere.com and it not move please assist |
|
|||
|
thanks,
how i can set in the script telnet session telnet to ip address password run command and execute to file/folder and i want to make cp to file's from some folders to backup folder in one line cp /path/to/file and /path/to/file and path/to/file and then move to /path/to/folder BR, moshik |
|
||||
|
Don't use telnet, it is insecure protocol. Use openssh server and open ssh client.
First set ssh keys, see my howto: SSH Public key based authentication - Howto Once done that, run ssh command as follows Code:
ssh you@server-name.com command1 ssh you@server-name.com cp /path/to/something /here/dest |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| howto get my cpu info on linux system? | chiku | Linux software | 3 | 05-08-2008 01:16 AM |
| Does Redhat have "what" utility which can be used to display identification Info? | DCAO | Linux software | 2 | 10-30-2007 07:23 PM |
| Require Shell Script Which sends all server info on mail | puppen | Linux software | 3 | 10-25-2006 08:07 PM |
| USER INFO | asim.mcp | Linux software | 1 | 08-09-2006 03:18 AM |
| find out info. reg. files for each user in the system | ganes | Solaris/OpenSolaris | 6 | 09-20-2005 06:49 PM |