mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 14:16:00 +00:00
Merge pull request #557 from ercpe/master
Use a zero-based percentage graph for nginx cache status
This commit is contained in:
commit
1a0a9da00b
1 changed files with 5 additions and 1 deletions
|
@ -54,16 +54,20 @@ cache_status_list = { "MISS" : 0, "EXPIRED" : 0, "UPDATING" : 0, "STALE" : 0, "H
|
||||||
if len(sys.argv) == 2 and sys.argv[1] == "autoconf":
|
if len(sys.argv) == 2 and sys.argv[1] == "autoconf":
|
||||||
print "yes"
|
print "yes"
|
||||||
elif len(sys.argv) == 2 and sys.argv[1] == "config":
|
elif len(sys.argv) == 2 and sys.argv[1] == "config":
|
||||||
|
graph_args = ""
|
||||||
if graph_type == "number":
|
if graph_type == "number":
|
||||||
vlabel = "requests"
|
vlabel = "requests"
|
||||||
else:
|
else:
|
||||||
vlabel = "%"
|
vlabel = "%"
|
||||||
|
graph_args = "graph_args -l 0"
|
||||||
|
|
||||||
# Parent graph declaration
|
# Parent graph declaration
|
||||||
print "multigraph nginx_cache_multi_%s" % graph_type
|
print "multigraph nginx_cache_multi_%s" % graph_type
|
||||||
print "graph_title Nginx cache status (%s)" % graph_type
|
print "graph_title Nginx cache status (%s)" % graph_type
|
||||||
print "graph_category nginx"
|
print "graph_category nginx"
|
||||||
print "graph_vlabel %s" % vlabel
|
print "graph_vlabel %s" % vlabel
|
||||||
|
if graph_args:
|
||||||
|
print(graph_args)
|
||||||
for key in cache_status_list.keys():
|
for key in cache_status_list.keys():
|
||||||
if key != "TOTAL":
|
if key != "TOTAL":
|
||||||
print "%s.label %s" % (key.lower(), key.capitalize())
|
print "%s.label %s" % (key.lower(), key.capitalize())
|
||||||
|
@ -156,4 +160,4 @@ else:
|
||||||
print "multigraph nginx_cache_multi_%s.%s" % (graph_type, key.lower())
|
print "multigraph nginx_cache_multi_%s.%s" % (graph_type, key.lower())
|
||||||
print "total.value %s" % cache_status_list["TOTAL"]
|
print "total.value %s" % cache_status_list["TOTAL"]
|
||||||
print "%s.value %s" % (key.lower(), cache_status_list[key])
|
print "%s.value %s" % (key.lower(), cache_status_list[key])
|
||||||
print ""
|
print ""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue