Watch
De bricosoft
<google uid="C08" position="left"></google>


watch ou ouatche à Marseille permet de regarder la sortie d'une commande lancé périodiquement.
surveiller les connexions entrantes sur le serveur web
sudo watch 'netstat -anptu |egrep "^Proto|:80 "'
surveiller les connexions entrantes sur le serveur web triées par adresse IP
sudo watch "netstat -plan|grep :80|awk {'print \$5'} | cut -d: -f 1 | sort | uniq -c | sort -nk 1"
monitorer la mémoire
$ watch vmstat -sSM
Every 2,0s: vmstat -sSM Tue Jul 5 14:56:08 2011
1985 M total memory
1847 M used memory
1198 M active memory
519 M inactive memory
138 M free memory
7 M buffer memory
137 M swap cache
1906 M total swap
862 M used swap
1043 M free swap
634330 non-nice user cpu ticks
4622 nice user cpu ticks
98939 system cpu ticks
10016273 idle cpu ticks
515194 IO-wait cpu ticks
4040 IRQ cpu ticks
9116 softirq cpu ticks
0 stolen cpu ticks
10237813 pages paged in
7938513 pages paged out
737930 pages swapped in
687637 pages swapped out
26217419 interrupts
81508609 CPU context switches
1309761911 boot time
54386 forks
surveiller la taille occupée d'un dossier
du -hs . | figlet -k
Every 1,0s: du -hs . | figlet -k Tue Jul 5 15:16:14 2011 _ _ ___ __ _ __ | || | / _ \ / /_ | |/ / | || |_| (_) || '_ \ | ' / |__ _|\__, || (_) || . \ _ |_| /_/ \___/ |_|\_\ (_)
affiche l'heure en gros
Affiche l'heure en gros, ouaih gros.
$ watch -t -n1 "date +%T|figlet -k"
En b33n4ir3 :
$ watch -n 1 'echo "obase=2;`date +%s`" | bc'
surveille les processus mysql
watch mysqladmin --user=toto --password=ntm processlist
surveille le montage de clé USB ou disque USB ou APN
watch "dmesg |tail -15"
surveille la connexion a un site
Toutes les 30 s, vérifie la connexion au site
watch -n 30 curl -s --connect-timeout 10 http://www.bricosoft.com/
surveille le remplissage de disque
$ watch -n 1 "df -h"
Liens
- http://Watch.com
- http://Watch.net
- http://Watch.org
- http://Watch.info
- http://Watch.biz
- http://Watch.fr
Erreur dans le widget DISQUS: Unable to load template 'wiki:DISQUS'