mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 02:51:03 +00:00
Plugin lighttpd_: fix code style issues reported by flake8
This commit is contained in:
parent
8b24b64960
commit
5b8adb5844
2 changed files with 75 additions and 49 deletions
|
@ -1,30 +1,56 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: set fileencoding=utf-8
|
||||
#
|
||||
# Munin plugin to monitor lighttpd web-server.
|
||||
#
|
||||
# Copyright Igor Borodikhin
|
||||
#
|
||||
# License : GPLv3
|
||||
#
|
||||
# Configuration parameters:
|
||||
# env.status_url - url of lighty's server-status (optional, default is http://127.0.0.1/server-status)
|
||||
# env.username - username to provide if status_url requires authentication (optional, default - no authentication)
|
||||
# env.password - password to provide if status_url requires authentication (optional, default - no authentication)
|
||||
# env.auth_type - the authentication mechanism to use -- either 'basic' (default) or 'digest'.
|
||||
#
|
||||
# Note: If HTTP authentication is required you should specify both username and password.
|
||||
#
|
||||
# ## Installation
|
||||
# Copy file to directory /usr/share/munin/plugins/
|
||||
# Because this plugin has suggest capability the last step is to run
|
||||
# # munin-node-configure --suggest --shell | sh -x
|
||||
#
|
||||
"""
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Munin plugin to monitor lighttpd web-server.
|
||||
|
||||
|
||||
=head1 CONFIGURATION
|
||||
|
||||
Configuration parameters:
|
||||
|
||||
[lighttpd_]
|
||||
env.status_url - url of lighty's server-status
|
||||
(optional, default is http://127.0.0.1/server-status)
|
||||
env.username - username to provide if status_url requires authentication
|
||||
(optional, default - no authentication)
|
||||
env.password - password to provide if status_url requires authentication
|
||||
(optional, default - no authentication)
|
||||
env.auth_type - the authentication mechanism to use -- either 'basic' (default) or 'digest'.
|
||||
|
||||
Note: If HTTP authentication is required you should specify both username and password.
|
||||
|
||||
|
||||
=head1 INSTALLTION
|
||||
|
||||
Copy file to directory /usr/share/munin/plugins/
|
||||
Because this plugin has "suggest" capability the last step is to run
|
||||
|
||||
munin-node-configure --suggest --shell | sh -x
|
||||
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Copyright Igor Borodikhin
|
||||
|
||||
|
||||
=head1 LICENSE
|
||||
|
||||
GPLv3
|
||||
|
||||
|
||||
=head1 MAGIC MARKERS
|
||||
#%# family=contrib
|
||||
#%# capabilities=autoconf suggest
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
import urllib2
|
||||
|
||||
import os, sys, urllib2
|
||||
|
||||
program = sys.argv[0]
|
||||
graph_type = program[program.rfind("_")+1:]
|
||||
|
@ -63,6 +89,7 @@ graph_types = {
|
|||
]
|
||||
}
|
||||
|
||||
|
||||
if len(sys.argv) == 2 and sys.argv[1] == "autoconf":
|
||||
print "yes"
|
||||
elif len(sys.argv) == 2 and sys.argv[1] == "config":
|
||||
|
@ -98,7 +125,7 @@ else:
|
|||
try:
|
||||
(title, value) = line.split(": ")
|
||||
data[title] = value
|
||||
except Exception:
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
if graph_type == "accesses":
|
||||
|
|
|
@ -175,7 +175,6 @@ plugins/libvirt/kvm_io
|
|||
plugins/libvirt/kvm_mem
|
||||
plugins/libvirt/kvm_net
|
||||
plugins/libvirt/munin-libvirtpy
|
||||
plugins/lighttpd/lighttpd_
|
||||
plugins/logins/logins
|
||||
plugins/logs/service_events
|
||||
plugins/lxc/lxc_cpu
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue