Giter Site home page Giter Site logo

munin-lighttpd's Introduction

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

munin-lighttpd's People

Contributors

jolexa avatar statico avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

munin-lighttpd's Issues

lighttpd_ instead of lighttpd

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.

Graphing /server-counters

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.

plugins work when run from the command-line but fail through 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?

bad exit from telnet but successful via command line

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_

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.