/[vz-tools]/trunk/munin/vebc-install.sh
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /trunk/munin/vebc-install.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 61 - (hide annotations)
Fri Feb 6 10:02:13 2009 UTC (15 years, 2 months ago) by dpavlin
File MIME type: application/x-sh
File size: 1035 byte(s)
munin plugin for bean counters

http://wiki.openvz.org/Monitoring_openvz_resources_using_munin
1 dpavlin 61 #!/bin/bash
2    
3     cp vebc_ /usr/share/munin/plugins/ || exit
4     grep -q vebc /etc/munin/plugin-conf.d/munin-node || echo -e "\n[vebc*]\nuser root\n" >> /etc/munin/plugin-conf.d/munin-node || exit
5    
6     FILE=`mktemp /tmp/ln-vebc-XXXXXX`
7    
8     cd /etc/munin/plugins
9    
10     for resources in kmemsize \
11     lockedpages_privvmpages_shmpages_physpages_vmguarpages_oomguarpages \
12     numproc \
13     numtcpsock_numflock_numpty_numsiginfo_numothersock_numiptent \
14     tcpsndbuf_tcprcvbuf_othersockbuf_dgramrcvbuf \
15     dcachesize \
16     numfile
17     do
18     for VE in 0 `/usr/sbin/vzlist | sed "s/^ *//" |grep '^[0-9]' | cut -f 1 -d " "` ; do
19     ln -sf /usr/share/munin/plugins/vebc_ "vebc_"$resources"_"$VE
20     echo "vebc_"$resources"_"$VE >> $FILE
21     done
22     done
23    
24     # remove no longer deserved links (ie. links pointing to machines
25     # which were destroyed or stoped)
26    
27     find -type l -name vebc_\* | sed "s/\.\///" | while read LN; do
28     if grep ^$LN$ $FILE >/dev/null; then
29     true
30     else
31     rm $LN
32     fi
33     done
34    
35     rm $FILE
36    
37     /etc/init.d/munin-node restart

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26