Projet

Général

Profil

Révision 6696a4d8

ID6696a4d894f8d8811966174e4e8acde4e42f50b4
Parent c0fe6dc3
Enfant d004990b

Ajouté par Lars Kruse il y a plus de 6 ans

Plugin lxc: unify whitespace

Voir les différences:

plugins/lxc/lxc-multigraph
110 110
   echo $active
111 111
}
112 112

  
113

  
113 114
function lxc_cgroup {
114 115
   # lxc3 (lxc < 3: may output some warnings if there is cruft in your config dir)
115 116
   lxc-cgroup -o /dev/stdout -l INFO $* | sed 's/^.*lxc_cgroup.c:main:[0-9][0-9]* - //'
116 117
}
117 118

  
119

  
118 120
function lxc_netdev {
119 121
   local g=$1 dev
120 122

  
......
128 130
   fi
129 131
}
130 132

  
133

  
131 134
# find proper sysfs and count it
132 135
# Debian 6.0: /sys/fs/cgroup/<container>/tasks
133 136
# Ubuntu 12.04 with fstab: /sys/fs/cgroup/lxc/<container>/tasks
......
166 169
    return 0
167 170
}
168 171

  
172

  
169 173
# --- BASIC DEFINES
170 174

  
171 175
active_guests=$(active_guests $exclude)
......
218 222
EOF
219 223

  
220 224
   for n in $active_guests
221
   do 
225
   do
222 226
      cat <<EOF
223 227
$(clean_fieldname "cpu_time__${n}").label $n: CPU time
224 228
$(clean_fieldname "cpu_time__${n}").type DERIVE
......
275 279
$(clean_fieldname "net__${n}_up").min 0
276 280
$(clean_fieldname "net__${n}_up").max $bps
277 281
EOF
278
   done   
282
   done
279 283

  
280 284
   cat <<EOF
281 285

  
......
286 290
graph_category lxc
287 291
EOF
288 292
   for n in $active_guests
289
   do 
293
   do
290 294
      cat <<EOF
291 295
$(clean_fieldname "lxc_proc__${n}").label $n: processes
292 296
$(clean_fieldname "lxc_proc__${n}").type GAUGE
......
330 334

  
331 335
echo "multigraph lxc_cpu"
332 336
for n in $active_guests
333
do 
337
do
334 338
   for i in user system
335
   do 
339
   do
336 340
      echo $(clean_fieldname "cpu_${i}__${n}").value $(lxc_cgroup -n "$n" cpuacct.stat | grep $i | awk '{ print $2; }')
337 341
   done
338 342
done
......
345 349

  
346 350
echo "multigraph lxc_logins"
347 351
for n in $active_guests
348
do 
352
do
349 353
   echo $(clean_fieldname "logins__${n}").value $(lxc-attach -n "$n" users | wc -w | bc)
350 354
done
351 355

  

Formats disponibles : Unified diff