Oct 202011
 

We had performance issues on our NFS servers, very poor performances.
after analyze we have seen that the bottleneck came from the disks, as always;
but tuning the FS did not solve the problem.

I talk about 1500 NFS mountpoint (running on 9 nodes from ServiceGuard cluster solution) as in my actual mission, everything works through NFS.
The homedir of course but also the applications, the logs, libraries etc…
Continue reading »

Oct 142011
 

Hi gents,

after searching a script to massive set quota for users on HP-UX, i’ve found nothing, only people asking how to do it.
of course you have the ‘edquota’ command, which can copy a user’s quota template into another account, but this is not the best way.

so, i’ve wrote a little script to do the job, for all my NFS users.

this script will definitively not fit for an other person than me and my needs, but I think it can be a good basis.
Continue reading »

Juin 202011
 

script permettant un affichage amélioré de : bdf

bdf affiche généralement sur 2 ligne une info concernant un point de montage si celui-ci dépasse 80 caractère, ce qui est souvent le cas.

ce script affiche chaque enregistrement sur une seule ligne, avec en sus, des infos comme le nombre d’inodes et le type de filesystème.

la version perl de ce script fonctionne très bien.
cependant, perl n’est pas présent sur tout les serveurs.

voici donc la version ksh.

Download : bdfa.sh


 Publié par à 12 h 47 min  Taggué avec :
Juin 152011
 

j’ai eu un filesystème à 90% ce Week-End.
j’ai eu beau chercher partout avec « find » et « du », rien a faire, je ne trouvais pas ce qui clochait.

la seule explication que j’ai pu trouver était : les fichiers sont sous un point de montage,on ne peut pas les voir.
seulement voila, on ne démonte pas un filesystem sur un serveur en production pour voir s’il y a des fichiers en dessous !
heureusement, il y a toujours une solution xD
Continue reading »

 Publié par à 13 h 03 min  Taggué avec : ,
Juin 152011
 

Testé sur HP-UX

veuillez vérifier le chemin de /bin/printf et /bin/echo

détection de la taille de l’écran.
affichage sans débordement à moins que l’un des choix soit lui même plus grand que le taille de cet écran.

cette fonction prend en argument un liste de valeur et retourne cette liste comme un menu.
ce menu sera adapté à la taille de votre terminal.

si la taille ne peut pas être détectée, l’affichage sera un choix par ligne.
Continue reading »

Juin 152011
 

avec awk sur des multiples de 1024
pour mémoire

petit awk pour calculer les octets en Koctet

$ echo 1023 |awk '{ if($1<1025){print "1";exit}else{x=$1}; x = $1<1025 ? 1025 : $1 ; x /= x>1024 ? 1024 : 0 ; printf("%dn", x += int(x)<x ? 1 : 0) }'
1
$ echo 1024 |awk '{ if($1<1025){print "1";exit}else{x=$1}; x = $1<1025 ? 1025 : $1 ; x /= x>1024 ? 1024 : 0 ; printf("%dn", x += int(x)<x ? 1 : 0) }'
1
$ echo 1025 |awk '{ if($1<1025){print "1";exit}else{x=$1}; x = $1<1025 ? 1025 : $1 ; x /= x>1024 ? 1024 : 0 ; printf("%dn", x += int(x)<x ? 1 : 0) }'
2
$ echo 4095 |awk '{ if($1<1025){print "1";exit}else{x=$1}; x = $1<1025 ? 1025 : $1 ; x /= x>1024 ? 1024 : 0 ; printf("%dn", x += int(x)<x ? 1 : 0) }'
4
$ echo 4096 |awk '{ if($1<1025){print "1";exit}else{x=$1}; x = $1<1025 ? 1025 : $1 ; x /= x>1024 ? 1024 : 0 ; printf("%dn", x += int(x)<x ? 1 : 0) }'
4
$ echo 4097 |awk '{ if($1<1025){print "1";exit}else{x=$1}; x = $1<1025 ? 1025 : $1 ; x /= x>1024 ? 1024 : 0 ; printf("%dn", x += int(x)<x ? 1 : 0) }'
5
Juin 152011
 

si vous avez un netmask du style: fffcac00
voici comment le convertir avec sed/awk:

$ echo fffcac00 |sed 's/\(..\)/\1 /g' |awk '{printf ("%d.%d.%d.%d\n","0x"$1,"0x"$2,"0x"$3,"0x"$4)}'
255.252.172.0

– on sépare tout les deux caracteres par un espace.
– on utilise awk pour travailler sur chaque champ séparé par un espace.
– on utilise le printf de awk pour convertir l’hexa en décimal.

Juin 152011
 

ce script n’est pas de moi mais c’est un bon aide mémoire sur les bitwise

#!/bin/ksh
 
typeset -i2 mask=255
 
[[ $# != 2 ]] && {
   echo "Usage: $0 ipaddress subnetmask"
   exit 1
}
 
SaveIFS=$IFS
IFS=.
set -A IParr $1
set -A NMarr $2
IFS=$SaveIFS
 
typeset -i2 ipbin1=${IParr[0]}
typeset -i2 ipbin2=${IParr[1]}
typeset -i2 ipbin3=${IParr[2]}
typeset -i2 ipbin4=${IParr[3]}
 
typeset -i2 nmbin1=${NMarr[0]}
typeset -i2 nmbin2=${NMarr[1]}
typeset -i2 nmbin3=${NMarr[2]}
typeset -i2 nmbin4=${NMarr[3]}
 
echo
echo "       IP Address: $1"
echo "      Subnet Mask: $2"
echo "  Network Address: $((ipbin1 & nmbin1)).$((ipbin2 & nmbin2)).$((ipbin3 & nmbin3)).$((ipbin4 & nmbin4))"
echo "Broadcast Address: $((ipbin1 | (mask ^ nmbin1))).$((ipbin2 | (mask ^ nmbin2))).$((ipbin3 | (mask ^ nmbin3))).$((ipbin4 | (mask ^ nmbin4)))"
echo