From fafb0d9bd6697ec76fd9cdb9012ea1e7c8a6a346 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Sun, 12 Jun 2022 21:46:38 +0200 Subject: [PATCH 1/4] Fix formatting for kernel_same_page_merging-Plugin --- plugins/system/kernel_same_page_merging | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/plugins/system/kernel_same_page_merging b/plugins/system/kernel_same_page_merging index bf14026f..8a24ae9b 100755 --- a/plugins/system/kernel_same_page_merging +++ b/plugins/system/kernel_same_page_merging @@ -3,27 +3,28 @@ : << EOF =head1 NAME + kernel_same_page_merging - Outputs various metrics about same page merging. =head1 AUTHOR -=over 4 -=item * Michael Grote -=back + +Michael Grote =head1 LICENSE + GPLv3 or later SPDX-License-Identifier: GPL-3.0-or-later =head1 MAGIC MARKERS -=begin comment -These magic markers are used by munin-node-configure when installing -munin-node. -=end comment + #%# family=auto + + #%# capabilities=autoconf + =cut + EOF -# # Variablen ksm_dir_run="/sys/kernel/mm/ksm/run" From 396c2c2d1f8ae84cbaf014b3ca3a67d7fa468119 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Sun, 12 Jun 2022 22:08:57 +0200 Subject: [PATCH 2/4] Fixed formatting for all my Plugins --- plugins/proxmox/proxmox_vm_count | 29 ++++++++++---------- plugins/router/mikrotik_system | 35 ++++++++++++------------- plugins/system/kernel_same_page_merging | 21 ++++++++------- plugins/system/zswap | 27 +++++++++---------- plugins/zfs/zfs_pool_dataset_count | 18 +++++++------ plugins/zfs/zpool_fragmentation | 22 +++++++++------- 6 files changed, 77 insertions(+), 75 deletions(-) diff --git a/plugins/proxmox/proxmox_vm_count b/plugins/proxmox/proxmox_vm_count index bc622998..52521599 100644 --- a/plugins/proxmox/proxmox_vm_count +++ b/plugins/proxmox/proxmox_vm_count @@ -4,20 +4,28 @@ : << EOF =head1 NAME -proxmox_vm_count - Outputs the running, stopped and total counts of ProxMox VMs and LXCs. +proxmox_vm_count + +=head1 NOTES + +Outputs the running, stopped and total counts of ProxMox VMs and LXCs. =head1 CONFIGURATION -This plugin needs to run as the root user in order to have permission to run lvs and vgs +This Plugin has to be run as root: + [proxmox_vm_count] - [proxmox_count] - user root - group root + user root + group root + +=head1 MAGIC MARKERS + + #%# family=auto + #%# capabilities=autoconf =head1 AUTHOR -Michael Grote - +Michael Grote - git.mgrote.net =head1 LICENSE @@ -25,13 +33,6 @@ GPLv3 or later SPDX-License-Identifier: GPL-3.0-or-later -=head1 MAGIC MARKERS - - #%# family=auto - #%# capabilities=autoconf suggest - -=cut - EOF diff --git a/plugins/router/mikrotik_system b/plugins/router/mikrotik_system index 2a09032b..48f3c813 100755 --- a/plugins/router/mikrotik_system +++ b/plugins/router/mikrotik_system @@ -4,28 +4,33 @@ : << EOF =head1 NAME -mikrotik_system - This plugin fetches multiple Values from a mikrotik device. +mikrotik_system + +=head1 NOTES + +This plugin fetches multiple values from a mikrotik device. Tested with a RB493G, RB750GR3, RB5009, CRS305 and CRS309 on Router OS >6.49.* and >7.0.4. sshpass is a dependency for this Plugin. =head1 CONFIGURATION -tested with a RB493G, RB750GR3, RB5009 and CRS309. -Dependencies: -- sshpass -A User is needed for this plugin to work: +A User on the Target-Device is needed for this plugin to work: /user add name=munin group=read password=hallowelt address= -plugin config: - [mt_system_] - user root - env.ssh_user munin - env.ssh_password hallowelt - env.ssh_host 192.168.2.1 + plugin config: + [mt_system_] + user root + env.ssh_user munin + env.ssh_password hallowelt + env.ssh_host 192.168.2.1 + +=head1 MAGIC MARKERS + + #%# family=auto =head1 AUTHOR -Michael Grote +Michael Grote - git.mgrote.net =head1 LICENSE @@ -33,12 +38,6 @@ GPLv3 or later SPDX-License-Identifier: GPL-3.0-or-later -=head1 MAGIC MARKERS - - #%# family=auto - -=cut - EOF # set variables with default values diff --git a/plugins/system/kernel_same_page_merging b/plugins/system/kernel_same_page_merging index 8a24ae9b..f9fa5602 100755 --- a/plugins/system/kernel_same_page_merging +++ b/plugins/system/kernel_same_page_merging @@ -4,11 +4,20 @@ : << EOF =head1 NAME -kernel_same_page_merging - Outputs various metrics about same page merging. +kernel_same_page_merging + +=head1 NOTES + +Outputs various metrics about kernel same page merging. + +=head1 MAGIC MARKERS + + #%# family=auto + #%# capabilities=autoconf =head1 AUTHOR -Michael Grote +Michael Grote - git.mgrote.net =head1 LICENSE @@ -16,14 +25,6 @@ GPLv3 or later SPDX-License-Identifier: GPL-3.0-or-later -=head1 MAGIC MARKERS - - #%# family=auto - - #%# capabilities=autoconf - -=cut - EOF # Variablen diff --git a/plugins/system/zswap b/plugins/system/zswap index 068f5693..71026547 100755 --- a/plugins/system/zswap +++ b/plugins/system/zswap @@ -4,22 +4,27 @@ : << EOF =head1 NAME -zswap - Outputs various metrics about [zswap](https://www.kernel.org/doc/html/latest/admin-guide/mm/zswap.html). +zswap -=head1 AUTHOR +=head1 NOTES -Michael Grote +Outputs various metrics about zswap. See https://www.kernel.org/doc/html/latest/admin-guide/mm/zswap.html for more Information. -=head1 Configuration +=head1 CONFIGURATION This Plugin has to be run as root: -/etc/munin/plugin-conf.d/zswap: + [zswap] + user root -[zswap] +=head1 MAGIC MARKERS -user root + #%# family=auto + #%# capabilities=autoconf +=head1 AUTHOR + +Michael Grote - git.mgrote.net =head1 LICENSE @@ -27,14 +32,6 @@ GPLv3 or later SPDX-License-Identifier: GPL-3.0-or-later -=head1 MAGIC MARKERS - - #%# family=auto - - #%# capabilities=autoconf - -=cut - EOF diff --git a/plugins/zfs/zfs_pool_dataset_count b/plugins/zfs/zfs_pool_dataset_count index 5daf88ef..e1bcc4cd 100644 --- a/plugins/zfs/zfs_pool_dataset_count +++ b/plugins/zfs/zfs_pool_dataset_count @@ -4,11 +4,19 @@ : << EOF =head1 NAME -zfs_pool_dataset_count - Outputs the count of zfs pools, datasets and snapshots. +zfs_pool_dataset_count + +=head1 NOTES + +Outputs the count of zfs pools, datasets and snapshots. + +=head1 MAGIC MARKERS + + #%# family=auto =head1 AUTHOR -Michael Grote +Michael Grote - git.mgrote.net =head1 LICENSE @@ -16,12 +24,6 @@ GPLv3 or later SPDX-License-Identifier: GPL-3.0-or-later -=head1 MAGIC MARKERS - - #%# family=auto - -=cut - EOF if [ "$1" = "autoconf" ]; then diff --git a/plugins/zfs/zpool_fragmentation b/plugins/zfs/zpool_fragmentation index f998148e..2084b414 100644 --- a/plugins/zfs/zpool_fragmentation +++ b/plugins/zfs/zpool_fragmentation @@ -4,23 +4,25 @@ : << EOF =head1 NAME -zpool_fragmentation - Outputs the zpool fragmentation per zfs pool. +zpool_fragmentation -=head1 AUTHOR +=head1 NOTES -Michael Grote - -=head1 LICENSE -GPLv3 or later - -SPDX-License-Identifier: GPL-3.0-or-later +Outputs the zpool fragmentation per zfs pool. =head1 MAGIC MARKERS - #%# family=auto + #%# family=auto -=cut +=head1 AUTHOR +Michael Grote - git.mgrote.net + +=head1 LICENSE + +GPLv3 or later + +SPDX-License-Identifier: GPL-3.0-or-later EOF From 69db9ea4370144dbba40c4a1e784ee0200f5dd79 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 13 Jun 2022 22:28:31 +0200 Subject: [PATCH 3/4] Extend NAME with Comment --- plugins/proxmox/proxmox_vm_count | 6 +----- plugins/router/mikrotik_system | 4 ++-- plugins/system/kernel_same_page_merging | 6 +----- plugins/system/zswap | 4 ++-- plugins/zfs/zfs_pool_dataset_count | 6 +----- plugins/zfs/zpool_fragmentation | 6 +----- 6 files changed, 8 insertions(+), 24 deletions(-) diff --git a/plugins/proxmox/proxmox_vm_count b/plugins/proxmox/proxmox_vm_count index 52521599..4e99bd26 100644 --- a/plugins/proxmox/proxmox_vm_count +++ b/plugins/proxmox/proxmox_vm_count @@ -4,11 +4,7 @@ : << EOF =head1 NAME -proxmox_vm_count - -=head1 NOTES - -Outputs the running, stopped and total counts of ProxMox VMs and LXCs. +proxmox_vm_count - Outputs the running, stopped and total counts of ProxMox VMs and LXCs. =head1 CONFIGURATION diff --git a/plugins/router/mikrotik_system b/plugins/router/mikrotik_system index 48f3c813..f02c4b3a 100755 --- a/plugins/router/mikrotik_system +++ b/plugins/router/mikrotik_system @@ -4,11 +4,11 @@ : << EOF =head1 NAME -mikrotik_system +mikrotik_system - This plugin fetches multiple values from a mikrotik device. =head1 NOTES -This plugin fetches multiple values from a mikrotik device. Tested with a RB493G, RB750GR3, RB5009, CRS305 and CRS309 on Router OS >6.49.* and >7.0.4. sshpass is a dependency for this Plugin. +Tested with a RB493G, RB750GR3, RB5009, CRS305 and CRS309 on Router OS >6.49.* and >7.0.4. sshpass is a dependency for this Plugin. =head1 CONFIGURATION diff --git a/plugins/system/kernel_same_page_merging b/plugins/system/kernel_same_page_merging index f9fa5602..efd39873 100755 --- a/plugins/system/kernel_same_page_merging +++ b/plugins/system/kernel_same_page_merging @@ -4,11 +4,7 @@ : << EOF =head1 NAME -kernel_same_page_merging - -=head1 NOTES - -Outputs various metrics about kernel same page merging. +kernel_same_page_merging - Outputs various metrics about kernel same page merging. =head1 MAGIC MARKERS diff --git a/plugins/system/zswap b/plugins/system/zswap index 71026547..d6f46acb 100755 --- a/plugins/system/zswap +++ b/plugins/system/zswap @@ -4,11 +4,11 @@ : << EOF =head1 NAME -zswap +zswap - Outputs various metrics about zswap. =head1 NOTES -Outputs various metrics about zswap. See https://www.kernel.org/doc/html/latest/admin-guide/mm/zswap.html for more Information. + See https://www.kernel.org/doc/html/latest/admin-guide/mm/zswap.html for more Information. =head1 CONFIGURATION diff --git a/plugins/zfs/zfs_pool_dataset_count b/plugins/zfs/zfs_pool_dataset_count index e1bcc4cd..a7877836 100644 --- a/plugins/zfs/zfs_pool_dataset_count +++ b/plugins/zfs/zfs_pool_dataset_count @@ -4,11 +4,7 @@ : << EOF =head1 NAME -zfs_pool_dataset_count - -=head1 NOTES - -Outputs the count of zfs pools, datasets and snapshots. +zfs_pool_dataset_count - Outputs the count of zfs pools, datasets and snapshots. =head1 MAGIC MARKERS diff --git a/plugins/zfs/zpool_fragmentation b/plugins/zfs/zpool_fragmentation index 2084b414..71494bb4 100644 --- a/plugins/zfs/zpool_fragmentation +++ b/plugins/zfs/zpool_fragmentation @@ -4,11 +4,7 @@ : << EOF =head1 NAME -zpool_fragmentation - -=head1 NOTES - -Outputs the zpool fragmentation per zfs pool. +zpool_fragmentation - Outputs the zpool fragmentation per zfs pool. =head1 MAGIC MARKERS From 841c4b95227dfa6df977b1db6ec2df1066de03cc Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 13 Jun 2022 22:30:05 +0200 Subject: [PATCH 4/4] Moved MAGIC MARKERS to the bottom --- plugins/proxmox/proxmox_vm_count | 10 +++++----- plugins/router/mikrotik_system | 9 +++++---- plugins/system/kernel_same_page_merging | 10 +++++----- plugins/system/zswap | 10 +++++----- plugins/zfs/zfs_pool_dataset_count | 9 +++++---- plugins/zfs/zpool_fragmentation | 9 +++++---- 6 files changed, 30 insertions(+), 27 deletions(-) diff --git a/plugins/proxmox/proxmox_vm_count b/plugins/proxmox/proxmox_vm_count index 4e99bd26..ccafcda3 100644 --- a/plugins/proxmox/proxmox_vm_count +++ b/plugins/proxmox/proxmox_vm_count @@ -14,11 +14,6 @@ This Plugin has to be run as root: user root group root -=head1 MAGIC MARKERS - - #%# family=auto - #%# capabilities=autoconf - =head1 AUTHOR Michael Grote - git.mgrote.net @@ -29,6 +24,11 @@ GPLv3 or later SPDX-License-Identifier: GPL-3.0-or-later +=head1 MAGIC MARKERS + + #%# family=auto + #%# capabilities=autoconf + EOF diff --git a/plugins/router/mikrotik_system b/plugins/router/mikrotik_system index f02c4b3a..ab706e13 100755 --- a/plugins/router/mikrotik_system +++ b/plugins/router/mikrotik_system @@ -24,10 +24,6 @@ A User on the Target-Device is needed for this plugin to work: env.ssh_password hallowelt env.ssh_host 192.168.2.1 -=head1 MAGIC MARKERS - - #%# family=auto - =head1 AUTHOR Michael Grote - git.mgrote.net @@ -38,6 +34,11 @@ GPLv3 or later SPDX-License-Identifier: GPL-3.0-or-later +=head1 MAGIC MARKERS + + #%# family=auto + #%# capabilities=autoconf + EOF # set variables with default values diff --git a/plugins/system/kernel_same_page_merging b/plugins/system/kernel_same_page_merging index efd39873..01273412 100755 --- a/plugins/system/kernel_same_page_merging +++ b/plugins/system/kernel_same_page_merging @@ -6,11 +6,6 @@ kernel_same_page_merging - Outputs various metrics about kernel same page merging. -=head1 MAGIC MARKERS - - #%# family=auto - #%# capabilities=autoconf - =head1 AUTHOR Michael Grote - git.mgrote.net @@ -21,6 +16,11 @@ GPLv3 or later SPDX-License-Identifier: GPL-3.0-or-later +=head1 MAGIC MARKERS + + #%# family=auto + #%# capabilities=autoconf + EOF # Variablen diff --git a/plugins/system/zswap b/plugins/system/zswap index d6f46acb..3c022aa7 100755 --- a/plugins/system/zswap +++ b/plugins/system/zswap @@ -17,11 +17,6 @@ This Plugin has to be run as root: [zswap] user root -=head1 MAGIC MARKERS - - #%# family=auto - #%# capabilities=autoconf - =head1 AUTHOR Michael Grote - git.mgrote.net @@ -32,6 +27,11 @@ GPLv3 or later SPDX-License-Identifier: GPL-3.0-or-later +=head1 MAGIC MARKERS + + #%# family=auto + #%# capabilities=autoconf + EOF diff --git a/plugins/zfs/zfs_pool_dataset_count b/plugins/zfs/zfs_pool_dataset_count index a7877836..ea2fd7ee 100644 --- a/plugins/zfs/zfs_pool_dataset_count +++ b/plugins/zfs/zfs_pool_dataset_count @@ -6,10 +6,6 @@ zfs_pool_dataset_count - Outputs the count of zfs pools, datasets and snapshots. -=head1 MAGIC MARKERS - - #%# family=auto - =head1 AUTHOR Michael Grote - git.mgrote.net @@ -20,6 +16,11 @@ GPLv3 or later SPDX-License-Identifier: GPL-3.0-or-later +=head1 MAGIC MARKERS + + #%# family=auto + #%# capabilities=autoconf + EOF if [ "$1" = "autoconf" ]; then diff --git a/plugins/zfs/zpool_fragmentation b/plugins/zfs/zpool_fragmentation index 71494bb4..ea8badd2 100644 --- a/plugins/zfs/zpool_fragmentation +++ b/plugins/zfs/zpool_fragmentation @@ -6,10 +6,6 @@ zpool_fragmentation - Outputs the zpool fragmentation per zfs pool. -=head1 MAGIC MARKERS - - #%# family=auto - =head1 AUTHOR Michael Grote - git.mgrote.net @@ -20,6 +16,11 @@ GPLv3 or later SPDX-License-Identifier: GPL-3.0-or-later +=head1 MAGIC MARKERS + + #%# family=auto + #%# capabilities=autoconf + EOF if [ "$1" = "autoconf" ]; then