From aa8157b66967aeea47b014e46ff6f4ce65dbd177 Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Mon, 24 Dec 2012 14:57:43 -0800 Subject: [PATCH] Updating munin for new version. --- config/hosts | 2 +- config/munin.conf | 6 ++++++ config/munin/mongo_lock | 4 +++- config/nginx.newsblur.conf | 7 +++++++ fabfile.py | 7 ++++--- 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/config/hosts b/config/hosts index 676a1222a..23d4f2a25 100644 --- a/config/hosts +++ b/config/hosts @@ -7,7 +7,7 @@ 199.15.249.101 db01 db01.newsblur.com 199.15.252.50 db02 db02.newsblur.com -# 199.15.253.226 db03 db03.newsblur.com +199.15.253.90 db03 db03.newsblur.com 199.15.249.98 db04 db04.newsblur.com 199.15.249.99 db05 db05.newsblur.com 199.15.249.101 db07 db07.newsblur.com diff --git a/config/munin.conf b/config/munin.conf index 39d8b5fd6..781c685d9 100644 --- a/config/munin.conf +++ b/config/munin.conf @@ -1,3 +1,9 @@ +# Configfile for Munin master +dbdir /var/lib/munin +htmldir /var/www/munin +logdir /var/log/munin +rundir /var/run/munin + includedir /etc/munin/munin-conf.d [newsblur.com] diff --git a/config/munin/mongo_lock b/config/munin/mongo_lock index eeb53b471..7468c5aef 100755 --- a/config/munin/mongo_lock +++ b/config/munin/mongo_lock @@ -31,7 +31,9 @@ def getServerStatus(): name = "locked" def doData(): - print name + ".value " + str( 100 * getServerStatus()["globalLock"]["ratio"] ) + ratio = (float(getServerStatus()["globalLock"]["lockTime"]) / + getServerStatus()["globalLock"]["totalTime"]) + print name + ".value " + str( 100 * ratio ) def doConfig(): diff --git a/config/nginx.newsblur.conf b/config/nginx.newsblur.conf index 73fa79b1c..0e48a1458 100644 --- a/config/nginx.newsblur.conf +++ b/config/nginx.newsblur.conf @@ -81,6 +81,13 @@ server { location /munin/ { alias /var/cache/munin/www/; } + + location ^~ /cgi-bin/munin-cgi-graph/ { + fastcgi_split_path_info ^(/cgi-bin/munin-cgi-graph)(.*); + fastcgi_param PATH_INFO $fastcgi_path_info; + fastcgi_pass unix:/var/run/munin/fcgi-graph.sock; + include fastcgi_params; + } location ^~ /rss_feeds/icon/ { proxy_set_header X-Real-IP $remote_addr; diff --git a/fabfile.py b/fabfile.py index 7a753e78c..b2348240a 100644 --- a/fabfile.py +++ b/fabfile.py @@ -42,7 +42,7 @@ env.roledefs ={ ], 'db': ['db01.newsblur.com', 'db02.newsblur.com', - # 'db03.newsblur.com', + 'db03.newsblur.com', 'db04.newsblur.com', 'db05.newsblur.com', ], @@ -422,7 +422,7 @@ def setup_psycopg(): def setup_python(): # sudo('easy_install -U pip') - sudo('easy_install -U fabric django==1.3.1 readline chardet mysql-python pyflakes iconv celery django-celery django-celery-with-redis django-compress South django-extensions pymongo==2.2.0 stripe BeautifulSoup pyyaml nltk lxml oauth2 pytz boto seacucumber django_ses mongoengine redis requests django-subdomains psutil python-gflags cssutils raven pyes') + sudo('easy_install -U fabric django==1.3.1 readline chardet pyflakes iconv celery django-celery django-celery-with-redis django-compress South django-extensions pymongo==2.2.0 stripe BeautifulSoup pyyaml nltk lxml oauth2 pytz boto seacucumber django_ses mongoengine redis requests django-subdomains psutil python-gflags cssutils raven pyes') put('config/pystartup.py', '.pystartup') # with cd(os.path.join(env.NEWSBLUR_PATH, 'vendor/cjson')): @@ -495,7 +495,7 @@ def setup_pymongo_repo(): sudo('rm -fr /usr/local/lib/python2.7/dist-packages/pymongo*') sudo('rm -fr /usr/local/lib/python2.7/dist-packages/bson*') sudo('rm -fr /usr/local/lib/python2.7/dist-packages/gridgs*') - sudo('ln -s %s /usr/local/lib/python2.7/dist-packages/' % + sudo('ln -fs %s /usr/local/lib/python2.7/dist-packages/' % os.path.join(env.VENDOR_PATH, 'pymongo/{pymongo,bson,gridfs}')) def setup_forked_mongoengine(): @@ -728,6 +728,7 @@ def setup_db_munin(): run('git clone git://github.com/samuel/python-munin.git') with cd(os.path.join(env.VENDOR_PATH, 'python-munin')): run('sudo python setup.py install') + sudo('/etc/init.d/munin-node restart') def enable_celerybeat(): with cd(env.NEWSBLUR_PATH):