]> TLD Linux GIT Repositories - packages/munin-plugins-contrib.git/blob - xen.patch
- updated for current snapshot
[packages/munin-plugins-contrib.git] / xen.patch
1 --- munin.orig/plugins/virtualization/xen       2013-08-23 21:31:56.610001695 +0200
2 +++ munin/plugins/virtualization/xen    2013-08-23 21:36:22.120001621 +0200
3 @@ -18,11 +18,11 @@
4  statefile="/var/lib/munin/plugin-state/munin-plugin-xen.state"
5  
6  if [ "$1" = "autoconf" ]; then
7 -        if which xm > /dev/null ; then
8 +        if which xl > /dev/null ; then
9                  echo yes
10                  exit 0
11          fi
12 -        echo "no (xm not found)"
13 +        echo "no (xl not found)"
14          exit 1
15  fi
16  
17 @@ -39,7 +39,7 @@
18          echo 'graph_category Virtualization'
19          echo 'graph_info This graph shows how many percent of the CPU time was used by each domain'
20  
21 -       xm list | grep -v "^Name .* Time(s)$" | \
22 +       xl list | grep -v "^Name\s.*\sTime(s)$" | \
23          while read name domid mem cpu state time console; do
24                  name=`echo $name | sed -e"s/[-.]/_/g"`
25                 TEST=`less $statefile | grep "^${name}$" | wc -l`
26 @@ -66,7 +66,7 @@
27          exit 0
28  fi
29  
30 -xm list | grep -v "^Name .* Time(s)$" | \
31 +xl list | grep -v "^Name\s.*\sTime(s)$" | \
32  while read name domid mem cpu state time console; do
33          name=`echo $name | sed -e "s/[-.]/_/g"`
34         # only seconds
35 --- munin.orig/plugins/virtualization/xen_cpu_v2        2013-08-23 21:31:56.613334934 +0200
36 +++ munin/plugins/virtualization/xen_cpu_v2     2013-08-23 21:40:07.360001590 +0200
37 @@ -25,10 +25,10 @@
38  use POSIX;
39  
40  # Define where to find xm tools
41 -my $XM = '/usr/sbin/xm';
42 +my $XM = '/usr/sbin/xl';
43  my $XMTOP = '/usr/sbin/xentop';
44  my $curtime = time();
45 -my $basename = `/usr/bin/basename $0`; chop ($basename);
46 +my $basename = `/bin/basename $0`; chop ($basename);
47  my $TEMPFILE = "/tmp/$basename";
48  
49  my $debug = 0;
50 --- munin.orig/plugins/virtualization/xen_memory        2013-08-23 21:31:56.613334934 +0200
51 +++ munin/plugins/virtualization/xen_memory     2013-08-23 21:41:06.290001570 +0200
52 @@ -12,14 +12,14 @@
53  #     autoconf  (optional - used by munin-config)
54  #
55  
56 -XM='/usr/sbin/xm'
57 +XM='/usr/sbin/xl'
58  
59  if [ "$1" = "autoconf" ]; then
60          if [ -e $XM ]; then
61                  echo yes
62                  exit 0
63          fi
64 -        echo "no (xm not found)"
65 +        echo "no (xl not found)"
66          exit 1
67  fi
68  
69 --- munin.orig/plugins/virtualization/xen_traffic_      2013-08-23 21:31:56.616668173 +0200
70 +++ munin/plugins/virtualization/xen_traffic_   2013-08-23 23:17:57.023334928 +0200
71 @@ -11,10 +11,10 @@
72  NAME=$( echo $DOMAIN | sed -e's/-/_/g' ) 
73  
74  if [ "$1" = "autoconf" ]; then
75 -    if which xm > /dev/null ; then
76 +    if which xl > /dev/null ; then
77          echo yes
78      else
79 -        echo "no (xm not found)"
80 +        echo "no (xl not found)"
81          exit 1
82      fi
83      if [ -r /proc/net/dev ]; then
84 @@ -27,7 +27,7 @@
85  fi
86  
87  if [ "$1" = "suggest" ]; then
88 -    xm list | awk '{print $1}' | egrep -v "^(Name|Domain-0)"
89 +    xl list | awk '{print $1}' | egrep -v "^(Name|Domain-0)"
90      exit 0
91  fi
92  
93 @@ -47,7 +47,7 @@
94      exit 0
95  fi
96  
97 -dev=$( xm network-list $DOMAIN | egrep "^[0-9]+" | sed 's@^.*vif/\([0-9]*\)/\([0-9]*\).*$@vif\1.\2@')
98 +dev=$( xl network-list $DOMAIN | egrep "^[0-9]+" | sed 's@^.*vif/\([0-9]*\)/\([0-9]*\).*$@vif\1.\2@')
99  
100  awk -v interface="$dev" \
101      'BEGIN { gsub(/\./, "\\.", interface) } \
102 --- munin.orig/plugins/virtualization/xen_traffic_all   2013-08-23 21:31:56.616668173 +0200
103 +++ munin/plugins/virtualization/xen_traffic_all        2013-08-23 21:45:30.156668240 +0200
104 @@ -10,10 +10,10 @@
105  #%# capabilities=autoconf
106  
107  if [ "$1" = "autoconf" ]; then
108 -    if which xm > /dev/null ; then
109 +    if which xl > /dev/null ; then
110          echo yes
111      else
112 -        echo "no (xm not found)"
113 +        echo "no (xl not found)"
114          exit 1
115      fi
116      if [ -r /proc/net/dev ]; then
117 @@ -30,7 +30,7 @@
118      echo 'graph_vlabel bits received (-) / sent (+) per ${graph_period}'
119      echo 'graph_args --base 1024 -l 0'
120      echo 'graph_category xen'
121 -    DOMAINS=$(xm list | awk '{print $1}' | egrep -v "^(Name|Domain-0)")
122 +    DOMAINS=$(xl list | awk '{print $1}' | egrep -v "^(Name|Domain-0|\(null)")
123      for dom in $DOMAINS; do
124          name=$( echo $dom | tr .- __ )
125          #echo $name"UP.label $name"
126 @@ -48,11 +48,11 @@
127      exit 0
128  fi
129  
130 -DOMAINS=$(xm list | awk '{print $1}' | egrep -v "^(Name|Domain-0)")
131 +DOMAINS=$(xl list | awk '{print $1}' | egrep -v "^(Name|Domain-0|\(null)")
132  for dom in $DOMAINS; do
133 -               dev=$( xm list $dom --long | awk '/vifname / { print $2 }' | sed 's/)//' )
134 +               dev=$( xl list $dom --long | awk '/vifname / { print $2 }' | sed 's/)//' )
135                 if [ "$dev" == "" ]; then
136 -           dev=$( xm network-list $dom |\
137 +           dev=$( xl network-list $dom |\
138                 egrep "^[0-9]+" | sed 's@^.*vif/\([0-9]*\)/\([0-9]*\).*$@vif\1.\2@')
139                 fi
140      name=$( echo $dom | tr .- __ ) 
141 --- munin.orig/plugins/virtualization/xen_vbd   2013-08-23 21:31:56.620001488 +0200
142 +++ munin/plugins/virtualization/xen_vbd        2013-08-23 23:19:52.040001471 +0200
143 @@ -13,7 +13,7 @@
144  #%# capabilities=autoconf
145  
146  # Location of xm tools
147 -$XM = '/usr/sbin/xm';
148 +$XM = '/usr/sbin/xl';
149  $XMTOP = '/usr/sbin/xentop';
150  
151  # ah, parameters coming in 
152 @@ -48,6 +48,7 @@
153                  
154                  @domains = `$XM list`;
155                  shift(@domains); # we don't need the header line
156 +                shift(@domains); # we don't need the header line
157                  
158                  foreach $domain ( @domains )
159                  {
160 @@ -90,9 +90,9 @@
161  @stats = split (/\n/, pop(@chunks));
162  
163  shift(@stats);
164 -shift(@stats);
165 -shift(@stats);
166 -shift(@stats);
167 +#shift(@stats);
168 +#shift(@stats);
169 +#shift(@stats);
170  
171  foreach $domain (@stats)
172  {