Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This commit is actually munin-compatible #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 15 additions & 6 deletions mongo_btree
@@ -1,20 +1,31 @@
#!/usr/bin/python
#!/usr/bin/env python

## GENERATED FILE - DO NOT EDIT

import urllib2
import sys
import os
import re

DEFAULT_PORT = 28017

try:
import json
except ImportError:
import simplejson as json


def getServerPort():
me = sys.argv[0]
match = re.compile('.*_([0-9]+)$')
try:
return int(match.findall(me)[0])
except (IndexError, ValueError):
return DEFAULT_PORT

def getServerStatus():
port = getServerPort()
host = os.environ.get("host", "127.0.0.1")
port = 28017
raw = urllib2.urlopen( "http://%s:%d/_status" % (host, port) ).read()
return json.loads( raw )["serverStatus"]

Expand All @@ -27,7 +38,7 @@ def doData():

def doConfig():

print "graph_title MongoDB btree stats"
print "graph_title MongoDB btree stats (%s)" % (getServerPort())
print "graph_args --base 1000 -l 0"
print "graph_vlabel mb ${graph_period}"
print "graph_category MongoDB"
Expand All @@ -48,6 +59,4 @@ if __name__ == "__main__":
if len(sys.argv) > 1 and sys.argv[1] == "config":
doConfig()
else:
doData()


doData()
21 changes: 15 additions & 6 deletions mongo_conn
@@ -1,20 +1,31 @@
#!/usr/bin/python
#!/usr/bin/env python

## GENERATED FILE - DO NOT EDIT

import urllib2
import sys
import os
import re

DEFAULT_PORT = 28017

try:
import json
except ImportError:
import simplejson as json


def getServerPort():
me = sys.argv[0]
match = re.compile('.*_([0-9]+)$')
try:
return int(match.findall(me)[0])
except (IndexError, ValueError):
return DEFAULT_PORT

def getServerStatus():
port = getServerPort()
host = os.environ.get("host", "127.0.0.1")
port = 28017
raw = urllib2.urlopen( "http://%s:%d/_status" % (host, port) ).read()
return json.loads( raw )["serverStatus"]

Expand All @@ -26,7 +37,7 @@ def doData():

def doConfig():

print "graph_title MongoDB current connections"
print "graph_title MongoDB current connections (%s)" % (getServerPort())
print "graph_args --base 1000 -l 0"
print "graph_vlabel connections"
print "graph_category MongoDB"
Expand All @@ -42,6 +53,4 @@ if __name__ == "__main__":
if len(sys.argv) > 1 and sys.argv[1] == "config":
doConfig()
else:
doData()


doData()
21 changes: 15 additions & 6 deletions mongo_lock
@@ -1,20 +1,31 @@
#!/usr/bin/python
#!/usr/bin/env python

## GENERATED FILE - DO NOT EDIT

import urllib2
import sys
import os
import re

DEFAULT_PORT = 28017

try:
import json
except ImportError:
import simplejson as json


def getServerPort():
me = sys.argv[0]
match = re.compile('.*_([0-9]+)$')
try:
return int(match.findall(me)[0])
except (IndexError, ValueError):
return DEFAULT_PORT

def getServerStatus():
port = getServerPort()
host = os.environ.get("host", "127.0.0.1")
port = 28017
raw = urllib2.urlopen( "http://%s:%d/_status" % (host, port) ).read()
return json.loads( raw )["serverStatus"]

Expand All @@ -25,7 +36,7 @@ def doData():

def doConfig():

print "graph_title MongoDB write lock percentage"
print "graph_title MongoDB write lock percentage (%s)" % (getServerPort())
print "graph_args --base 1000 -l 0 "
print "graph_vlabel percentage"
print "graph_category MongoDB"
Expand All @@ -41,6 +52,4 @@ if __name__ == "__main__":
if len(sys.argv) > 1 and sys.argv[1] == "config":
doConfig()
else:
doData()


doData()
21 changes: 15 additions & 6 deletions mongo_mem
@@ -1,20 +1,31 @@
#!/usr/bin/python
#!/usr/bin/env python

## GENERATED FILE - DO NOT EDIT

import urllib2
import sys
import os
import re

DEFAULT_PORT = 28017

try:
import json
except ImportError:
import simplejson as json


def getServerPort():
me = sys.argv[0]
match = re.compile('.*_([0-9]+)$')
try:
return int(match.findall(me)[0])
except (IndexError, ValueError):
return DEFAULT_PORT

def getServerStatus():
port = getServerPort()
host = os.environ.get("host", "127.0.0.1")
port = 28017
raw = urllib2.urlopen( "http://%s:%d/_status" % (host, port) ).read()
return json.loads( raw )["serverStatus"]

