mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
Plugin approx: migrate to Python3, format documentation
This commit is contained in:
parent
4387edfa8c
commit
e7e8ff9916
1 changed files with 30 additions and 21 deletions
|
@ -1,23 +1,32 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python3
|
||||||
#
|
"""
|
||||||
# vim:syntax=python
|
=head1 NAME
|
||||||
#
|
|
||||||
# Plugin to monitor the amount of packages in an approx cache.
|
approx - monitor the amount of packages in an approx cache
|
||||||
#
|
|
||||||
# Usage: place in /etc/munin/plugins/ (or link it there using ln -s)
|
|
||||||
#
|
=head1 CONFIGURATION
|
||||||
# Parameters understood:
|
|
||||||
#
|
Usage: place in /etc/munin/plugins/ (or link it there using ln -s)
|
||||||
# config (required)
|
|
||||||
# autoconf (optional - used by munin-config)
|
Parameters understood:
|
||||||
#
|
|
||||||
# Magic markers - optional - used by installation scripts and
|
config (required)
|
||||||
# munin-config:
|
autoconf (optional - used by munin-config)
|
||||||
#
|
|
||||||
# #%# family=manual
|
|
||||||
# #%# capabilities=autoconf
|
=head1 AUTHORS
|
||||||
#
|
|
||||||
# Now for the real work...
|
Copyright 2008 Morten Siebuhr <unknown@munin-monitoring.org>
|
||||||
|
|
||||||
|
|
||||||
|
=head1 MAGIC MARKERS
|
||||||
|
|
||||||
|
#%# family=manual
|
||||||
|
#%# capabilities=autoconf
|
||||||
|
|
||||||
|
=cut
|
||||||
|
"""
|
||||||
|
|
||||||
from os.path import walk, exists, isfile, join
|
from os.path import walk, exists, isfile, join
|
||||||
from sys import argv, exit
|
from sys import argv, exit
|
||||||
|
@ -58,7 +67,7 @@ if len(argv) > 1:
|
||||||
print("%s.label %s" % (filetype.lower(), filetype))
|
print("%s.label %s" % (filetype.lower(), filetype))
|
||||||
exit()
|
exit()
|
||||||
|
|
||||||
for filetype, count in get_file_types().iteritems():
|
for filetype, count in get_file_types().items():
|
||||||
print("%s.value %d" % (filetype.lower(), count))
|
print("%s.value %d" % (filetype.lower(), count))
|
||||||
|
|
||||||
exit()
|
exit()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue