mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 02:51:03 +00:00
Adding critical environment variable use
This commit is contained in:
parent
f8909aa41c
commit
2c99f32750
1 changed files with 8 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue