1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00

Adding critical environment variable use

This commit is contained in:
iborodikhin 2012-09-10 12:08:04 +06:00
parent f8909aa41c
commit 2c99f32750

View file

@ -40,15 +40,20 @@ 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
critical = "0:"
if "critical" in os.environ and os.environ["critical"] != None:
warning = os.environ["critical"]
print "graph_title Sphinx index %s stats" % indexName
print "graph_vlabel docs count"
print "graph_category search"
print "load.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 +71,4 @@ else:
result = client.Query("", indexName)
docCount = result["total_found"]
print "documents_count.value %d"%docCount
print "documents_count.value %d" % docCount