Révision 2c99f327
Adding critical environment variable use
| plugins/sphinx/sphindex_ | ||
|---|---|---|
| 40 | 40 |
if len(sys.argv) == 2 and sys.argv[1] == "autoconf": |
| 41 | 41 |
print "yes" |
| 42 | 42 |
elif len(sys.argv) == 2 and sys.argv[1] == "config": |
| 43 |
print "graph_title Sphinx index %s stats"%indexName |
|
| 43 |
critical = "0:" |
|
| 44 |
if "critical" in os.environ and os.environ["critical"] != None: |
|
| 45 |
warning = os.environ["critical"] |
|
| 46 |
|
|
| 47 |
print "graph_title Sphinx index %s stats" % indexName |
|
| 44 | 48 |
print "graph_vlabel docs count" |
| 45 | 49 |
print "graph_category search" |
| 50 |
print "load.critical %s" % critical |
|
| 46 | 51 |
|
| 47 | 52 |
print "documents_count.label Documents count in index" |
| 48 | 53 |
print "graph_args --base 1000 -l 0" |
| 49 | 54 |
else: |
| 50 | 55 |
if "server" in os.environ and os.environ["server"] != None: |
| 51 |
server = os.environ["server"]
|
|
| 56 |
server = os.environ["server"] |
|
| 52 | 57 |
else: |
| 53 | 58 |
server = "localhost" |
| 54 | 59 |
|
| ... | ... | |
| 66 | 71 |
result = client.Query("", indexName)
|
| 67 | 72 |
docCount = result["total_found"] |
| 68 | 73 |
|
| 69 |
print "documents_count.value %d"%docCount |
|
| 74 |
print "documents_count.value %d" % docCount |
|
Formats disponibles : Unified diff