Expand All @@ -28,7 +39,7 @@ def doData():

def doConfig():

print "graph_title MongoDB memory usage"
print "graph_title MongoDB memory usage (%s)" % (getServerPort())
print "graph_args --base 1024 -l 0 --vertical-label Bytes"
print "graph_category MongoDB"

Expand All @@ -47,6 +58,4 @@ if __name__ == "__main__":
if len(sys.argv) > 1 and sys.argv[1] == "config":
doConfig()
else:
doData()


doData()
21 changes: 15 additions & 6 deletions mongo_ops
@@ -1,20 +1,31 @@
#!/usr/bin/python
#!/usr/bin/env python

## GENERATED FILE - DO NOT EDIT

import urllib2
import sys
import os
import re

DEFAULT_PORT = 28017

try:
import json
except ImportError:
import simplejson as json


def getServerPort():
me = sys.argv[0]
match = re.compile('.*_([0-9]+)$')
try:
return int(match.findall(me)[0])
except (IndexError, ValueError):
return DEFAULT_PORT

def getServerStatus():
port = getServerPort()
host = os.environ.get("host", "127.0.0.1")
port = 28017
raw = urllib2.urlopen( "http://%s:%d/_status" % (host, port) ).read()
return json.loads( raw )["serverStatus"]

Expand All @@ -26,7 +37,7 @@ def doData():

def doConfig():

print "graph_title MongoDB ops"
print "graph_title MongoDB ops (%s)" % (getServerPort())
print "graph_args --base 1000 -l 0"
print "graph_vlabel ops / ${graph_period}"
print "graph_category MongoDB"
Expand All @@ -43,6 +54,4 @@ if __name__ == "__main__":
if len(sys.argv) > 1 and sys.argv[1] == "config":
doConfig()
else:
doData()


doData()
2 changes: 1 addition & 1 deletion src/body_btree.py
Expand Up @@ -8,7 +8,7 @@ def doData():

def doConfig():

print "graph_title MongoDB btree stats"
print "graph_title MongoDB btree stats (%s)" % (getServerPort())
print "graph_args --base 1000 -l 0"
print "graph_vlabel mb ${graph_period}"
print "graph_category MongoDB"
Expand Down
2 changes: 1 addition & 1 deletion src/body_conn.py
Expand Up @@ -7,7 +7,7 @@ def doData():

def doConfig():

print "graph_title MongoDB current connections"
print "graph_title MongoDB current connections (%s)" % (getServerPort())
print "graph_args --base 1000 -l 0"
print "graph_vlabel connections"
print "graph_category MongoDB"
Expand Down
2 changes: 1 addition & 1 deletion src/body_lock.py
Expand Up @@ -6,7 +6,7 @@ def doData():

def doConfig():

print "graph_title MongoDB write lock percentage"
print "graph_title MongoDB write lock percentage (%s)" % (getServerPort())
print "graph_args --base 1000 -l 0 "
print "graph_vlabel percentage"
print "graph_category MongoDB"
Expand Down
2 changes: 1 addition & 1 deletion src/body_mem.py
Expand Up @@ -9,7 +9,7 @@ def doData():

def doConfig():

print "graph_title MongoDB memory usage"
print "graph_title MongoDB memory usage (%s)" % (getServerPort())
print "graph_args --base 1024 -l 0 --vertical-label Bytes"
print "graph_category MongoDB"

Expand Down
2 changes: 1 addition & 1 deletion src/body_ops.py
Expand Up @@ -7,7 +7,7 @@ def doData():

def doConfig():

print "graph_title MongoDB ops"
print "graph_title MongoDB ops (%s)" % (getServerPort())
print "graph_args --base 1000 -l 0"
print "graph_vlabel ops / ${graph_period}"
print "graph_category MongoDB"
Expand Down
4 changes: 1 addition & 3 deletions src/footer.py
Expand Up @@ -3,6 +3,4 @@
if len(sys.argv) > 1 and sys.argv[1] == "config":
doConfig()
else:
doData()


doData()
13 changes: 12 additions & 1 deletion src/header.py
Expand Up @@ -2,15 +2,26 @@
import urllib2
import sys
import os
import re

DEFAULT_PORT = 28017

try:
import json
except ImportError:
import simplejson as json


def getServerPort():
me = sys.argv[0]
match = re.compile('.*_([0-9]+)$')
try:
return int(match.findall(me)[0])
except (IndexError, ValueError):
return DEFAULT_PORT

def getServerStatus():
port = getServerPort()
host = os.environ.get("host", "127.0.0.1")
port = 28017
raw = urllib2.urlopen( "http://%s:%d/_status" % (host, port) ).read()
return json.loads( raw )["serverStatus"]