[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Managing many Debian machines



Ciao Daniel Whelan,

> Greetings - I am currently looking for a solution to managing and maintaining a large number of Debian machines. 

this is my situation & solution (not perfect but it works :-)
CLIENTs: 15 PC (AMD/INTEL) Debian 2.2 + NIS
paolop@u7365a:/home$ df -h
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/hda1     ext2    197M   28M  160M  15% /
/dev/hda3     ext2    9.2G  708M  8.0G   8% /usr
/dev/hda4     ext2    8.5G   46M  7.9G   1% /var
u7366a:/home               nfs    9.6G  2.9G  6.2G  32% /home
u7366a:/usr/local/Office51 nfs    8.0G  2.9G  4.7G  38% /usr/local/Office51
u7366a:/mizar              nfs    8.0G  2.9G  4.7G  38% /mizar
u7369b:/var/cache/apt      nfs    3.9G  3.4G  303M  92% /var/cache/apt
u7369b:/var/state/apt      nfs    563M  242M  292M  46% /var/state/apt

on u7369b:
$ cat /etc/exports
/var/cache/apt   *.matapp.unimib.it(rw,no_root_squash)
/var/state/apt   *.matapp.unimib.it(rw,no_root_squash)


SERVER: RH 6.2 with NIS+, but it will be "upgraded" to debian as soon as
possible....

and I manage all the PCs with this 3 scripts (from u7369b Debian2.2):


#!/bin/sh
# sync-files.sh

FILE=$1
BASE=u7365
LISTA="a b c d e f g h i j k l m n o"

for HOST in $LISTA ; do
	HOSTNAME=${BASE}${HOST}
	echo -e -n "\t$HOSTNAME : $FILE : "
	scp -p -q $FILE root@${HOSTNAME}:/$FILE
	EXITCODE=$?
	if [ $EXITCODE = 0 ] ; then
		echo "(${EXITCODE})OK."
	else
		echo "(${EXITCODE})PROBLEM!"
	fi
done


#!/bin/sh 
# sync-cmd.sh

COMANDO="$@"
BASE=u7365
LISTA="a b c d e f g h i j k l m n o"

for HOST in $LISTA ; do
	HOSTNAME=${BASE}${HOST}
	echo -e -n "\t*** $HOSTNAME *** : "
	MESSAGE=`ssh root@${HOSTNAME} ${COMANDO}`
	EXITCODE=$?
	
	echo -e "==========" >> ${HOSTNAME}.log
	echo -e "$HOSTNAME"  >> ${HOSTNAME}.log
	echo -e "${COMANDO}" >> ${HOSTNAME}.log
	echo -e "$MESSAGE"   >> ${HOSTNAME}.log
	if [ $EXITCODE = 0 ] ; then
		echo "(${EXITCODE})OK."
#		echo -e "$MESSAGE"
	else
		echo "(${EXITCODE})PROBLEM!"
#		echo -e "$MESSAGE"
	fi
done


#!/bin/sh 
# sync-shell.sh

BASE=u7365
LISTA="a b c d e f g h i j k l m n o"

for HOST in $LISTA ; do
	HOSTNAME=${BASE}${HOST}
	echo -e -n "\t*** $HOSTNAME *** : "
	ssh root@${HOSTNAME}
done



Only 1 problem with apt-get lock file via NFS...
someone has tried coda?

$ ./sincronizza-comando.sh apt-get update
*** u7365a *** : W: Not using locking for nfs mounted lock file /var/state/apt/lists/lock
W: You may want to run apt-get update to correct these missing files
 (0)OK.
*** u7365b *** : W: Not using locking for nfs mounted lock file /var/state/apt/lists/lock
W: You may want to run apt-get update to correct these missing files
 (0)OK.
*** u7365c *** :
.........


-- 

Paolo Pedaletti, Como, ITALYa     www.fastflow.it/~paolop
paolop@matapp.unimib.it           ICQ: 4755831



Reply to: