forked from erh/mongo-munin
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
139 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/python | ||
|
||
## GENERATED FILE - DO NOT EDIT | ||
|
||
import urllib2 | ||
import sys | ||
|
||
try: | ||
import json | ||
except ImportError: | ||
import simplejson as json | ||
|
||
|
||
def getServerStatus(): | ||
raw = urllib2.urlopen( "http://127.0.0.1:28017/_status" ).read() | ||
return json.loads( raw )["serverStatus"] | ||
|
||
name = "connections" | ||
|
||
|
||
def doData(): | ||
print name + ".value " + str( getServerStatus()["connections"]["current"] ) | ||
|
||
def doConfig(): | ||
|
||
print "graph_title MongoDB current connections" | ||
print "graph_vlabel connections ${graph_period}" | ||
print "graph_category MongoDB" | ||
|
||
print name + ".label " + name | ||
print name + ".type GAUGE" | ||
print name + ".draw AREA" | ||
|
||
|
||
|
||
|
||
|
||
|
||
if __name__ == "__main__": | ||
if len(sys.argv) > 1 and sys.argv[1] == "config": | ||
doConfig() | ||
else: | ||
doData() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/usr/bin/python | ||
|
||
## GENERATED FILE - DO NOT EDIT | ||
|
||
import urllib2 | ||
import sys | ||
|
||
try: | ||
import json | ||
except ImportError: | ||
import simplejson as json | ||
|
||
|
||
def getServerStatus(): | ||
raw = urllib2.urlopen( "http://127.0.0.1:28017/_status" ).read() | ||
return json.loads( raw )["serverStatus"] | ||
|
||
name = "locked" | ||
|
||
def doData(): | ||
print name + ".value " + str( 100 * getServerStatus()["globalLock"]["ratio"] ) | ||
|
||
def doConfig(): | ||
|
||
print "graph_title MongoDB write lock percentage" | ||
print "graph_vlabel percentage ${graph_period}" | ||
print "graph_category MongoDB" | ||
|
||
print name + ".label " + name | ||
print name + ".type GAUGE" | ||
print name + ".draw AREA" | ||
print name + ".min 0" | ||
print name + ".max 100" | ||
|
||
|
||
|
||
|
||
|
||
|
||
if __name__ == "__main__": | ||
if len(sys.argv) > 1 and sys.argv[1] == "config": | ||
doConfig() | ||
else: | ||
doData() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
name = "connections" | ||
|
||
|
||
def doData(): | ||
print name + ".value " + str( getServerStatus()["connections"]["current"] ) | ||
|
||
def doConfig(): | ||
|
||
print "graph_title MongoDB current connections" | ||
print "graph_vlabel connections ${graph_period}" | ||
print "graph_category MongoDB" | ||
|
||
print name + ".label " + name | ||
print name + ".type GAUGE" | ||
print name + ".draw AREA" | ||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
name = "locked" | ||
|
||
def doData(): | ||
print name + ".value " + str( 100 * getServerStatus()["globalLock"]["ratio"] ) | ||
|
||
def doConfig(): | ||
|
||
print "graph_title MongoDB write lock percentage" | ||
print "graph_vlabel percentage ${graph_period}" | ||
print "graph_category MongoDB" | ||
|
||
print name + ".label " + name | ||
print name + ".type GAUGE" | ||
print name + ".draw AREA" | ||
print name + ".min 0" | ||
print name + ".max 100" | ||
|
||
|
||
|
||
|
||
|