1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-22 14:16:00 +00:00

Plugin lighttpd_: fix code style issues reported by flake8

This commit is contained in:
Lars Kruse 2019-08-14 00:42:45 +02:00
parent 8b24b64960
commit 5b8adb5844
2 changed files with 75 additions and 49 deletions

View file

@ -1,30 +1,56 @@
#!/usr/bin/env python #!/usr/bin/env python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# vim: set fileencoding=utf-8 # vim: set fileencoding=utf-8
# """
# Munin plugin to monitor lighttpd web-server.
# =head1 NAME
# Copyright Igor Borodikhin
# Munin plugin to monitor lighttpd web-server.
# License : GPLv3
#
# Configuration parameters: =head1 CONFIGURATION
# 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) Configuration parameters:
# 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'. [lighttpd_]
# env.status_url - url of lighty's server-status
# Note: If HTTP authentication is required you should specify both username and password. (optional, default is http://127.0.0.1/server-status)
# env.username - username to provide if status_url requires authentication
# ## Installation (optional, default - no authentication)
# Copy file to directory /usr/share/munin/plugins/ env.password - password to provide if status_url requires authentication
# Because this plugin has suggest capability the last step is to run (optional, default - no authentication)
# # munin-node-configure --suggest --shell | sh -x 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 #%# family=contrib
#%# capabilities=autoconf suggest #%# capabilities=autoconf suggest
"""
import os
import sys
import urllib2
import os, sys, urllib2
program = sys.argv[0] program = sys.argv[0]
graph_type = program[program.rfind("_")+1:] graph_type = program[program.rfind("_")+1:]
@ -63,6 +89,7 @@ graph_types = {
] ]
} }
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":
@ -98,7 +125,7 @@ else:
try: try:
(title, value) = line.split(": ") (title, value) = line.split(": ")
data[title] = value data[title] = value
except Exception: except ValueError:
pass pass
if graph_type == "accesses": if graph_type == "accesses":

View file

@ -175,7 +175,6 @@ plugins/libvirt/kvm_io
plugins/libvirt/kvm_mem plugins/libvirt/kvm_mem
plugins/libvirt/kvm_net plugins/libvirt/kvm_net
plugins/libvirt/munin-libvirtpy plugins/libvirt/munin-libvirtpy
plugins/lighttpd/lighttpd_
plugins/logins/logins plugins/logins/logins
plugins/logs/service_events plugins/logs/service_events
plugins/lxc/lxc_cpu plugins/lxc/lxc_cpu