From c6f88968d1a44c463aaeb9af77aba70cad860e7c Mon Sep 17 00:00:00 2001 From: Lars Kruse Date: Tue, 6 Oct 2020 00:29:38 +0200 Subject: [PATCH] Improve perlpod formatting for multiple plugins Escpecially the final marker ("=cut") was missing in these plugins. --- plugins/change.org/changeorg_signature_count | 20 +++++++----- plugins/docker/docker_ | 12 ++++--- plugins/git/gitlab_statistics | 20 +++++------- plugins/http/vhost_requests_ | 7 ++--- plugins/lighttpd/lighttpd_ | 7 ++++- plugins/luftdaten/feinstaubsensor | 29 ++++++++++++----- plugins/mongodb/mongo_btree | 12 ++++--- plugins/mongodb/mongo_conn | 12 ++++--- plugins/mongodb/mongo_lag | 33 +++++++++++--------- plugins/mongodb/mongo_lock | 12 ++++--- plugins/mongodb/mongo_mem | 19 ++++++----- plugins/mongodb/mongo_ops | 19 ++++++----- plugins/mongodb/mongodb_conn | 29 ++++++++++------- plugins/mongodb/mongodb_docs | 19 ++++++----- plugins/mysql/mysql_audit | 22 ++++++------- plugins/mysql/mysql_disk_by_prefix | 17 ++++------ plugins/puppet/puppetdb | 1 + plugins/solr/solr4_ | 21 +++++++------ plugins/systemd/timesync_status | 6 +++- plugins/znc/znc_logs.py | 23 +++++++++----- 20 files changed, 198 insertions(+), 142 deletions(-) diff --git a/plugins/change.org/changeorg_signature_count b/plugins/change.org/changeorg_signature_count index 775c8af7..7c5d3a2a 100755 --- a/plugins/change.org/changeorg_signature_count +++ b/plugins/change.org/changeorg_signature_count @@ -7,24 +7,28 @@ You need a valid API key for this petition =head2 CONFIGURATION -# Sample: -[changeorg_signature_count] - env.APIkey xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx - env.petitions 1727001 1727053 +Example: + + [changeorg_signature_count] + env.APIkey xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + env.petitions 1727001 1727053 =head1 AUTHOR (c) 2017 Raphaƫl Droz -General Public Licence v3 or later =head1 LICENSE -GPLv3 +General Public Licence v3 or later + +SPDX-License-Identifier: GPL-3.0-or-later =head1 MAGIC MARKERS -#%# family=auto -#%# capabilities=autoconf + #%# family=auto + #%# capabilities=autoconf + +=cut ''' from sys import argv, exit diff --git a/plugins/docker/docker_ b/plugins/docker/docker_ index 18328f04..54a8bf80 100755 --- a/plugins/docker/docker_ +++ b/plugins/docker/docker_ @@ -44,7 +44,7 @@ which if matched will exclude the matching containers from the memory and cpu gr For example -env.EXCLUDE_CONTAINER_NAME runner + env.EXCLUDE_CONTAINER_NAME runner Would exclude all containers with the word "runner" in the name. @@ -63,15 +63,17 @@ Would exclude all containers with the word "runner" in the name. This section has been reverse-engineered from git logs * Codimp : original rewrite + * Rowan Wookey : performance improvement -* Olivier Mehani : Network support, ClientWrapper, gerenal - cleanup + +* Olivier Mehani : Network support, ClientWrapper, gerenal cleanup =head1 MAGIC MARKERS -#%# family=auto -#%# capabilities=autoconf suggest + #%# family=auto + #%# capabilities=autoconf suggest +=cut """ import os diff --git a/plugins/git/gitlab_statistics b/plugins/git/gitlab_statistics index 7a76bf97..aca76388 100755 --- a/plugins/git/gitlab_statistics +++ b/plugins/git/gitlab_statistics @@ -8,7 +8,7 @@ Plugin to monitor Gitlab status =head1 INSTALLATION -Usage: Place in /etc/munin/plugins/ (or link it there using ln -s) +Place in /etc/munin/plugins/ (or link it there using ln -s) =head1 CONFIGURATION @@ -23,23 +23,17 @@ Add this to your /etc/munin/plugin-conf.d/munin-node: =back -=head1 HISTORY +=head1 AUTHORS -2019-10-02: v 1.0 pcy : created - -=head1 USAGE - -Parameters understood: - - config (required) - autoconf (optional - used by munin-config) +Copyright (C) 2019 pcy =head1 MAGIC MARKERS -#%# family=auto -#%# capabilities=autoconf -""" + #%# family=auto + #%# capabilities=autoconf +=cut +""" import os import json diff --git a/plugins/http/vhost_requests_ b/plugins/http/vhost_requests_ index 328b4885..9eef9d58 100755 --- a/plugins/http/vhost_requests_ +++ b/plugins/http/vhost_requests_ @@ -5,8 +5,7 @@ =head1 NAME -vhost_requests_ - Wildcard-plugin to monitor http requests by response status code -to a particular virtual host. +vhost_requests_ - Wildcard-plugin to monitor http requests by response status code to a particular virtual host. =head1 CONFIGURATION @@ -34,13 +33,13 @@ on a particular virtual host, link vhost_requests_ E.g. -# ln -s /usr/share/munin/plugins/vhost_requests_ \ - /etc/munin/plugins/vhost_requests_host.org-access_log + ln -s /usr/share/munin/plugins/vhost_requests_ /etc/munin/plugins/vhost_requests_host.org-access_log =head1 AUTHOR Roberto Rodriguez +=cut END # This is the format that date will use to generate access_log like entries diff --git a/plugins/lighttpd/lighttpd_ b/plugins/lighttpd/lighttpd_ index 98863983..f3066eaf 100755 --- a/plugins/lighttpd/lighttpd_ +++ b/plugins/lighttpd/lighttpd_ @@ -39,12 +39,17 @@ Copyright Igor Borodikhin =head1 LICENSE -GPLv3 +GNU General Public License v3.0 only + +SPDX-License-Identifier: GPL-3.0-only =head1 MAGIC MARKERS + #%# family=contrib #%# capabilities=autoconf suggest + +=cut """ import os diff --git a/plugins/luftdaten/feinstaubsensor b/plugins/luftdaten/feinstaubsensor index e9732bfb..188af4b7 100755 --- a/plugins/luftdaten/feinstaubsensor +++ b/plugins/luftdaten/feinstaubsensor @@ -28,28 +28,41 @@ A may be an IPv4 address, an IPv6 address (enclosed in square brackets) o resolved via DNS. Examples for : - * 192.168.1.4 - * foo=192.168.1.4 - * [fe80::1a:2b:3c:cafe] - * bar=[fe80::1a:2b:3c:cafe] - * feinstaubsensor-12345.local - * baz=feinstaubsensor-12345.local + +=over 4 + +=item 192.168.1.4 + +=item foo=192.168.1.4 + +=item [fe80::1a:2b:3c:cafe] + +=item bar=[fe80::1a:2b:3c:cafe] + +=item feinstaubsensor-12345.local + +=item baz=feinstaubsensor-12345.local + +=back =head1 AUTHOR - Lars Kruse +Lars Kruse =head1 LICENSE - GPLv3 +GNU General Public License v3.0 or later + +SPDX-License-Identifier: GPL-3.0-or-later =head1 MAGIC MARKERS #%# family=manual +=cut """ import collections diff --git a/plugins/mongodb/mongo_btree b/plugins/mongodb/mongo_btree index ea27faaa..d2e5f4d4 100755 --- a/plugins/mongodb/mongo_btree +++ b/plugins/mongodb/mongo_btree @@ -1,11 +1,12 @@ #!/usr/bin/env python """ =head1 NAME - MongoDB btree Plugin + +mongo_btree - MongoDB btree Plugin =head1 APPLICABLE SYSTEMS - Works until MongoDB 2.7. The "indexCounters" field was removed in 2.8 version. +Works until MongoDB 2.7. The "indexCounters" field was removed in 2.8 version. =head1 CONFIGURATION @@ -14,8 +15,11 @@ =head1 AUTHOR - Original script there : https://github.com/comerford/mongo-munin - Doc added by Alban Espie-Guillon +Original script there : https://github.com/comerford/mongo-munin + +Doc added by Alban Espie-Guillon + +=cut """ import urllib2 diff --git a/plugins/mongodb/mongo_conn b/plugins/mongodb/mongo_conn index 727c2cda..3f7dc39c 100755 --- a/plugins/mongodb/mongo_conn +++ b/plugins/mongodb/mongo_conn @@ -1,11 +1,12 @@ #!/usr/bin/env python """ =head1 NAME - MongoDB connections Plugin + +mongo_conn - MongoDB connections Plugin =head1 APPLICABLE SYSTEMS - Works until MongoDB 3.6. The httpinterface was later removed. +Works until MongoDB 3.6. The httpinterface was later removed. =head1 CONFIGURATION @@ -14,8 +15,11 @@ =head1 AUTHOR - Original script there : https://github.com/comerford/mongo-munin - Doc added by Alban Espie-Guillon +Original script there : https://github.com/comerford/mongo-munin + +Doc added by Alban Espie-Guillon + +=cut """ import urllib2 diff --git a/plugins/mongodb/mongo_lag b/plugins/mongodb/mongo_lag index d07667eb..b494e4bc 100755 --- a/plugins/mongodb/mongo_lag +++ b/plugins/mongodb/mongo_lag @@ -1,20 +1,18 @@ #!/usr/bin/env python3 """ =head1 NAME - MongoDB Replication Lag - Connects to a single mongo instance and retrieve - replication lag for all connected members. +mongo_lag - MongoDB Replication Lag + +Connects to a single mongo instance and retrieve replication lag for all connected members. =head1 APPLICABLE SYSTEMS - MongoDB 3.X and 4.X with pymongo installed. +MongoDB 3.X and 4.X with pymongo installed. =head1 CONFIGURATION - munin-node.conf - defaults for host is 127.0.0.1 and port 27017 - and will work without being defined : +Default for host is 127.0.0.1 and port 27017 and will work without being defined: [mongo_lag] env.host 127.0.0.1 @@ -24,16 +22,23 @@ =head1 AUTHOR - Stefan Andersen - Updated by Alban Espie-Guillon +Stefan Andersen + +Updated by Alban Espie-Guillon =head1 LICENSE - The Beer Ware License (Revision 42) - wrote this file. As long - as you retain this notice you can do whatever you want - with this stuff. If we meet some day, and you think - this stuff is worth it, you can buy me a beer in return. + +The Beer Ware License (Revision 42) + wrote this file. As long +as you retain this notice you can do whatever you want +with this stuff. If we meet some day, and you think +this stuff is worth it, you can buy me a beer in return. + +SPDX-License-Identifier: Beerware + +=cut """ + import os import sys import pymongo diff --git a/plugins/mongodb/mongo_lock b/plugins/mongodb/mongo_lock index 9bd84791..c60409a0 100755 --- a/plugins/mongodb/mongo_lock +++ b/plugins/mongodb/mongo_lock @@ -1,11 +1,12 @@ #!/usr/bin/env python """ =head1 NAME - MongoDB lock Plugin + +mongo_lock - MongoDB lock Plugin =head1 APPLICABLE SYSTEMS - MongoDB 2.X. The "lockTime" field was removed in later versions. +MongoDB 2.X. The "lockTime" field was removed in later versions. =head1 CONFIGURATION @@ -14,8 +15,11 @@ =head1 AUTHOR - Original script there : https://github.com/comerford/mongo-munin - Doc added by Alban Espie-Guillon +Original script there : https://github.com/comerford/mongo-munin + +Doc added by Alban Espie-Guillon + +=cut """ import urllib2 diff --git a/plugins/mongodb/mongo_mem b/plugins/mongodb/mongo_mem index 672a89c2..61ea238e 100755 --- a/plugins/mongodb/mongo_mem +++ b/plugins/mongodb/mongo_mem @@ -1,17 +1,16 @@ #!/usr/bin/env python3 """ =head1 NAME - MongoDB mem Plugin + +mongo_mem - MongoDB memory Plugin =head1 APPLICABLE SYSTEMS - MongoDB 3.X and 4.X with pymongo installed. +MongoDB 3.X and 4.X with pymongo installed. =head1 CONFIGURATION - munin-node.conf - defaults for host is 127.0.0.1 and port 27017 - and will work without being defined : +Default for host is 127.0.0.1 and port 27017 and will work without being defined: [mongo_mem] env.host 127.0.0.1 @@ -20,16 +19,20 @@ env.password P@55w0rd env.db dbname - or +or [mongodb_mem] env.MONGO_DB_URI mongodb://user:password@host:port/dbname =head1 AUTHOR - Original script there : https://github.com/comerford/mongo-munin - Updated by Alban Espie-Guillon +Original script there : https://github.com/comerford/mongo-munin + +Updated by Alban Espie-Guillon + +=cut """ + import sys import os import pymongo diff --git a/plugins/mongodb/mongo_ops b/plugins/mongodb/mongo_ops index 1247fa60..99500bfe 100755 --- a/plugins/mongodb/mongo_ops +++ b/plugins/mongodb/mongo_ops @@ -1,17 +1,16 @@ #!/usr/bin/env python3 """ =head1 NAME - MongoDB ops Plugin + +mongo_ops - MongoDB ops Plugin =head1 APPLICABLE SYSTEMS - MongoDB 3.X and 4.X with pymongo installed. +MongoDB 3.X and 4.X with pymongo installed. =head1 CONFIGURATION - munin-node.conf - defaults for host is 127.0.0.1 and port 27017 - and will work without being defined : +Default for host is 127.0.0.1 and port 27017 and will work without being defined: [mongodb_ops] env.host 127.0.0.1 @@ -20,16 +19,20 @@ env.password P@55w0rd env.db dbname - or +or [mongodb_ops] env.MONGO_DB_URI mongodb://user:password@host:port/dbname =head1 AUTHOR - Original script there : https://github.com/comerford/mongo-munin - Updated by Alban Espie-Guillon +Original script there : https://github.com/comerford/mongo-munin + +Updated by Alban Espie-Guillon + +=cut """ + import sys import os import pymongo diff --git a/plugins/mongodb/mongodb_conn b/plugins/mongodb/mongodb_conn index f0643adf..9f587ecc 100755 --- a/plugins/mongodb/mongodb_conn +++ b/plugins/mongodb/mongodb_conn @@ -1,17 +1,16 @@ #!/usr/bin/env python3 """ =head1 NAME - MongoDB Connection Count Plugin + +mongodb_conn - MongoDB Connection Count Plugin =head1 APPLICABLE SYSTEMS - MongoDB 3.X and 4.X with pymongo installed. +MongoDB 3.X and 4.X with pymongo installed. =head1 CONFIGURATION - munin-node.conf - defaults for host is 127.0.0.1 and port 27017 - and will work without being defined : +Default for host is 127.0.0.1 and port 27017 and will work without being defined: [mongodb_conn] env.host 127.0.0.1 @@ -21,16 +20,22 @@ =head1 AUTHOR - Alban Espie-Guillon - based on Stefan Andersen work. +Alban Espie-Guillon + +based on Stefan Andersen work. =head1 LICENSE - The Beer Ware License (Revision 42) - wrote this file. As long - as you retain this notice you can do whatever you want - with this stuff. If we meet some day, and you think - this stuff is worth it, you can buy me a beer in return. +The Beer Ware License (Revision 42) + wrote this file. As long +as you retain this notice you can do whatever you want +with this stuff. If we meet some day, and you think +this stuff is worth it, you can buy me a beer in return. + +SPDX-License-Identifier: Beerware + +=cut """ + import os import sys import pymongo diff --git a/plugins/mongodb/mongodb_docs b/plugins/mongodb/mongodb_docs index 43541055..02ce0b2b 100755 --- a/plugins/mongodb/mongodb_docs +++ b/plugins/mongodb/mongodb_docs @@ -1,17 +1,16 @@ #!/usr/bin/env python3 """ =head1 NAME - MongoDB docs Plugin + +mongodb_docs - MongoDB docs Plugin =head1 APPLICABLE SYSTEMS - MongoDB 3.X and 4.X with pymongo installed. +MongoDB 3.X and 4.X with pymongo installed. =head1 CONFIGURATION - munin-node.conf - defaults for host is 127.0.0.1 and port 27017 - and will work without being defined : +Default for host is 127.0.0.1 and port 27017 and will work without being defined: [mongodb_docs] env.host 127.0.0.1 @@ -20,16 +19,20 @@ env.password P@55w0rd env.db dbname - or +or [mongodb_docs] env.MONGO_DB_URI mongodb://user:password@host:port/dbname =head1 AUTHOR - Original script there : https://github.com/comerford/mongo-munin - Updated by Alban Espie-Guillon +Original script there : https://github.com/comerford/mongo-munin + +Updated by Alban Espie-Guillon + +=cut """ + import sys import os import pymongo diff --git a/plugins/mysql/mysql_audit b/plugins/mysql/mysql_audit index fb68af82..fc2c689e 100755 --- a/plugins/mysql/mysql_audit +++ b/plugins/mysql/mysql_audit @@ -2,9 +2,9 @@ # -*- python -*- """ -=head1 INTRODUCTION +=head1 NAME -Plugin to monitor the MySQL audit log connection count +mysql_audit - Plugin to monitor the MySQL audit log connection count =head1 APPLICABLE SYSTEMS @@ -41,22 +41,18 @@ Add this to your /etc/munin/plugin-conf.d/munin-node: =back -=head1 HISTORY +=head1 AUTHORS -2017-11-03: v 1.0 Bert Van de Poel : created -2020-07-19: v 1.1 pcy : added config options +Copyright (C) 2017 Bert Van de Poel -=head1 USAGE - -Parameters understood: - - config (required) - autoconf (optional - used by munin-config) +Copyright (C) 2019 pcy =head1 MAGIC MARKERS -#%# family=auto -#%# capabilities=autoconf + #%# family=auto + #%# capabilities=autoconf + +=cut """ diff --git a/plugins/mysql/mysql_disk_by_prefix b/plugins/mysql/mysql_disk_by_prefix index 517164d5..0a0a112a 100755 --- a/plugins/mysql/mysql_disk_by_prefix +++ b/plugins/mysql/mysql_disk_by_prefix @@ -32,21 +32,16 @@ Add this to your /etc/munin/plugin-conf.d/munin-node: =back -=head1 HISTORY +=head1 AUTHORS -2019-07-25: v 1.0 pcy : created - -=head1 USAGE - -Parameters understood: - - config (required) - autoconf (optional - used by munin-config) +Copyright (C) 2019 pcy =head1 MAGIC MARKERS -#%# family=auto -#%# capabilities=autoconf + #%# family=auto + #%# capabilities=autoconf + +=cut """ diff --git a/plugins/puppet/puppetdb b/plugins/puppet/puppetdb index a4d55aa4..66c7819b 100755 --- a/plugins/puppet/puppetdb +++ b/plugins/puppet/puppetdb @@ -65,6 +65,7 @@ Copyright (c) 2020, Gabriel Filion, gabster@lelutin.ca This code is licensed under GPLv3+ +=cut """ import os diff --git a/plugins/solr/solr4_ b/plugins/solr/solr4_ index b41c3741..be729b14 100755 --- a/plugins/solr/solr4_ +++ b/plugins/solr/solr4_ @@ -2,25 +2,27 @@ """ =head1 NAME -Solr 4.* munin graph plugin +solr4_ - Solr 4.* munin graph plugin =head1 CONFIGURATION Plugin configuration parameters: -[solr_*] - env.host_port - env.url - env.qpshandler_ + [solr_*] + env.host_port + env.url + env.qpshandler_ Example: -[solr_*] - env.host_port solrhost:8080 - env.url /solr - env.qpshandler_select /select + + [solr_*] + env.host_port solrhost:8080 + env.url /solr + env.qpshandler_select /select Install plugins: + ln -s /usr/share/munin/plugins/solr_.py /etc/munin/plugins/solr_numdocs_core_1 ln -s /usr/share/munin/plugins/solr_.py /etc/munin/plugins/solr_requesttimes_select ln -s /usr/share/munin/plugins/solr_.py /etc/munin/plugins/solr_qps @@ -56,6 +58,7 @@ DEALINGS IN THE SOFTWARE. Project repo: https://github.com/averni/munin-solr +=cut """ diff --git a/plugins/systemd/timesync_status b/plugins/systemd/timesync_status index 0b200c60..e46f67de 100755 --- a/plugins/systemd/timesync_status +++ b/plugins/systemd/timesync_status @@ -44,7 +44,11 @@ Bert Peters =head1 LICENSE -GPLv2 +GNU General Public License v2.0 only + +SPDX-License-Identifier: LGPL-2.0-only + +=cut ''' diff --git a/plugins/znc/znc_logs.py b/plugins/znc/znc_logs.py index 75a9671b..e8fb73e6 100755 --- a/plugins/znc/znc_logs.py +++ b/plugins/znc/znc_logs.py @@ -2,24 +2,33 @@ # -*- coding: utf-8 -*- ''' =head1 NAME + znc_logs =head1 DESCRIPTION + Shows lines/minute in today's znc-logs =head2 CONFIGURATION -[znc_logs] -user znc # or any other user/group that can read the znclog-folder -group znc -env.logdir /var/lib/znc/moddata/log/ # path to the GLOBAL log-folder with a "/" at the end -env.expire 0 # Keep channel names forever - OR - -env.expire 1 # Forget channel names from last run + + [znc_logs] + user znc # or any other user/group that can read the znclog-folder + group znc + env.logdir /var/lib/znc/moddata/log/ # path to the GLOBAL log-folder with a "/" at the end + env.expire 0 # Keep channel names forever - OR - + env.expire 1 # Forget channel names from last run =head1 COPYRIGHT -GPL VERSION 3 + +GNU General Public License v3.0 only + +SPDX-License-Identifier: GPL-3.0-only =head1 AUTHOR + Thor77 + +=cut ''' import json import os, sys, time