Tag Archives: Conky

Configuration ultime pour Conky

 Afin de pouvoir monitorer et superviser plus facilement mon serveur Ubuntu, j'ai décidé d'utiliser le logiciel Conky.

Celui ci permet d'afficher sur le fond d'ecran de votre bureau plusieurs informations relatives à votre pc tels que la mémoire utilisée, la capacité de vos disques, l'utilisation de votre processeur, etc…

Ce logiciel est bien conçu car il est totalement configurable, sans limite et qu'il consomme très peu de ressources systèmes.

Je vous partage donc la configuration que j'utilise.

Pour l'utiliser, il faut éditer le fichier "~/.conky"

# conky configuration

# set to yes if you want Conky to be forked in the background
background no

# X font when Xft is disabled, you can pick one with program xfontsel
#font 5x7
#font 6x10
#font 7x13
#font 8x13
#font 9x15
#font *mintsmild.se*
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-*

# Use Xft?
use_xft yes

# Xft font when Xft is enabled
xftfont Bitstream Vera Sans Mono:size=9

# Text alpha when using Xft
xftalpha 0.8

# Update interval in seconds
update_interval 1.0

# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0

# Create own window instead of using desktop (required in nautilus)
own_window no

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# Minimum size of text area
minimum_size 300 0
maximum_width 350

# Draw shades?
draw_shades yes

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no
draw_graph_borders yes

# Stippled borders?
stippled_borders 8

# border margins
border_margin 4

# border width
border_width 1

# Default colors and also border colors
default_color white
default_shade_color black
default_outline_color white

# own window options
own_window              yes
own_window_transparent  yes
own_window_type         override
own_window_hints        undecorated,below,sticky,skip_taskbar,skip_pager

# Text alignment, other possible values are commented
#alignment top_left
alignment top_right
#alignment bottom_left
#alignment bottom_right

# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 10
gap_y 35

# Subtract file system buffers from used memory?
no_buffers yes

# set to yes if you want all text to be in uppercase
uppercase no

# number of cpu samples to average
# set to 1 to disable averaging
cpu_avg_samples 2

# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 2

# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes

# Add spaces to keep things from moving about?  This only affects certain objects.
use_spacer right

# colours
color1 white
color2 orange

text_buffer_size 2048

# variable is given either in format $variable or in ${variable}. Latter
# allows characters right after the variable and must be used in network
# stuff because of an argument

# stuff after 'TEXT' will be formatted on screen

${offset -5}${color2}${font StyleBats:size=12}q ${voffset -2}${font Bitstream Vera Sans Mono:style=Bold:size=11}System${font}  ${hr}
Host: ${color1}$nodename${color2} Uptime: ${color1}${uptime}${color2}
OS: ${color1}$sysname $kernel${color2} on ${color1}$machine

${offset -5}${color2}${font StyleBats:size=12}q ${voffset -2}${font Bitstream Vera Sans Mono:style=Bold:size=11}CPU${font}  ${hr}
${color1}${execi 1000 cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //'}
${freq}MHz   ${color2}Load: ${color1}${loadavg}   ${color2}Temp: ${color1}${acpitemp}°C
${color2}CPU Bar:  ${color1}$cpubar
${color2}Load Bar: ${color1}${cpugraph FFFFFF ffffff}

${offset -5}${color2}${font StyleBats:size=12}q ${voffset -2}${font Bitstream Vera Sans Mono:style=Bold:size=11}Memory${font}  ${hr}
${color2}RAM:      ${color1}$memperc% used ${membar 6}${color2}
${color2}Swap:     ${color1}$swapperc% used ${swapbar 6}${color2}

${offset -5}${color2}${font StyleBats:size=12}q ${voffset -2}${font Bitstream Vera Sans Mono:style=Bold:size=11}Disks${font}  ${hr}
${color2}Root:     ${color1}${fs_free_perc /} % free  ${fs_bar 6 /}
${color2}Freebox:  ${color1}${fs_free_perc /freebox} % free  ${fs_bar 6 /freebox}
${color2}Data:     ${color1}${fs_free_perc /data} % free  ${fs_bar 6 /data}

${offset -5}${color2}${font StyleBats:size=12}q ${voffset -2}${font Bitstream Vera Sans Mono:style=Bold:size=11}Raid Status${font}  ${hr}
${color2}MdStat:   ${execi 60 tail -n3 /proc/mdstat | fold -w46}

${offset -5}${color2}${font StyleBats:size=12}q ${voffset -2}${font Bitstream Vera Sans Mono:style=Bold:size=11}Networks${font}  ${hr}
${color2}Net IP:   ${color1}${execi 3600 wget -O - http://www.whatismyip.org/ | tail}
${color2}Router:   ${color1}${addr eth0}
${color2}Down:     ${color1}${downspeed eth0} k/s ${offset 53}${color2}Up:${color1}   ${upspeed eth0} k/s
${color2}TDown:    ${color1}${totaldown eth0}     ${offset 53}${color2}TUp:${color1}  ${totalup eth0}
${downspeedgraph eth0 25,145 FFFFFF ffffff} ${upspeedgraph eth0 25,145 FFFFFF ffffff}

${offset -5}${color2}${font StyleBats:size=12}q ${voffset -2}${font Bitstream Vera Sans Mono:style=Bold:size=11}Processing${font}  ${hr}
NAME            PID       CPU%      MEM%${color1}
${top name 1} ${top pid 1}   ${top cpu 1}    ${top mem 1}
${top name 2} ${top pid 2}   ${top cpu 2}    ${top mem 2}
${top name 3} ${top pid 3}   ${top cpu 3}    ${top mem 3}
${top name 4} ${top pid 4}   ${top cpu 4}    ${top mem 4}

${offset -5}${color2}${font StyleBats:size=12}q ${voffset -2}${font Bitstream Vera Sans Mono:style=Bold:size=11}Logs${font}  ${hr}
${color1}${execi 30 tail -n3 /var/log/messages | fold -w46}
${color2}${stippled_hr 1}

Voila le rendu sur mon serveur:

Conky Configuration

Avec les infos que j'affiche je sais ainsi en 2 temps 3 mouvements si mon processeur est utilisé à 100%, si mon RAID est opérationnel, si mes disques durs sont pleins et j'en passe.

Pour moi, Conky est juste INDISPENSABLE.