Browse code

Add munin to stack

Dean Troyer authored on 2011/09/14 05:37:50
Showing 2 changed files
... ...
@@ -10,3 +10,4 @@ lsof # useful when debugging
10 10
 openssh-server
11 11
 vim-nox
12 12
 locate # useful when debugging
13
+munin
... ...
@@ -34,6 +34,7 @@ KEYSTONE_DIR=$DEST/keystone
34 34
 NOVACLIENT_DIR=$DEST/python-novaclient
35 35
 API_DIR=$DEST/openstackx
36 36
 NOVNC_DIR=$DEST/noVNC
37
+MUNIN_DIR=$DEST/openstack-munin
37 38
 
38 39
 # Use the first IP unless an explicit is set by ``HOST_IP`` environment variable
39 40
 if [ ! -n "$HOST_IP" ]; then
... ...
@@ -101,12 +102,15 @@ git_clone https://github.com/cloudbuilders/python-novaclient.git $NOVACLIENT_DIR
101 101
 # openstackx is a collection of extensions to openstack.compute & nova 
102 102
 # that is *deprecated*.  The code is being moved into python-novaclient & nova.
103 103
 git_clone https://github.com/cloudbuilders/openstackx.git $API_DIR
104
+# openstack-munin is a collection of munin plugins for monitoring the stack
105
+git_clone https://github.com/cloudbuilders/openstack-munin.git $MUNIN_DIR
104 106
 
105 107
 # Initialization
106 108
 # ==============
107 109
 
108 110
 # setup our checkouts so they are installed into python path
109 111
 # allowing ``import nova`` or ``import glance.client``
112
+cd $NOVA_DIR; sudo python setup.py develop
110 113
 cd $NOVACLIENT_DIR; sudo python setup.py develop
111 114
 cd $KEYSTONE_DIR; sudo python setup.py develop
112 115
 cd $GLANCE_DIR; sudo python setup.py develop
... ...
@@ -165,6 +169,30 @@ sudo mv /tmp/000-default /etc/apache2/sites-enabled
165 165
 # dashboard can run
166 166
 sudo chown -R www-data:www-data $DASH_DIR
167 167
 
168
+# Munin
169
+# -----
170
+
171
+# allow connections from other hosts
172
+sudo sed -i -e '/Allow from localhost/s/localhost.*$/all/' /etc/munin/apache.conf
173
+
174
+cat >/tmp/nova <<EOF
175
+[keystone_*]
176
+user stack
177
+
178
+[nova_*]
179
+user stack
180
+EOF
181
+sudo mv /tmp/nova /etc/munin/plugin-conf.d/nova
182
+
183
+# configure Munin for Nova plugins
184
+PLUGINS="keystone_stats nova_floating_ips nova_instance_launched nova_instance_ nova_instance_timing nova_services"
185
+for i in $PLUGINS; do
186
+  sudo cp -p $MUNIN_DIR/$i /usr/share/munin/plugins
187
+  sudo ln -sf /usr/share/munin/plugins/$i /etc/munin/plugins
188
+done
189
+sudo mv /etc/munin/plugins/nova_instance_ /etc/munin/plugins/nova_instance_launched
190
+sudo restart munin-node
191
+
168 192
 # Glance
169 193
 # ------
170 194
 
... ...
@@ -264,7 +292,7 @@ screen_it n-net "$NOVA_DIR/bin/nova-network"
264 264
 screen_it n-sch "$NOVA_DIR/bin/nova-scheduler"
265 265
 # nova-vncproxy binds a privileged port, and so needs sudo
266 266
 screen_it n-vnc "sudo $NOVA_DIR/bin/nova-vncproxy"
267
-screen_it dash "sudo /etc/init.d/apache2 restart; tail -f /var/log/apache2/error.log"
267
+screen_it dash "sudo /etc/init.d/apache2 restart; sudo tail -f /var/log/apache2/error.log"
268 268
 
269 269
 # Install Images
270 270
 # ==============