2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

Merge pull request #182 from iborodikhin/master

"Warning" and "critical" use
This commit is contained in:
Steve Schnepp 2012-09-10 01:36:53 -07:00
commit 580f586dbb

View File

@ -40,15 +40,23 @@ indexName = progName[progName.find("_")+1:]
if len(sys.argv) == 2 and sys.argv[1] == "autoconf":
print "yes"
elif len(sys.argv) == 2 and sys.argv[1] == "config":
print "graph_title Sphinx index %s stats"%indexName
warning = "0:"
critical = "0:"
if "warning" in os.environ and os.environ["warning"] != None:
warning = os.environ["warning"]
if "critical" in os.environ and os.environ["critical"] != None:
critical = os.environ["critical"]
print "graph_title Sphinx index %s stats" % indexName
print "graph_vlabel docs count"
print "graph_category search"
print "documents_count.warning %s" % warning
print "documents_count.critical %s" % critical
print "documents_count.label Documents count in index"
print "graph_args --base 1000 -l 0"
else:
if "server" in os.environ and os.environ["server"] != None:
server = os.environ["server"]
server = os.environ["server"]
else:
server = "localhost"
@ -66,4 +74,4 @@ else:
result = client.Query("", indexName)
docCount = result["total_found"]
print "documents_count.value %d"%docCount
print "documents_count.value %d" % docCount