Conkynetwork.sh (fr)

From Conky PitStop

Jump to: navigation, search

conkynetwork.sh (infos réseau)

 Langue   English   Français   


Script-crinos512-conkynetwork.png

Voici mon script pour mon réseau, et comme vous pouvez le voir, il est assez simple car il utilise des fonctions de Conky sauf pour la dernière ligne qui necessite vnstat. Vous pourrez avoir besoin de changer eth0 selon l'interface utilisée par votre système mais eth0 est l'interface par défaut sur la plupart des sytèmes.

#!/bin/sh
# conkynetwork.sh
# by Crinos512
# Usage:
#  ${execp ~/.conky/conkyparts/conkynetwork.sh}
#
Month=\"`date +"%b '%y"`\"

echo "\${color1}\${stippled_hr 1}\${color}"
echo "\${voffset -6}  Network: (Internal: \${color2}\${addrs eth0}\${color}, External: \${color2}\${exec wget -q -O - checkip.dyndns.org | sed -e 's/[^[:digit:]|.]//g'}\${color} )"
echo "\${voffset -6}\${color1}\${stippled_hr 1}\${color}"
echo "\${voffset -5}\$alignc\${downspeedgraph eth0 60,175 110000 550000 -t} \${upspeedgraph eth0 60,175 001100 005500 -t}"
echo "\${voffset -68}     \`Down\${goto 110}\${color2}\${downspeedf eth0} k/s \${color}\${goto 200}\`Up:\${goto 310}\${color2}\${upspeedf eth0} k/s\${color}"
echo "     \`Total Down:\${goto 110}\${color2}\${totaldown eth0}\${color}\${goto 200}\`Total Up:\${goto 310}\${color2}\${totalup eth0}\${color}"
echo "     \`Weekly Down:\${goto 110}\${color2}\${exec vnstat -w -i eth0 | grep \"current week\" | awk '{print \$3 \$4}'}\${color}\${goto 200}\`Weekly Up:\${goto 310}\${color2}\${exec vnstat -w -i eth0 | grep \"current week\" | awk '{print \$6 \$7}'}\${color}"
echo "     \`Monthly Down:\${goto 110}\${color2}\${exec vnstat -m -i eth0 | grep $Month | awk '{print \$3 \$4}'}\${color}\${goto 200}\`Monthly Up:\${goto 310}\${color2}\${exec vnstat -m -i eth0 | grep $Month | awk '{print \$6 \$7}'}\${color}"
echo ""

exit 0


[UMise à jour : 12 Sept. 2009]

Personal tools
Namespaces
Variants
Actions
Navigation
English
Français
Toolbox