rtucker / munin-lighttpd Goto Github PK
View Code? Open in Web Editor NEWA Munin plugin to monitor lighttpd statistics
License: MIT License
A Munin plugin to monitor lighttpd statistics
License: MIT License
Munin plugin to monitor lighttpd statistics Ryan Tucker <[email protected]>, 2009/07/12 To use: SCRIPT=/path_to_this_script ln -s $SCRIPT /etc/munin/plugins/lighttpd_accesses ln -s $SCRIPT /etc/munin/plugins/lighttpd_busyservers ln -s $SCRIPT /etc/munin/plugins/lighttpd_idleservers ln -s $SCRIPT /etc/munin/plugins/lighttpd_kbytes ln -s $SCRIPT /etc/munin/plugins/lighttpd_uptime Also ensure that lighttpd has mod_status enabled and that your status.status-url is set appropriately. You can optionally configure this plugin in your munin-node configuration: [lighttpd_*] # statusurl: set a different URL for lighttpd status env.statusurl http://ip/other_status?auto # auth_type: use basic or digest authentication via urllib2 env.auth_type basic|digest # auth_realm, auth_user, and auth_password are passed to urllib2's # auth handler verbatim env.auth_realm env.auth_user env.auth_password
What about renaming the script to end it's name with an underscore as many other munin plugins do to indicate that they expect a parameter given? It's just a convention but a useful one I think.
A README file would be beneficial.
Would it be possible to add support for graphing load, requests, requests_failed and backlogged from /server-counters?
proxy-core.0.backends."unix:/var/run/chowder/defender.sock".load: 0
proxy-core.0.backends."unix:/var/run/chowder/defender.sock".pool_size: 0
proxy-core.0.backends."unix:/var/run/chowder/defender.sock".requests: 352
proxy-core.0.backends."unix:/var/run/chowder/defender.sock".requests_failed: 0
proxy-core.0.backlogged: 0
proxy-core.1.backends."unix:/var/run/chowder/cinemobile.sock".load: 0
proxy-core.1.backends."unix:/var/run/chowder/cinemobile.sock".pool_size: 0
proxy-core.1.backends."unix:/var/run/chowder/cinemobile.sock".requests: 3
proxy-core.1.backends."unix:/var/run/chowder/cinemobile.sock".requests_failed: 0
proxy-core.1.backlogged: 0
proxy-core.requests: 355
If I have some time over the weekend I might be able to look at implementing it myself but I'm not too familiar with python.
STATUS_URL = os.environ.get('statusurl', 'http://127.0.0.1/server-status?auto')
So that you can change in your munin config file
[lighttpd_*]
env.statusurl http://ip/other_status
Ref:
http://redmine.lighttpd.net/projects/lighttpd-sandbox/wiki/Howto_Munin
2012/10/13-07:20:04 [945] Service 'lighttpd_idleservers' exited with status 1/0.
2012/10/13-07:20:04 [945] Error output from lighttpd_kbytes:
2012/10/13-07:20:04 [945] Traceback (most recent call last):
2012/10/13-07:20:04 [945] File "/etc/munin/plugins/lighttpd_kbytes", line 111, in
2012/10/13-07:20:04 [945] print_status(param, STATUS_URL)
2012/10/13-07:20:04 [945] File "/etc/munin/plugins/lighttpd_kbytes", line 70, in print_status
2012/10/13-07:20:04 [945] key, value = i.split(':')
2012/10/13-07:20:04 [945] ValueError: need more than 1 value to unpack
2012/10/13-07:20:04 [945] Service 'lighttpd_kbytes' exited with status 1/0.
This happens on all of them although for lighttpd_uptime:
2012/10/13-07:20:04 [945] Service 'lighttpd_uptime' exited with status 1/0.
2012/10/13-07:20:05 [945] Error output from memory_by_process:
2012/10/13-07:20:05 [945] Can't open perl script "
2012/10/13-07:20:05 [945] $junk = <>;
2012/10/13-07:20:05 [945] while (<>)
2012/10/13-07:20:05 [945] {
2012/10/13-07:20:05 [945] @A = split;
2012/10/13-07:20:05 [945] $proc = $a[10];
2012/10/13-07:20:05 [945] $proc =~ s|./||;
2012/10/13-07:20:05 [945] $proc =~ s/:.//;
2012/10/13-07:20:05 [945] $proc =~ tr/[]//d;
2012/10/13-07:20:05 [945] $proc =~ tr/A-Za-z0-9//c;
2012/10/13-07:20:05 [945] $vsz = $a[4];
2012/10/13-07:20:05 [945] $total{$proc} += $vsz;
2012/10/13-07:20:05 [945] }
2012/10/13-07:20:05 [945] my $stack = 0;
2012/10/13-07:20:05 [945] sub draw() { return $stack++ ? "STACK" : "AREA" }
2012/10/13-07:20:05 [945] print map
2012/10/13-07:20:05 [945] {
2012/10/13-07:20:05 [945] "$.label $\n" .
2012/10/13-07:20:05 [945] "$.min 0\n" .
2012/10/13-07:20:05 [945] "$.draw " . draw() . "\n" .
2012/10/13-07:20:05 [945] "$.cdef $_,1024,*\n"
2012/10/13-07:20:05 [945] }
2012/10/13-07:20:05 [945] sort keys %total;
2012/10/13-07:20:05 [945] ": No such file or directory
I'm not sure why this is happening; any clues?
On FreeBSD 9.0-RELEASE with munin 1.4.7 I can successfully execute lighttpd_ from the command line:
python lighttpd_kbytes
data.value 56964
However no graphs are being generated and when I try it via telnet I encounter the following:
telnet localhost 4949
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
# munin node at xsgames01-dev
fetch lighttpd_kbytes
# Bad exit
.
From /var/log/munin/munin-node.log:
2012/09/04-15:04:22 CONNECT TCP Peer: "[127.0.0.1]:14975" Local: "[127.0.0.1]:4949"
Use of uninitialized value in pattern match (m//) at /usr/local/lib/perl5/site_perl/5.16.0/Net/Server.pm line 600.
2012/09/04-15:04:28 [20268] Error output from lighttpd_kbytes:
2012/09/04-15:04:28 [20268] Can't exec "/usr/local/etc/munin/plugins/lighttpd_kbytes": No such file or directory at /usr/local/lib/perl5/site_perl/5.16.0/Munin/Node/Service.pm line 215, <STDIN> line 1.
2012/09/04-15:04:28 [20268] # ERROR: Failed to exec.
2012/09/04-15:04:28 [20268] Service 'lighttpd_kbytes' exited with status 42/0.
The odd part is this occurs on two machines which are identical (production and development) but I have a 2nd set of machines with the same services and version of FreeBSD running that does not have this issue.
/usr/local/etc/munin/plugins:
lrwxr-xr-x 1 0 0 40 Sep 4 14:03 lighttpd_accesses -> /usr/local/share/munin/plugins/lighttpd_
lrwxr-xr-x 1 0 0 40 Sep 4 14:03 lighttpd_busyservers -> /usr/local/share/munin/plugins/lighttpd_
lrwxr-xr-x 1 0 0 40 Sep 4 14:03 lighttpd_idleservers -> /usr/local/share/munin/plugins/lighttpd_
lrwxr-xr-x 1 0 0 40 Sep 4 14:03 lighttpd_kbytes -> /usr/local/share/munin/plugins/lighttpd_
lrwxr-xr-x 1 0 0 40 Sep 4 14:03 lighttpd_uptime -> /usr/local/share/munin/plugins/lighttpd_
/usr/local/share/munin/plugins:
-rwxr-xr-x 1 0 0 4127 Sep 4 14:03 /usr/local/share/munin/plugins/lighttpd_
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.