From a4ba462ed472c046b3532fa2b684cdc906223f10 Mon Sep 17 00:00:00 2001
From: "Hahn Axel (hahn)" <axel.hahn@unibe.ch>
Date: Wed, 12 Feb 2025 10:04:05 +0100
Subject: [PATCH] check_snmp_data: add IML header in help

---
 check_snmp_data     | 20 +++++++-------------
 check_snmp_includes |  9 +++++++++
 2 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/check_snmp_data b/check_snmp_data
index 8a8aedc..212c4f0 100755
--- a/check_snmp_data
+++ b/check_snmp_data
@@ -70,6 +70,7 @@
 # 2022-10-25  v0.6  <axel.hahn@unibe.ch>          fix empty value in performance data; shell fixes
 # 2023-05-05  v0.7  <axel.hahn@unibe.ch>          source shared func, support snmpv3; add synoio
 # 2023-05-16  v0.8  <axel.hahn@unibe.ch>          add about for general infos and without perf data
+# 2025-02-12  v1.0  <axel.hahn@unibe.ch>          add IML header in help
 # ======================================================================
 
 . $(dirname $0)/inc_pluginfunctions
@@ -77,7 +78,7 @@
 
 # --- basic vars
 self_APPNAME=$( basename $0 | tr [:lower:] [:upper:] )
-self_APPVERSION=0.8
+self_APPVERSION=1.0
 
 METHOD=""
 
@@ -160,18 +161,11 @@ function showHelp(){
         do
             METHOD=$(echo "$line" | cut -f 2 -d ":")
             descr=$(_cfg_getlabel)
-            printf "                          %-10s %-50s\n" "$METHOD" "$descr"
+            printf "            %-10s %-50s\n" "$METHOD" "$descr"
         done        
     )
 cat <<EOH
-______________________________________________________________________
-
-$self_APPNAME 
-v$self_APPVERSION
-
-(c) Institute for Medical Education - University of Bern
-Licence: GNU GPL 3
-______________________________________________________________________
+$( ph.showImlHelpHeader )
 
 SNMP performance data of Synology storages.
 
@@ -187,10 +181,10 @@ PARAMETERS:
     -f FILE
         read authentication from config file
         default: "/etc/icinga2/snmp.cfg"
-    -m  method         what to show
-                       method is one of ...
+    -m  METHOD
+        what to show; METHOD is one of ...
 $_methods
-    -v                 verbose output
+    -v  verbose output
 
 CONFIG FILE:
     The config file can be multiline and has the syntax
diff --git a/check_snmp_includes b/check_snmp_includes
index 27aab59..c16e0c0 100644
--- a/check_snmp_includes
+++ b/check_snmp_includes
@@ -1,4 +1,13 @@
 #!/bin/sh
+# ======================================================================
+#
+# Include file for SNMP related checks
+# Used by
+# - check_snmp_data
+# - check_snmp_printer
+# - check_snmp_synology
+#
+# ======================================================================
 
 # ----------------------------------------------------------------------
 # Variables
-- 
GitLab