summaryrefslogtreecommitdiff
path: root/files
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2009-01-27 00:22:27 +0000
committermh <mh@immerda.ch>2009-01-27 00:22:27 +0000
commitef960f8a85294e7b684d8f0dfffa3ae6fd70441e (patch)
tree2140e73ec7c0b84a379e5a66a7f5c6190276a5a3 /files
parent83970abe570f26acc988207db3d2c2228e08f2c0 (diff)
downloadpuppet-lighttpd-ef960f8a85294e7b684d8f0dfffa3ae6fd70441e.tar.gz
puppet-lighttpd-ef960f8a85294e7b684d8f0dfffa3ae6fd70441e.tar.bz2
added munin plugins for lighttpd
Diffstat (limited to 'files')
-rw-r--r--files/munin/lighttpd_46
1 files changed, 46 insertions, 0 deletions
diff --git a/files/munin/lighttpd_ b/files/munin/lighttpd_
new file mode 100644
index 0000000..5862ee9
--- /dev/null
+++ b/files/munin/lighttpd_
@@ -0,0 +1,46 @@
+#!/usr/bin/python
+
+# Idea from http://thelabmill.de/index.php/92
+# adapted and splitted into submodules by
+# immerda project group <admin+munin(at)immerda.ch>
+# GPLv3
+
+import sys
+kind = sys.argv[0].replace('lighttpd_', '')
+if kind == "total_accesses":
+ graph_title = "Total Accesses"
+ graph_type = "DERIVE"
+ graph_vlabel = "Handled Requests"
+elif kind == "total_kbytes":
+ graph_title = "Total KBytes"
+ graph_type = "DERIVE"
+ graph_vlabel = "Transferred KBytes"
+elif kind == "uptime":
+ graph_title = "Uptime"
+ graph_type = "DERIVE"
+ graph_vlabel = "uptime in seconds"
+elif kind == "busyservers":
+ graph_title = "Busy Servers"
+ graph_type = "GAUGE"
+ graph_vlabel = "amount of busyservers"
+
+
+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 Lighttpd Stats - " + graph_title
+ print 'graph_vlabel ' + graph_vlabel
+ print 'graph_category lighttpd'
+ print kind+'.type ' + graph_type
+
+ print 'graph_args --base 1000'
+else:
+ import urllib2
+ f = urllib2.urlopen('http://127.0.0.1/server-status?auto')
+ content = f.read()
+ f.close()
+ for temp in content.lower().splitlines():
+ temp = temp.replace(" ", "_")
+ temp = temp.replace(":_", ".value ")
+ if temp.find(kind) >= 0:
+ print temp