forked from pool/monitoring-plugins
Accepting request 1121479 from server:monitoring
- renamed patches monitoring-plugins-wrong_return_in_check_swap.patch to monitoring-plugins-2.3.3-wrong_percent_in_check_swap.patch monitoring-plugins.check_snmp.arrayaddress.patch to monitoring-plugins-2.3.3-check_snmp.arrayaddress.patch monitoring-plugins-2.3-check_ntp_perf_absolute.patch to monitoring-plugins-2.3.3-check_ntp_perf_absolute.patch - Add buildrequires for coreutils-systemd, as the configure script checks for uptime [bsc#1216148] - systemd-not-utmp.patch: let check_users prefer systemd-logind over utmp (jsc#PED-3144) - Add attach_disconnected flag for usr.lib.nagios.plugins.check_procs and usr.lib.nagios.plugins.check_procs.sle15 apparmor profiles to permit /proc/PID/exe access; (bsc#1209194) - added monitoring-plugins-2.3.3-check_icmp.patch Simple patch to avoid compiler errors with latest gcc - removed monitoring-plugins-2.3.1-fixing-shellcheck.patch - upstream - renamed monitoring-plugins-2.2-mariadb_102_build_fix.patch to monitoring-plugins-2.3.3-mariadb_102_build_fix.patch - added monitoring-plugins-2.3.3-check_http-proxy.patch Fixes a check_http bug when trying to follow a redirect returned from a URL retrieved via SSL proxy (issue #1764) - finally remove monitoring-plugins-1.4.6-Makefile_-_no_chown.patch: obsoleted by monitoring-plugins-2.3.3-root-plugins-Makefile_-_no_chown.patch OBS-URL: https://build.opensuse.org/request/show/1121479 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/monitoring-plugins?expand=0&rev=28
This commit is contained in:
commit
623c7f613a
@ -1,28 +0,0 @@
|
||||
Index: monitoring-plugins-2.3.1/plugins-root/Makefile.am
|
||||
===================================================================
|
||||
--- monitoring-plugins-2.3.1.orig/plugins-root/Makefile.am
|
||||
+++ monitoring-plugins-2.3.1/plugins-root/Makefile.am
|
||||
@@ -47,7 +47,6 @@ INSTALL_SUID = \
|
||||
echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libexecdir)/$$p"; \
|
||||
$(INSTALL_PROGRAM) $$p $(DESTDIR)$(libexecdir)/$$p; \
|
||||
echo " chown root $(DESTDIR)$(libexecdir)/$$p"; \
|
||||
- chown root $(DESTDIR)$(libexecdir)/$$p; \
|
||||
echo " chmod $(setuid_root_mode) $(DESTDIR)$(libexecdir)/$$p"; \
|
||||
chmod $(setuid_root_mode) $(DESTDIR)$(libexecdir)/$$p; \
|
||||
done
|
||||
@@ -66,11 +65,11 @@ install-exec-local: $(noinst_PROGRAMS)
|
||||
&& chmod $(setuid_root_mode) $$TMPFILE > /dev/null 2>&1 \
|
||||
&& can_create_suid_root_executable=yes; \
|
||||
rm -f $$TMPFILE; \
|
||||
- if test $$can_create_suid_root_executable = yes; then \
|
||||
- $(INSTALL_SUID); \
|
||||
- else \
|
||||
- echo "WARNING: insufficient access; not installing setuid plugins"; \
|
||||
+ $(INSTALL_SUID); \
|
||||
+ if test $$can_create_suid_root_executable != yes; then \
|
||||
+ echo "WARNING: insufficient access; not installing plugins as setuid"; \
|
||||
echo "NOTE: to install setuid plugins, run 'make install-root' as root"; \
|
||||
+ echo "NOTE: or fix this in your packaging (like the specfile)"; \
|
||||
fi
|
||||
|
||||
# /* Author Coreutils team sub-citation */
|
@ -1,90 +0,0 @@
|
||||
Index: monitoring-plugins-2.3.1/plugins-scripts/check_log.sh
|
||||
===================================================================
|
||||
--- monitoring-plugins-2.3.1.orig/plugins-scripts/check_log.sh
|
||||
+++ monitoring-plugins-2.3.1/plugins-scripts/check_log.sh
|
||||
@@ -115,27 +115,27 @@ while test -n "$1"; do
|
||||
exit $STATE_OK
|
||||
;;
|
||||
--filename)
|
||||
- logfile=$2
|
||||
+ logfile="$2"
|
||||
shift
|
||||
;;
|
||||
-F)
|
||||
- logfile=$2
|
||||
+ logfile="$2"
|
||||
shift
|
||||
;;
|
||||
--oldlog)
|
||||
- oldlog=$2
|
||||
+ oldlog="$2"
|
||||
shift
|
||||
;;
|
||||
-O)
|
||||
- oldlog=$2
|
||||
+ oldlog="$2"
|
||||
shift
|
||||
;;
|
||||
--query)
|
||||
- query=$2
|
||||
+ query="$2"
|
||||
shift
|
||||
;;
|
||||
-q)
|
||||
- query=$2
|
||||
+ query="$2"
|
||||
shift
|
||||
;;
|
||||
-x)
|
||||
@@ -157,10 +157,10 @@ done
|
||||
|
||||
# If the source log file doesn't exist, exit
|
||||
|
||||
-if [ ! -e $logfile ]; then
|
||||
+if [ ! -e "$logfile" ]; then
|
||||
echo "Log check error: Log file $logfile does not exist!"
|
||||
exit $STATE_UNKNOWN
|
||||
-elif [ ! -r $logfile ] ; then
|
||||
+elif [ ! -r "$logfile" ] ; then
|
||||
echo "Log check error: Log file $logfile is not readable!"
|
||||
exit $STATE_UNKNOWN
|
||||
fi
|
||||
@@ -169,8 +169,8 @@ fi
|
||||
# we're running this test, so copy the original log file over to
|
||||
# the old diff file and exit
|
||||
|
||||
-if [ ! -e $oldlog ]; then
|
||||
- cat $logfile > $oldlog
|
||||
+if [ ! -e "$oldlog" ]; then
|
||||
+ cat "$logfile" > "$oldlog"
|
||||
echo "Log check data initialized..."
|
||||
exit $STATE_OK
|
||||
fi
|
||||
@@ -184,20 +184,20 @@ if [ -x /bin/mktemp ]; then
|
||||
else
|
||||
tempdiff=`/bin/date '+%H%M%S'`
|
||||
tempdiff="/tmp/check_log.${tempdiff}"
|
||||
- touch $tempdiff
|
||||
- chmod 600 $tempdiff
|
||||
+ touch "$tempdiff"
|
||||
+ chmod 600 "$tempdiff"
|
||||
fi
|
||||
|
||||
-diff $logfile $oldlog | grep -v "^>" > $tempdiff
|
||||
+diff "$logfile" "$oldlog" | grep -v "^>" > "$tempdiff"
|
||||
|
||||
# Count the number of matching log entries we have
|
||||
-count=`grep -c "$query" $tempdiff`
|
||||
+count=`grep -c "$query" "$tempdiff"`
|
||||
|
||||
# Get the last matching entry in the diff file
|
||||
-lastentry=`grep "$query" $tempdiff | tail -1`
|
||||
+lastentry=`grep "$query" "$tempdiff" | tail -1`
|
||||
|
||||
-rm -f $tempdiff
|
||||
-cat $logfile > $oldlog
|
||||
+rm -f "$tempdiff"
|
||||
+cat "$logfile" > "$oldlog"
|
||||
|
||||
if [ "$count" = "0" ]; then # no matches, exit with no error
|
||||
echo "Log check ok - 0 pattern matches found"
|
@ -1,70 +0,0 @@
|
||||
diff -ur monitoring-plugins-2.3.1.orig/plugins/check_by_ssh.c monitoring-plugins-2.3.1/plugins/check_by_ssh.c
|
||||
--- monitoring-plugins-2.3.1.orig/plugins/check_by_ssh.c 2021-04-10 07:13:41.000000000 -0500
|
||||
+++ monitoring-plugins-2.3.1/plugins/check_by_ssh.c 2022-07-02 10:33:49.977417534 -0500
|
||||
@@ -49,6 +49,7 @@
|
||||
unsigned int services = 0;
|
||||
int skip_stdout = 0;
|
||||
int skip_stderr = 0;
|
||||
+int unknown_timeout = 0;
|
||||
char *remotecmd = NULL;
|
||||
char **commargv = NULL;
|
||||
int commargc = 0;
|
||||
@@ -100,6 +101,13 @@
|
||||
|
||||
result = cmd_run_array (commargv, &chld_out, &chld_err, 0);
|
||||
|
||||
+ /* SSH returns 255 if connection attempt fails; include the first line of error output */
|
||||
+ if (result == 255 && unknown_timeout) {
|
||||
+ printf (_("SSH connection failed: %s\n"),
|
||||
+ chld_err.lines > 0 ? chld_err.line[0] : "(no error output)");
|
||||
+ return STATE_UNKNOWN;
|
||||
+ }
|
||||
+
|
||||
if (verbose) {
|
||||
for(i = 0; i < chld_out.lines; i++)
|
||||
printf("stdout: %s\n", chld_out.line[i]);
|
||||
@@ -176,6 +184,7 @@
|
||||
{"verbose", no_argument, 0, 'v'},
|
||||
{"fork", no_argument, 0, 'f'},
|
||||
{"timeout", required_argument, 0, 't'},
|
||||
+ {"unknown-timeout", no_argument, 0, 'U'},
|
||||
{"host", required_argument, 0, 'H'}, /* backward compatibility */
|
||||
{"hostname", required_argument, 0, 'H'},
|
||||
{"port", required_argument,0,'p'},
|
||||
@@ -207,7 +216,7 @@
|
||||
strcpy (argv[c], "-t");
|
||||
|
||||
while (1) {
|
||||
- c = getopt_long (argc, argv, "Vvh1246fqt:H:O:p:i:u:l:C:S::E::n:s:o:F:", longopts,
|
||||
+ c = getopt_long (argc, argv, "Vvh1246fqt:UH:O:p:i:u:l:C:S::E::n:s:o:F:", longopts,
|
||||
&option);
|
||||
|
||||
if (c == -1 || c == EOF)
|
||||
@@ -229,6 +238,9 @@
|
||||
else
|
||||
timeout_interval = atoi (optarg);
|
||||
break;
|
||||
+ case 'U':
|
||||
+ unknown_timeout = 1;
|
||||
+ break;
|
||||
case 'H': /* host */
|
||||
host_or_die(optarg);
|
||||
hostname = optarg;
|
||||
@@ -437,6 +449,8 @@
|
||||
printf (" %s\n", _("Tell ssh to suppress warning and diagnostic messages [optional]"));
|
||||
printf (UT_WARN_CRIT);
|
||||
printf (UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
|
||||
+ printf (" %s\n","-U, --unknown-timeout");
|
||||
+ printf (" %s\n", _("Make connection problems return UNKNOWN instead of CRITICAL"));
|
||||
printf (UT_VERBOSE);
|
||||
printf("\n");
|
||||
printf (" %s\n", _("The most common mode of use is to refer to a local identity file with"));
|
||||
@@ -466,7 +480,7 @@
|
||||
print_usage (void)
|
||||
{
|
||||
printf ("%s\n", _("Usage:"));
|
||||
- printf (" %s -H <host> -C <command> [-fqv] [-1|-2] [-4|-6]\n"
|
||||
+ printf (" %s -H <host> -C <command> [-fqvU] [-1|-2] [-4|-6]\n"
|
||||
" [-S [lines]] [-E [lines]] [-t timeout] [-i identity]\n"
|
||||
" [-l user] [-n name] [-s servicelist] [-O outputfile]\n"
|
||||
" [-p port] [-o ssh-option] [-F configfile]\n",
|
@ -1,25 +0,0 @@
|
||||
commit a00fd77179dd6a6c2c96ff09350a9c213c18fd62
|
||||
Author: George Hansper <george@hansper.id.au>
|
||||
Date: Tue Sep 22 19:06:57 2020 +1000
|
||||
|
||||
check_disk - fix false DISK CRITICAL alert for btrfs filesystems due to BSD Gnulib workaround
|
||||
|
||||
diff --git a/plugins/check_disk.c b/plugins/check_disk.c
|
||||
index 2f20e47a..c813ad65 100755
|
||||
--- a/plugins/check_disk.c
|
||||
+++ b/plugins/check_disk.c
|
||||
@@ -1310,10 +1310,14 @@ get_stats (struct parameter_list *p, struct fs_usage *fsp) {
|
||||
|
||||
void
|
||||
get_path_stats (struct parameter_list *p, struct fs_usage *fsp) {
|
||||
+#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(OpenBSD )
|
||||
/* 2007-12-08 - Workaround for Gnulib reporting insanely high available
|
||||
* space on BSD (the actual value should be negative but fsp->fsu_bavail
|
||||
* is unsigned) */
|
||||
p->available = fsp->fsu_bavail > fsp->fsu_bfree ? 0 : fsp->fsu_bavail;
|
||||
+#else
|
||||
+ p->available = fsp->fsu_bavail;
|
||||
+#endif
|
||||
p->available_to_root = fsp->fsu_bfree;
|
||||
p->used = fsp->fsu_blocks - fsp->fsu_bfree;
|
||||
if (freespace_ignore_reserved) {
|
@ -1,13 +0,0 @@
|
||||
Index: monitoring-plugins-2.3.1/plugins/check_snmp.c
|
||||
===================================================================
|
||||
--- monitoring-plugins-2.3.1.orig/plugins/check_snmp.c
|
||||
+++ monitoring-plugins-2.3.1/plugins/check_snmp.c
|
||||
@@ -375,7 +375,7 @@ main (int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
- for (line=0, i=0; line < chld_out.lines; line++, i++) {
|
||||
+ for (line=0, i=0; line < chld_out.lines && i < numoids; line++, i++) {
|
||||
if(calculate_rate)
|
||||
conv = "%.10g";
|
||||
else
|
@ -1,588 +0,0 @@
|
||||
From 439b93049ddcfa28d7d3b8dd8085770c613aabc3 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Wagner <waja@cyconet.org>
|
||||
Date: Fri, 6 Jan 2017 16:54:29 +0100
|
||||
Subject: [PATCH 1/6] Fixing shellcheck SC2006
|
||||
|
||||
---
|
||||
3 files changed, 41 insertions(+), 41 deletions(-)
|
||||
|
||||
Index: monitoring-plugins-2.3.1/plugins-scripts/check_oracle.sh
|
||||
===================================================================
|
||||
--- monitoring-plugins-2.3.1.orig/plugins-scripts/check_oracle.sh
|
||||
+++ monitoring-plugins-2.3.1/plugins-scripts/check_oracle.sh
|
||||
@@ -8,11 +8,11 @@
|
||||
|
||||
PATH="@TRUSTED_PATH@"
|
||||
export PATH
|
||||
-PROGNAME=`basename $0`
|
||||
-PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'`
|
||||
+PROGNAME=$(basename "$0")
|
||||
+PROGPATH=$(echo "$0" | sed -e 's,[\\/][^\\/][^\\/]*$,,')
|
||||
REVISION="@NP_VERSION@"
|
||||
|
||||
-. $PROGPATH/utils.sh
|
||||
+. "$PROGPATH"/utils.sh
|
||||
|
||||
|
||||
print_usage() {
|
||||
@@ -29,7 +29,7 @@ print_usage() {
|
||||
}
|
||||
|
||||
print_help() {
|
||||
- print_revision $PROGNAME $REVISION
|
||||
+ print_revision "$PROGNAME" "$REVISION"
|
||||
echo ""
|
||||
print_usage
|
||||
echo ""
|
||||
@@ -87,47 +87,47 @@ esac
|
||||
case "$cmd" in
|
||||
--help)
|
||||
print_help
|
||||
- exit $STATE_OK
|
||||
+ exit "$STATE_OK"
|
||||
;;
|
||||
-h)
|
||||
print_help
|
||||
- exit $STATE_OK
|
||||
+ exit "$STATE_OK"
|
||||
;;
|
||||
--version)
|
||||
- print_revision $PROGNAME $REVISION
|
||||
- exit $STATE_OK
|
||||
+ print_revision "$PROGNAME" "$REVISION"
|
||||
+ exit "$STATE_OK"
|
||||
;;
|
||||
-V)
|
||||
- print_revision $PROGNAME $REVISION
|
||||
- exit $STATE_OK
|
||||
+ print_revision "$PROGNAME" "$REVISION"
|
||||
+ exit "$STATE_OK"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Hunt down a reasonable ORACLE_HOME
|
||||
if [ -z "$ORACLE_HOME" ] ; then
|
||||
- # Adjust to taste
|
||||
- for oratab in /var/opt/oracle/oratab /etc/oratab
|
||||
- do
|
||||
- [ ! -f $oratab ] && continue
|
||||
- ORACLE_HOME=`IFS=:
|
||||
- while read SID ORACLE_HOME junk;
|
||||
- do
|
||||
- if [ "$SID" = "$2" -o "$SID" = "*" ] ; then
|
||||
- echo $ORACLE_HOME;
|
||||
- exit;
|
||||
- fi;
|
||||
- done < $oratab`
|
||||
- [ -n "$ORACLE_HOME" ] && break
|
||||
- done
|
||||
+ # Adjust to taste
|
||||
+ for oratab in /var/opt/oracle/oratab /etc/oratab
|
||||
+ do
|
||||
+ [ ! -f $oratab ] && continue
|
||||
+ ORACLE_HOME=`IFS=:
|
||||
+ while read -r SID ORACLE_HOME junk;
|
||||
+ do
|
||||
+ if [ "$SID" = "$2" ] || [ "$SID" = "*" ] ; then
|
||||
+ echo "$ORACLE_HOME";
|
||||
+ exit;
|
||||
+ fi;
|
||||
+ done < $oratab`
|
||||
+ [ -n "$ORACLE_HOME" ] && break
|
||||
+ done
|
||||
fi
|
||||
# Last resort
|
||||
-[ -z "$ORACLE_HOME" -a -d $PROGPATH/oracle ] && ORACLE_HOME=$PROGPATH/oracle
|
||||
+[ -z "$ORACLE_HOME" ] && [ -d "$PROGPATH"/oracle ] && ORACLE_HOME=$PROGPATH/oracle
|
||||
|
||||
if [ "$cmd" != "--db" ]; then
|
||||
- if [ -z "$ORACLE_HOME" -o ! -d "$ORACLE_HOME" ] ; then
|
||||
- echo "Cannot determine ORACLE_HOME for sid $2"
|
||||
- exit $STATE_UNKNOWN
|
||||
- fi
|
||||
+ if [ -z "$ORACLE_HOME" ] || [ ! -d "$ORACLE_HOME" ] ; then
|
||||
+ echo "Cannot determine ORACLE_HOME for sid $2"
|
||||
+ exit "$STATE_UNKNOWN"
|
||||
+ fi
|
||||
fi
|
||||
PATH=$PATH:$ORACLE_HOME/bin
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
|
||||
@@ -135,81 +135,81 @@ export ORACLE_HOME PATH LD_LIBRARY_PATH
|
||||
|
||||
case "$cmd" in
|
||||
--tns)
|
||||
- tnschk=` tnsping $2`
|
||||
- tnschk2=` echo $tnschk | grep -c OK`
|
||||
- if [ ${tnschk2} -eq 1 ] ; then
|
||||
- tnschk3=${tnschk##*(}; tnschk3=${tnschk3%)*}
|
||||
- echo "OK - reply time ${tnschk3} from $2"
|
||||
- exit $STATE_OK
|
||||
+ tnschk=$(tnsping "$2")
|
||||
+ tnschk2=$(echo "$tnschk" | grep -c OK)
|
||||
+ if [ "${tnschk2}" -eq 1 ] ; then
|
||||
+ tnschk3=${tnschk##*(}; tnschk3=${tnschk3%)*}
|
||||
+ echo "OK - reply time ${tnschk3} from $2"
|
||||
+ exit "$STATE_OK"
|
||||
else
|
||||
- echo "No TNS Listener on $2"
|
||||
- exit $STATE_CRITICAL
|
||||
+ echo "No TNS Listener on $2"
|
||||
+ exit "$STATE_CRITICAL"
|
||||
fi
|
||||
;;
|
||||
--oranames)
|
||||
- namesctl status $2 | awk '
|
||||
+ namesctl status "$2" | awk '
|
||||
/Server has been running for:/ {
|
||||
- msg = "OK: Up"
|
||||
- for (i = 6; i <= NF; i++) {
|
||||
- msg = msg " " $i
|
||||
- }
|
||||
- status = '$STATE_OK'
|
||||
+ msg = "OK: Up"
|
||||
+ for (i = 6; i <= NF; i++) {
|
||||
+ msg = msg " " $i
|
||||
+ }
|
||||
+ status = '"$STATE_OK"'
|
||||
}
|
||||
/error/ {
|
||||
- msg = "CRITICAL: " $0
|
||||
- status = '$STATE_CRITICAL'
|
||||
+ msg = "CRITICAL: " $0
|
||||
+ status = '"$STATE_CRITICAL"'
|
||||
}
|
||||
END {
|
||||
- print msg
|
||||
- exit status
|
||||
+ print msg
|
||||
+ exit status
|
||||
}'
|
||||
;;
|
||||
--db)
|
||||
- pmonchk=`ps -ef | grep -v grep | grep -E -c "(asm|ora)_pmon_${2}$"`
|
||||
- if [ ${pmonchk} -ge 1 ] ; then
|
||||
- echo "${2} OK - ${pmonchk} PMON process(es) running"
|
||||
- exit $STATE_OK
|
||||
+ pmonchk=$(pgrep -f "(asm|ora)_pmon_${2}$")
|
||||
+ if [ "${pmonchk}" -ge 1 ] ; then
|
||||
+ echo "${2} OK - ${pmonchk} PMON process(es) running"
|
||||
+ exit "$STATE_OK"
|
||||
#if [ -f $ORACLE_HOME/dbs/sga*${2}* ] ; then
|
||||
- #if [ ${pmonchk} -eq 1 ] ; then
|
||||
+ #if [ ${pmonchk} -eq 1 ] ; then
|
||||
#utime=`ls -la $ORACLE_HOME/dbs/sga*$2* | cut -c 43-55`
|
||||
- #echo "${2} OK - running since ${utime}"
|
||||
- #exit $STATE_OK
|
||||
- #fi
|
||||
+ #echo "${2} OK - running since ${utime}"
|
||||
+ #exit $STATE_OK
|
||||
+ #fi
|
||||
else
|
||||
- echo "${2} Database is DOWN"
|
||||
- exit $STATE_CRITICAL
|
||||
+ echo "${2} Database is DOWN"
|
||||
+ exit "$STATE_CRITICAL"
|
||||
fi
|
||||
;;
|
||||
--login)
|
||||
- loginchk=`sqlplus dummy/user@$2 < /dev/null`
|
||||
- loginchk2=` echo $loginchk | grep -c ORA-01017`
|
||||
- if [ ${loginchk2} -eq 1 ] ; then
|
||||
- echo "OK - dummy login connected"
|
||||
- exit $STATE_OK
|
||||
+ loginchk=$(sqlplus dummy/user@"$2" < /dev/null)
|
||||
+ loginchk2=$(echo "$loginchk" | grep -c ORA-01017)
|
||||
+ if [ "${loginchk2}" -eq 1 ] ; then
|
||||
+ echo "OK - dummy login connected"
|
||||
+ exit "$STATE_OK"
|
||||
else
|
||||
- loginchk3=` echo "$loginchk" | grep "ORA-" | head -1`
|
||||
- echo "CRITICAL - $loginchk3"
|
||||
- exit $STATE_CRITICAL
|
||||
+ loginchk3=$(echo "$loginchk" | grep "ORA-" | head -1)
|
||||
+ echo "CRITICAL - $loginchk3"
|
||||
+ exit "$STATE_CRITICAL"
|
||||
fi
|
||||
;;
|
||||
--connect)
|
||||
- connectchk=`sqlplus $2 < /dev/null`
|
||||
- connectchk2=` echo $connectchk | grep -c ORA-`
|
||||
- if [ ${connectchk2} -eq 0 ] ; then
|
||||
- echo "OK - login successful"
|
||||
- exit $STATE_OK
|
||||
+ connectchk=$(sqlplus "$2" < /dev/null)
|
||||
+ connectchk2=$(echo "$connectchk" | grep -c ORA-)
|
||||
+ if [ "${connectchk2}" -eq 0 ] ; then
|
||||
+ echo "OK - login successful"
|
||||
+ exit "$STATE_OK"
|
||||
else
|
||||
- connectchk3=` echo "$connectchk" | grep "ORA-" | head -1`
|
||||
- echo "CRITICAL - $connectchk3"
|
||||
- exit $STATE_CRITICAL
|
||||
+ connectchk3=$(echo "$connectchk" | grep "ORA-" | head -1)
|
||||
+ echo "CRITICAL - $connectchk3"
|
||||
+ exit "$STATE_CRITICAL"
|
||||
fi
|
||||
;;
|
||||
--cache)
|
||||
- if [ ${5} -gt ${6} ] ; then
|
||||
- echo "UNKNOWN - Warning level is less then Crit"
|
||||
- exit $STATE_UNKNOWN
|
||||
+ if [ "${5}" -gt "${6}" ] ; then
|
||||
+ echo "UNKNOWN - Warning level is less then Crit"
|
||||
+ exit "$STATE_UNKNOWN"
|
||||
fi
|
||||
- result=`sqlplus -s ${3}/${4}@${2} << EOF
|
||||
+ result=`sqlplus -s "${3}"/"${4}"@"${2}" << EOF
|
||||
set pagesize 0
|
||||
set numf '9999999.99'
|
||||
select (1-(pr.value/(dbg.value+cg.value)))*100
|
||||
@@ -219,48 +219,48 @@ and dbg.name='db block gets'
|
||||
and cg.name='consistent gets';
|
||||
EOF`
|
||||
|
||||
- if [ -n "`echo $result | grep ORA-`" ] ; then
|
||||
- error=` echo "$result" | grep "ORA-" | head -1`
|
||||
- echo "CRITICAL - $error"
|
||||
- exit $STATE_CRITICAL
|
||||
+ if echo "$result" | grep -q 'ORA-' ; then
|
||||
+ error=$(echo "$result" | grep "ORA-" | head -1)
|
||||
+ echo "CRITICAL - $error"
|
||||
+ exit "$STATE_CRITICAL"
|
||||
fi
|
||||
|
||||
- buf_hr=`echo "$result" | awk '/^[0-9\. \t]+$/ {print int($1)}'`
|
||||
- buf_hrx=`echo "$result" | awk '/^[0-9\. \t]+$/ {print $1}'`
|
||||
- result=`sqlplus -s ${3}/${4}@${2} << EOF
|
||||
+ buf_hr=$(echo "$result" | awk '/^[0-9\. \t]+$/ {print int($1)}')
|
||||
+ buf_hrx=$(echo "$result" | awk '/^[0-9\. \t]+$/ {print $1}')
|
||||
+ result=`sqlplus -s "${3}"/"${4}"@"${2}" << EOF
|
||||
set pagesize 0
|
||||
set numf '9999999.99'
|
||||
select sum(lc.pins)/(sum(lc.pins)+sum(lc.reloads))*100
|
||||
from v\\$librarycache lc;
|
||||
EOF`
|
||||
-
|
||||
- if [ -n "`echo $result | grep ORA-`" ] ; then
|
||||
- error=` echo "$result" | grep "ORA-" | head -1`
|
||||
- echo "CRITICAL - $error"
|
||||
- exit $STATE_CRITICAL
|
||||
- fi
|
||||
-
|
||||
- lib_hr=`echo "$result" | awk '/^[0-9\. \t]+$/ {print int($1)}'`
|
||||
- lib_hrx=`echo "$result" | awk '/^[0-9\. \t]+$/ {print $1}'`
|
||||
-
|
||||
- if [ $buf_hr -le ${5} -o $lib_hr -le ${5} ] ; then
|
||||
- echo "${2} CRITICAL - Cache Hit Rates: $lib_hrx% Lib -- $buf_hrx% Buff|lib=$lib_hrx%;${6};${5};0;100 buffer=$buf_hrx%;${6};${5};0;100"
|
||||
- exit $STATE_CRITICAL
|
||||
- fi
|
||||
- if [ $buf_hr -le ${6} -o $lib_hr -le ${6} ] ; then
|
||||
- echo "${2} WARNING - Cache Hit Rates: $lib_hrx% Lib -- $buf_hrx% Buff|lib=$lib_hrx%;${6};${5};0;100 buffer=$buf_hrx%;${6};${5};0;100"
|
||||
- exit $STATE_WARNING
|
||||
+
|
||||
+ if echo "$result" | grep -q 'ORA-' ; then
|
||||
+ error=$(echo "$result" | grep "ORA-" | head -1)
|
||||
+ echo "CRITICAL - $error"
|
||||
+ exit "$STATE_CRITICAL"
|
||||
+ fi
|
||||
+
|
||||
+ lib_hr=$(echo "$result" | awk '/^[0-9\. \t]+$/ {print int($1)}')
|
||||
+ lib_hrx=$(echo "$result" | awk '/^[0-9\. \t]+$/ {print $1}')
|
||||
+
|
||||
+ if [ "$buf_hr" -le "${5}" ] || [ "$lib_hr" -le "${5}" ] ; then
|
||||
+ echo "${2} CRITICAL - Cache Hit Rates: $lib_hrx% Lib -- $buf_hrx% Buff|lib=$lib_hrx%;${6};${5};0;100 buffer=$buf_hrx%;${6};${5};0;100"
|
||||
+ exit "$STATE_CRITICAL"
|
||||
+ fi
|
||||
+ if [ "$buf_hr" -le "${6}" ] || [ "$lib_hr" -le "${6}" ] ; then
|
||||
+ echo "${2} WARNING - Cache Hit Rates: $lib_hrx% Lib -- $buf_hrx% Buff|lib=$lib_hrx%;${6};${5};0;100 buffer=$buf_hrx%;${6};${5};0;100"
|
||||
+ exit "$STATE_WARNING"
|
||||
fi
|
||||
echo "${2} OK - Cache Hit Rates: $lib_hrx% Lib -- $buf_hrx% Buff|lib=$lib_hrx%;${6};${5};0;100 buffer=$buf_hrx%;${6};${5};0;100"
|
||||
|
||||
- exit $STATE_OK
|
||||
+ exit "$STATE_OK"
|
||||
;;
|
||||
--tablespace)
|
||||
- if [ ${6} -lt ${7} ] ; then
|
||||
- echo "UNKNOWN - Warning level is more then Crit"
|
||||
- exit $STATE_UNKNOWN
|
||||
+ if [ "${6}" -lt "${7}" ] ; then
|
||||
+ echo "UNKNOWN - Warning level is more then Crit"
|
||||
+ exit "$STATE_UNKNOWN"
|
||||
fi
|
||||
- result=`sqlplus -s ${3}/${4}@${2} << EOF
|
||||
+ result=`sqlplus -s "${3}"/"${4}"@"${2}" << EOF
|
||||
set pagesize 0
|
||||
set numf '9999999.99'
|
||||
select NVL(b.free,0.0),a.total,100 - trunc(NVL(b.free,0.0)/a.total * 1000) / 10 prc
|
||||
@@ -273,32 +273,32 @@ from dba_free_space group by tablespace_
|
||||
ON a.tablespace_name=b.tablespace_name WHERE a.tablespace_name='${5}';
|
||||
EOF`
|
||||
|
||||
- if [ -n "`echo $result | grep ORA-`" ] ; then
|
||||
- error=` echo "$result" | grep "ORA-" | head -1`
|
||||
- echo "CRITICAL - $error"
|
||||
- exit $STATE_CRITICAL
|
||||
+ if echo "$result" | grep -q 'ORA-' ; then
|
||||
+ error=$(echo "$result" | grep "ORA-" | head -1)
|
||||
+ echo "CRITICAL - $error"
|
||||
+ exit "$STATE_CRITICAL"
|
||||
fi
|
||||
|
||||
- ts_free=`echo "$result" | awk '/^[ 0-9\.\t ]+$/ {print int($1)}'`
|
||||
- ts_total=`echo "$result" | awk '/^[ 0-9\.\t ]+$/ {print int($2)}'`
|
||||
- ts_pct=`echo "$result" | awk '/^[ 0-9\.\t ]+$/ {print int($3)}'`
|
||||
- ts_pctx=`echo "$result" | awk '/^[ 0-9\.\t ]+$/ {print $3}'`
|
||||
- if [ "$ts_free" -eq 0 -a "$ts_total" -eq 0 -a "$ts_pct" -eq 0 ] ; then
|
||||
+ ts_free=$(echo "$result" | awk '/^[ 0-9\.\t ]+$/ {print int($1)}')
|
||||
+ ts_total=$(echo "$result" | awk '/^[ 0-9\.\t ]+$/ {print int($2)}')
|
||||
+ ts_pct=$(echo "$result" | awk '/^[ 0-9\.\t ]+$/ {print int($3)}')
|
||||
+ ts_pctx=$(echo "$result" | awk '/^[ 0-9\.\t ]+$/ {print $3}')
|
||||
+ if [ "$ts_free" -eq 0 ] && [ "$ts_total" -eq 0 ] && [ "$ts_pct" -eq 0 ] ; then
|
||||
echo "No data returned by Oracle - tablespace $5 not found?"
|
||||
- exit $STATE_UNKNOWN
|
||||
+ exit "$STATE_UNKNOWN"
|
||||
fi
|
||||
- if [ "$ts_pct" -ge ${6} ] ; then
|
||||
- echo "${2} : ${5} CRITICAL - $ts_pctx% used [ $ts_free / $ts_total MB available ]|${5}=$ts_pctx%;${7};${6};0;100"
|
||||
- exit $STATE_CRITICAL
|
||||
- fi
|
||||
- if [ "$ts_pct" -ge ${7} ] ; then
|
||||
- echo "${2} : ${5} WARNING - $ts_pctx% used [ $ts_free / $ts_total MB available ]|${5}=$ts_pctx%;${7};${6};0;100"
|
||||
- exit $STATE_WARNING
|
||||
+ if [ "$ts_pct" -ge "${6}" ] ; then
|
||||
+ echo "${2} : ${5} CRITICAL - $ts_pctx% used [ $ts_free / $ts_total MB available ]|${5}=$ts_pctx%;${7};${6};0;100"
|
||||
+ exit "$STATE_CRITICAL"
|
||||
+ fi
|
||||
+ if [ "$ts_pct" -ge "${7}" ] ; then
|
||||
+ echo "${2} : ${5} WARNING - $ts_pctx% used [ $ts_free / $ts_total MB available ]|${5}=$ts_pctx%;${7};${6};0;100"
|
||||
+ exit "$STATE_WARNING"
|
||||
fi
|
||||
echo "${2} : ${5} OK - $ts_pctx% used [ $ts_free / $ts_total MB available ]|${5}=$ts_pctx%;${7};${6};0;100"
|
||||
- exit $STATE_OK
|
||||
+ exit "$STATE_OK"
|
||||
;;
|
||||
*)
|
||||
print_usage
|
||||
- exit $STATE_UNKNOWN
|
||||
+ exit "$STATE_UNKNOWN"
|
||||
esac
|
||||
Index: monitoring-plugins-2.3.1/plugins-scripts/check_sensors.sh
|
||||
===================================================================
|
||||
--- monitoring-plugins-2.3.1.orig/plugins-scripts/check_sensors.sh
|
||||
+++ monitoring-plugins-2.3.1/plugins-scripts/check_sensors.sh
|
||||
@@ -2,46 +2,46 @@
|
||||
|
||||
PATH="@TRUSTED_PATH@"
|
||||
export PATH
|
||||
-PROGNAME=`basename $0`
|
||||
-PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'`
|
||||
+PROGNAME=$(basename "$0")
|
||||
+PROGPATH=$(echo "$0" | sed -e 's,[\\/][^\\/][^\\/]*$,,')
|
||||
REVISION="@NP_VERSION@"
|
||||
|
||||
-. $PROGPATH/utils.sh
|
||||
+. "$PROGPATH"/utils.sh
|
||||
|
||||
print_usage() {
|
||||
echo "Usage: $PROGNAME" [--ignore-fault]
|
||||
}
|
||||
|
||||
print_help() {
|
||||
- print_revision $PROGNAME $REVISION
|
||||
+ print_revision "$PROGNAME" "$REVISION"
|
||||
echo ""
|
||||
print_usage
|
||||
echo ""
|
||||
echo "This plugin checks hardware status using the lm_sensors package."
|
||||
echo ""
|
||||
support
|
||||
- exit $STATE_OK
|
||||
+ exit "$STATE_OK"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
--help)
|
||||
print_help
|
||||
- exit $STATE_OK
|
||||
+ exit "$STATE_OK"
|
||||
;;
|
||||
-h)
|
||||
print_help
|
||||
- exit $STATE_OK
|
||||
+ exit "$STATE_OK"
|
||||
;;
|
||||
--version)
|
||||
- print_revision $PROGNAME $REVISION
|
||||
- exit $STATE_OK
|
||||
+ print_revision "$PROGNAME" "$REVISION"
|
||||
+ exit "$STATE_OK"
|
||||
;;
|
||||
-V)
|
||||
- print_revision $PROGNAME $REVISION
|
||||
- exit $STATE_OK
|
||||
+ print_revision "$PROGNAME" "$REVISION"
|
||||
+ exit "$STATE_OK"
|
||||
;;
|
||||
*)
|
||||
- sensordata=`sensors 2>&1`
|
||||
+ sensordata=$(sensors 2>&1)
|
||||
status=$?
|
||||
if test ${status} -eq 127; then
|
||||
text="SENSORS UNKNOWN - command not found (did you install lmsensors?)"
|
||||
@@ -49,10 +49,10 @@ case "$1" in
|
||||
elif test ${status} -ne 0; then
|
||||
text="WARNING - sensors returned state $status"
|
||||
exit=$STATE_WARNING
|
||||
- elif echo ${sensordata} | egrep ALARM > /dev/null; then
|
||||
+ elif echo "${sensordata}" | egrep ALARM > /dev/null; then
|
||||
text="SENSOR CRITICAL - Sensor alarm detected!"
|
||||
exit=$STATE_CRITICAL
|
||||
- elif echo ${sensordata} | egrep FAULT > /dev/null \
|
||||
+ elif echo "${sensordata}" | egrep FAULT > /dev/null \
|
||||
&& test "$1" != "-i" -a "$1" != "--ignore-fault"; then
|
||||
text="SENSOR UNKNOWN - Sensor reported fault"
|
||||
exit=$STATE_UNKNOWN
|
||||
@@ -63,8 +63,8 @@ case "$1" in
|
||||
|
||||
echo "$text"
|
||||
if test "$1" = "-v" -o "$1" = "--verbose"; then
|
||||
- echo ${sensordata}
|
||||
+ echo "${sensordata}"
|
||||
fi
|
||||
- exit $exit
|
||||
+ exit "$exit"
|
||||
;;
|
||||
esac
|
||||
Index: monitoring-plugins-2.3.1/plugins-scripts/check_log.sh
|
||||
===================================================================
|
||||
--- monitoring-plugins-2.3.1.orig/plugins-scripts/check_log.sh
|
||||
+++ monitoring-plugins-2.3.1/plugins-scripts/check_log.sh
|
||||
@@ -60,11 +60,11 @@
|
||||
|
||||
PATH="@TRUSTED_PATH@"
|
||||
export PATH
|
||||
-PROGNAME=`basename $0`
|
||||
-PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'`
|
||||
+PROGNAME=$(basename $0)
|
||||
+PROGPATH=$(echo "$0" | sed -e 's,[\\/][^\\/][^\\/]*$,,')
|
||||
REVISION="@NP_VERSION@"
|
||||
|
||||
-. $PROGPATH/utils.sh
|
||||
+. "$PROGPATH"/utils.sh
|
||||
|
||||
print_usage() {
|
||||
echo "Usage: $PROGNAME -F logfile -O oldlog -q query"
|
||||
@@ -73,7 +73,7 @@ print_usage() {
|
||||
}
|
||||
|
||||
print_help() {
|
||||
- print_revision $PROGNAME $REVISION
|
||||
+ print_revision "$PROGNAME" "$REVISION"
|
||||
echo ""
|
||||
print_usage
|
||||
echo ""
|
||||
@@ -87,7 +87,7 @@ print_help() {
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
print_usage
|
||||
- exit $STATE_UNKNOWN
|
||||
+ exit "$STATE_UNKNOWN"
|
||||
fi
|
||||
|
||||
# Grab the command line arguments
|
||||
@@ -100,19 +100,19 @@ while test -n "$1"; do
|
||||
case "$1" in
|
||||
--help)
|
||||
print_help
|
||||
- exit $STATE_OK
|
||||
+ exit "$STATE_OK"
|
||||
;;
|
||||
-h)
|
||||
print_help
|
||||
- exit $STATE_OK
|
||||
+ exit "$STATE_OK"
|
||||
;;
|
||||
--version)
|
||||
- print_revision $PROGNAME $REVISION
|
||||
- exit $STATE_OK
|
||||
+ print_revision "$PROGNAME" "$REVISION"
|
||||
+ exit "$STATE_OK"
|
||||
;;
|
||||
-V)
|
||||
- print_revision $PROGNAME $REVISION
|
||||
- exit $STATE_OK
|
||||
+ print_revision "$PROGNAME" "$REVISION"
|
||||
+ exit "$STATE_OK"
|
||||
;;
|
||||
--filename)
|
||||
logfile="$2"
|
||||
@@ -149,7 +149,7 @@ while test -n "$1"; do
|
||||
*)
|
||||
echo "Unknown argument: $1"
|
||||
print_usage
|
||||
- exit $STATE_UNKNOWN
|
||||
+ exit "$STATE_UNKNOWN"
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
@@ -159,10 +159,10 @@ done
|
||||
|
||||
if [ ! -e "$logfile" ]; then
|
||||
echo "Log check error: Log file $logfile does not exist!"
|
||||
- exit $STATE_UNKNOWN
|
||||
+ exit "$STATE_UNKNOWN"
|
||||
elif [ ! -r "$logfile" ] ; then
|
||||
echo "Log check error: Log file $logfile is not readable!"
|
||||
- exit $STATE_UNKNOWN
|
||||
+ exit "$STATE_UNKNOWN"
|
||||
fi
|
||||
|
||||
# If the old log file doesn't exist, this must be the first time
|
||||
@@ -172,7 +172,7 @@ fi
|
||||
if [ ! -e "$oldlog" ]; then
|
||||
cat "$logfile" > "$oldlog"
|
||||
echo "Log check data initialized..."
|
||||
- exit $STATE_OK
|
||||
+ exit "$STATE_OK"
|
||||
fi
|
||||
|
||||
# The old log file exists, so compare it to the original log now
|
||||
@@ -180,9 +180,9 @@ fi
|
||||
# The temporary file that the script should use while
|
||||
# processing the log file.
|
||||
if [ -x /bin/mktemp ]; then
|
||||
- tempdiff=`/bin/mktemp /tmp/check_log.XXXXXXXXXX`
|
||||
+ tempdiff=$(/bin/mktemp /tmp/check_log.XXXXXXXXXX)
|
||||
else
|
||||
- tempdiff=`/bin/date '+%H%M%S'`
|
||||
+ tempdiff=$(/bin/date '+%H%M%S')
|
||||
tempdiff="/tmp/check_log.${tempdiff}"
|
||||
touch "$tempdiff"
|
||||
chmod 600 "$tempdiff"
|
||||
@@ -191,20 +191,20 @@ fi
|
||||
diff "$logfile" "$oldlog" | grep -v "^>" > "$tempdiff"
|
||||
|
||||
# Count the number of matching log entries we have
|
||||
-count=`grep -c "$query" "$tempdiff"`
|
||||
+count=$(grep -c "$query" "$tempdiff")
|
||||
|
||||
# Get the last matching entry in the diff file
|
||||
-lastentry=`grep "$query" "$tempdiff" | tail -1`
|
||||
+lastentry=$(grep "$query" "$tempdiff" | tail -1)
|
||||
|
||||
rm -f "$tempdiff"
|
||||
cat "$logfile" > "$oldlog"
|
||||
|
||||
if [ "$count" = "0" ]; then # no matches, exit with no error
|
||||
echo "Log check ok - 0 pattern matches found"
|
||||
- exitstatus=$STATE_OK
|
||||
+ exitstatus="$STATE_OK"
|
||||
else # Print total matche count and the last entry we found
|
||||
echo "($count) $lastentry"
|
||||
- exitstatus=$STATE_CRITICAL
|
||||
+ exitstatus="$STATE_CRITICAL"
|
||||
fi
|
||||
|
||||
-exit $exitstatus
|
||||
+exit "$exitstatus"
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f56eb84871983fd719247249e3532228b37e2efaae657a3979bd14ac1f84a35b
|
||||
size 2529669
|
@ -1 +0,0 @@
|
||||
8cb4d72920ed99ff922b6989fe5213ea76b9388e *monitoring-plugins-2.3.1.tar.gz
|
46
monitoring-plugins-2.3.3-check_by_ssh.patch
Normal file
46
monitoring-plugins-2.3.3-check_by_ssh.patch
Normal file
@ -0,0 +1,46 @@
|
||||
Index: monitoring-plugins-2.3.3/plugins/check_by_ssh.c
|
||||
===================================================================
|
||||
--- monitoring-plugins-2.3.3.orig/plugins/check_by_ssh.c
|
||||
+++ monitoring-plugins-2.3.3/plugins/check_by_ssh.c
|
||||
@@ -109,6 +109,13 @@ main (int argc, char **argv)
|
||||
return STATE_UNKNOWN;
|
||||
}
|
||||
|
||||
+ /* SSH returns 255 if connection attempt fails; include the first line of error output */
|
||||
+ if (result == 255 && unknown_timeout) {
|
||||
+ printf (_("SSH connection failed: %s\n"),
|
||||
+ chld_err.lines > 0 ? chld_err.line[0] : "(no error output)");
|
||||
+ return STATE_UNKNOWN;
|
||||
+ }
|
||||
+
|
||||
if (verbose) {
|
||||
for(i = 0; i < chld_out.lines; i++)
|
||||
printf("stdout: %s\n", chld_out.line[i]);
|
||||
@@ -455,12 +462,12 @@ print_help (void)
|
||||
printf (" %s\n", _("Tell ssh to use this configfile [optional]"));
|
||||
printf (" %s\n","-q, --quiet");
|
||||
printf (" %s\n", _("Tell ssh to suppress warning and diagnostic messages [optional]"));
|
||||
- printf (UT_WARN_CRIT);
|
||||
- printf (UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
|
||||
- printf (" %s\n","-U, --unknown-timeout");
|
||||
- printf (" %s\n", _("Make connection problems return UNKNOWN instead of CRITICAL"));
|
||||
- printf (UT_VERBOSE);
|
||||
- printf("\n");
|
||||
+ printf (UT_WARN_CRIT);
|
||||
+ printf (UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
|
||||
+ printf (" %s\n","-U, --unknown-timeout");
|
||||
+ printf (" %s\n", _("Make connection problems return UNKNOWN instead of CRITICAL"));
|
||||
+ printf (UT_VERBOSE);
|
||||
+ printf("\n");
|
||||
printf (" %s\n", _("The most common mode of use is to refer to a local identity file with"));
|
||||
printf (" %s\n", _("the '-i' option. In this mode, the identity pair should have a null"));
|
||||
printf (" %s\n", _("passphrase and the public key should be listed in the authorized_keys"));
|
||||
@@ -479,7 +486,7 @@ print_help (void)
|
||||
printf (" %s\n", "[1080933700] PROCESS_SERVICE_CHECK_RESULT;flint;c2;0; up 2 days");
|
||||
printf (" %s\n", "[1080933700] PROCESS_SERVICE_CHECK_RESULT;flint;c3;0; up 2 days");
|
||||
|
||||
- printf(UT_SUPPORT);
|
||||
+ printf(UT_SUPPORT);
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
Index: monitoring-plugins-2.3.1/plugins-root/check_dhcp.c
|
||||
Index: monitoring-plugins-2.3.3/plugins-root/check_dhcp.c
|
||||
===================================================================
|
||||
--- monitoring-plugins-2.3.1.orig/plugins-root/check_dhcp.c
|
||||
+++ monitoring-plugins-2.3.1/plugins-root/check_dhcp.c
|
||||
--- monitoring-plugins-2.3.3.orig/plugins-root/check_dhcp.c
|
||||
+++ monitoring-plugins-2.3.3/plugins-root/check_dhcp.c
|
||||
@@ -156,6 +156,7 @@ typedef struct dhcp_offer_struct{
|
||||
u_int32_t lease_time; /* lease time in seconds */
|
||||
u_int32_t renewal_time; /* renewal time in seconds */
|
25
monitoring-plugins-2.3.3-check_disk_on_btrfs.patch
Normal file
25
monitoring-plugins-2.3.3-check_disk_on_btrfs.patch
Normal file
@ -0,0 +1,25 @@
|
||||
commit a00fd77179dd6a6c2c96ff09350a9c213c18fd62
|
||||
Author: George Hansper <george@hansper.id.au>
|
||||
Date: Tue Sep 22 19:06:57 2020 +1000
|
||||
|
||||
check_disk - fix false DISK CRITICAL alert for btrfs filesystems due to BSD Gnulib workaround
|
||||
|
||||
Index: monitoring-plugins-2.3.3/plugins/check_disk.c
|
||||
===================================================================
|
||||
--- monitoring-plugins-2.3.3.orig/plugins/check_disk.c
|
||||
+++ monitoring-plugins-2.3.3/plugins/check_disk.c
|
||||
@@ -1041,7 +1041,14 @@ get_stats (struct parameter_list *p, str
|
||||
|
||||
void
|
||||
get_path_stats (struct parameter_list *p, struct fs_usage *fsp) {
|
||||
+#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(OpenBSD )
|
||||
+ /* 2007-12-08 - Workaround for Gnulib reporting insanely high available
|
||||
+ * space on BSD (the actual value should be negative but fsp->fsu_bavail
|
||||
+ * is unsigned) */
|
||||
+ p->available = fsp->fsu_bavail > fsp->fsu_bfree ? 0 : fsp->fsu_bavail;
|
||||
+#else
|
||||
p->available = fsp->fsu_bavail;
|
||||
+#endif
|
||||
p->available_to_root = fsp->fsu_bfree;
|
||||
p->used = fsp->fsu_blocks - fsp->fsu_bfree;
|
||||
if (freespace_ignore_reserved) {
|
169
monitoring-plugins-2.3.3-check_http-proxy.patch
Normal file
169
monitoring-plugins-2.3.3-check_http-proxy.patch
Normal file
@ -0,0 +1,169 @@
|
||||
diff --git a/plugins/check_http.c b/plugins/check_http.c
|
||||
index 8dda046f..2ab6a7a3 100644
|
||||
--- a/plugins/check_http.c
|
||||
+++ b/plugins/check_http.c
|
||||
@@ -126,6 +126,9 @@ int sd;
|
||||
int min_page_len = 0;
|
||||
int max_page_len = 0;
|
||||
int redir_depth = 0;
|
||||
+bool ssl_proxy = false;
|
||||
+char *proxy_server_address;
|
||||
+int proxy_server_port;
|
||||
int max_depth = DEFAULT_MAX_REDIRS;
|
||||
char *http_method;
|
||||
char *http_method_proxy;
|
||||
@@ -139,6 +142,7 @@ char *client_privkey = NULL;
|
||||
bool process_arguments (int, char **);
|
||||
int check_http (void);
|
||||
void redir (char *pos, char *status_line);
|
||||
+const char *find_uri_path (const char *url);
|
||||
bool server_type_check(const char *type);
|
||||
int server_port_check(int ssl_flag);
|
||||
char *perfd_time (double microsec);
|
||||
@@ -608,6 +612,17 @@ bool process_arguments (int argc, char **argv)
|
||||
if (virtual_port == 0)
|
||||
virtual_port = server_port;
|
||||
|
||||
+ /* if we are called with the -I option, the -j method is CONNECT and */
|
||||
+ /* we received -S for SSL, then we tunnel the request through a proxy*/
|
||||
+ /* @20100414, public[at]frank4dd.com, http://www.frank4dd.com/howto */
|
||||
+
|
||||
+ ssl_proxy = server_address != NULL && strcmp(http_method, "CONNECT") == 0
|
||||
+ && host_name != NULL && use_ssl == true;
|
||||
+ if (ssl_proxy) {
|
||||
+ proxy_server_address = strdup(server_address);
|
||||
+ proxy_server_port = server_port;
|
||||
+ }
|
||||
+
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -939,18 +954,18 @@ check_http (void)
|
||||
|
||||
/* try to connect to the host at the given port number */
|
||||
gettimeofday (&tv_temp, NULL);
|
||||
- if (my_tcp_connect (server_address, server_port, &sd) != STATE_OK)
|
||||
+ result = ssl_proxy ?
|
||||
+ my_tcp_connect (proxy_server_address, proxy_server_port, &sd) :
|
||||
+ my_tcp_connect (server_address, server_port, &sd);
|
||||
+ if (result != STATE_OK)
|
||||
die (STATE_CRITICAL, _("HTTP CRITICAL - Unable to open TCP socket\n"));
|
||||
microsec_connect = deltime (tv_temp);
|
||||
|
||||
- /* if we are called with the -I option, the -j method is CONNECT and */
|
||||
- /* we received -S for SSL, then we tunnel the request through a proxy*/
|
||||
- /* @20100414, public[at]frank4dd.com, http://www.frank4dd.com/howto */
|
||||
+ /* handle connection via SSL proxy */
|
||||
+ if (ssl_proxy) {
|
||||
|
||||
- if ( server_address != NULL && strcmp(http_method, "CONNECT") == 0
|
||||
- && host_name != NULL && use_ssl == true) {
|
||||
-
|
||||
- if (verbose) printf ("Entering CONNECT tunnel mode with proxy %s:%d to dst %s:%d\n", server_address, server_port, host_name, HTTPS_PORT);
|
||||
+ if (verbose) printf ("Entering CONNECT tunnel mode with proxy %s:%d to dst %s:%d\n",
|
||||
+ proxy_server_address, proxy_server_port, host_name, HTTPS_PORT);
|
||||
asprintf (&buf, "%s %s:%d HTTP/1.1\r\n%s\r\n", http_method, host_name, HTTPS_PORT, user_agent);
|
||||
if (strlen(proxy_auth)) {
|
||||
base64_encode_alloc (proxy_auth, strlen (proxy_auth), &auth);
|
||||
@@ -985,7 +1000,7 @@ check_http (void)
|
||||
if (use_ssl == true) {
|
||||
gettimeofday (&tv_temp, NULL);
|
||||
result = np_net_ssl_init_with_hostname_version_and_cert(sd, (use_sni ? host_name : NULL), ssl_version, client_cert, client_privkey);
|
||||
- if (verbose) printf ("SSL initialized\n");
|
||||
+ if (verbose) printf ("SSL initialization %s\n", result == STATE_OK ? "successful" : "failed");
|
||||
if (result != STATE_OK)
|
||||
die (STATE_CRITICAL, NULL);
|
||||
microsec_ssl = deltime (tv_temp);
|
||||
@@ -1001,9 +1016,8 @@ check_http (void)
|
||||
}
|
||||
#endif /* HAVE_SSL */
|
||||
|
||||
- if ( server_address != NULL && strcmp(http_method, "CONNECT") == 0
|
||||
- && host_name != NULL && use_ssl == true)
|
||||
- asprintf (&buf, "%s %s %s\r\n%s\r\n", http_method_proxy, server_url, host_name ? "HTTP/1.1" : "HTTP/1.0", user_agent);
|
||||
+ if (ssl_proxy)
|
||||
+ asprintf (&buf, "%s %s %s\r\n%s\r\n", http_method_proxy, find_uri_path(server_url), host_name ? "HTTP/1.1" : "HTTP/1.0", user_agent);
|
||||
else
|
||||
asprintf (&buf, "%s %s %s\r\n%s\r\n", http_method, server_url, host_name ? "HTTP/1.1" : "HTTP/1.0", user_agent);
|
||||
|
||||
@@ -1032,8 +1046,7 @@ check_http (void)
|
||||
*/
|
||||
if ((use_ssl == false && virtual_port == HTTP_PORT) ||
|
||||
(use_ssl == true && virtual_port == HTTPS_PORT) ||
|
||||
- (server_address != NULL && strcmp(http_method, "CONNECT") == 0
|
||||
- && host_name != NULL && use_ssl == true))
|
||||
+ ssl_proxy)
|
||||
xasprintf (&buf, "%sHost: %s\r\n", buf, host_name);
|
||||
else
|
||||
xasprintf (&buf, "%sHost: %s:%d\r\n", buf, host_name, virtual_port);
|
||||
@@ -1137,10 +1150,17 @@ check_http (void)
|
||||
/* leave full_page untouched so we can free it later */
|
||||
page = full_page;
|
||||
|
||||
- if (verbose)
|
||||
- printf ("%s://%s:%d%s is %d characters\n",
|
||||
- use_ssl ? "https" : "http", server_address,
|
||||
- server_port, server_url, (int)pagesize);
|
||||
+ if (verbose) {
|
||||
+ if (ssl_proxy) {
|
||||
+ printf ("[via proxy %s://%s:%d] %s returned %d bytes\n",
|
||||
+ use_ssl ? "https" : "http", proxy_server_address, proxy_server_port,
|
||||
+ server_url, (int)pagesize);
|
||||
+ } else {
|
||||
+ printf ("%s://%s:%d%s returned %d bytes\n",
|
||||
+ use_ssl ? "https" : "http", server_address,
|
||||
+ server_port, server_url, (int)pagesize);
|
||||
+ }
|
||||
+ }
|
||||
|
||||
/* find status line and null-terminate it */
|
||||
status_line = page;
|
||||
@@ -1300,7 +1320,12 @@ check_http (void)
|
||||
bcopy("...", &output_string_search[sizeof(output_string_search) - 4],
|
||||
4);
|
||||
}
|
||||
- xasprintf (&msg, _("%sstring '%s' not found on '%s://%s:%d%s', "), msg, output_string_search, use_ssl ? "https" : "http", host_name ? host_name : server_address, server_port, server_url);
|
||||
+ if (ssl_proxy) {
|
||||
+ xasprintf (&msg, _("%sstring '%s' not found on '%s', "), msg, output_string_search, server_url);
|
||||
+ } else {
|
||||
+ xasprintf (&msg, _("%sstring '%s' not found on '%s://%s:%d%s', "), msg, output_string_search,
|
||||
+ use_ssl ? "https" : "http", host_name ? host_name : server_address, server_port, server_url);
|
||||
+ }
|
||||
result = STATE_CRITICAL;
|
||||
}
|
||||
}
|
||||
@@ -1642,6 +1667,25 @@ redir (char *pos, char *status_line)
|
||||
check_http ();
|
||||
}
|
||||
|
||||
+// Locate the URI path inside a complete URL. If we fail, just return the original URL.
|
||||
+const char *
|
||||
+find_uri_path (const char *url)
|
||||
+{
|
||||
+ const char *s = url;
|
||||
+
|
||||
+ if (strncmp(s, "http://", 7) == 0)
|
||||
+ s += 7;
|
||||
+ else if (strncmp(s, "https://", 8) == 0)
|
||||
+ s += 8;
|
||||
+ else
|
||||
+ return url;
|
||||
+ while (*s != '\0') {
|
||||
+ if (strchr("/?#", *s) != NULL)
|
||||
+ return s;
|
||||
+ s++;
|
||||
+ }
|
||||
+ return url;
|
||||
+}
|
||||
|
||||
bool
|
||||
server_type_check (const char *type)
|
||||
@@ -1861,7 +1905,7 @@ print_help (void)
|
||||
printf (" %s\n", _("a STATE_OK is returned. When the certificate is still valid, but for less than"));
|
||||
printf (" %s\n", _("30 days, but more than 14 days, a STATE_WARNING is returned."));
|
||||
printf (" %s\n", _("A STATE_CRITICAL will be returned when certificate expires in less than 14 days"));
|
||||
-
|
||||
+ printf ("\n");
|
||||
printf (" %s\n\n", "CHECK SSL WEBSERVER CONTENT VIA PROXY USING HTTP 1.1 CONNECT: ");
|
||||
printf (" %s\n", _("check_http -I 192.168.100.35 -p 80 -u https://www.verisign.com/ -S -j CONNECT -H www.verisign.com "));
|
||||
printf (" %s\n", _("all these options are needed: -I <proxy> -p <proxy-port> -u <check-url> -S(sl) -j CONNECT -H <webserver>"));
|
12
monitoring-plugins-2.3.3-check_icmp.patch
Normal file
12
monitoring-plugins-2.3.3-check_icmp.patch
Normal file
@ -0,0 +1,12 @@
|
||||
Index: monitoring-plugins-2.3.3/plugins-root/check_icmp.c
|
||||
===================================================================
|
||||
--- monitoring-plugins-2.3.3.orig/plugins-root/check_icmp.c
|
||||
+++ monitoring-plugins-2.3.3/plugins-root/check_icmp.c
|
||||
@@ -1446,6 +1446,7 @@ get_ip_address(const char *ifname)
|
||||
#else
|
||||
errno = 0;
|
||||
crash("Cannot get interface IP address on this platform.");
|
||||
+ return INADDR_NONE;
|
||||
#endif
|
||||
}
|
||||
|
33
monitoring-plugins-2.3.3-check_log_-_quoting.patch
Normal file
33
monitoring-plugins-2.3.3-check_log_-_quoting.patch
Normal file
@ -0,0 +1,33 @@
|
||||
Index: monitoring-plugins-2.3.3/plugins-scripts/check_log.sh
|
||||
===================================================================
|
||||
--- monitoring-plugins-2.3.3.orig/plugins-scripts/check_log.sh
|
||||
+++ monitoring-plugins-2.3.3/plugins-scripts/check_log.sh
|
||||
@@ -112,23 +112,23 @@ while test -n "$1"; do
|
||||
exit "$STATE_OK"
|
||||
;;
|
||||
-F | --filename)
|
||||
- logfile=$2
|
||||
+ logfile="$2"
|
||||
shift 2
|
||||
;;
|
||||
-O | --oldlog)
|
||||
- oldlog=$2
|
||||
+ oldlog="$2"
|
||||
shift 2
|
||||
;;
|
||||
-q | --query)
|
||||
- query=$2
|
||||
+ query="$2"
|
||||
shift 2
|
||||
;;
|
||||
--exclude)
|
||||
- exclude=$2
|
||||
+ exclude="$2"
|
||||
shift 2
|
||||
;;
|
||||
-x | --exitstatus)
|
||||
- exitstatus=$2
|
||||
+ exitstatus="$2"
|
||||
shift 2
|
||||
;;
|
||||
-e | --extended-regex)
|
@ -1,7 +1,7 @@
|
||||
Index: monitoring-plugins-2.3.1/plugins/check_ntp_time.c
|
||||
Index: monitoring-plugins-2.3.3/plugins/check_ntp_time.c
|
||||
===================================================================
|
||||
--- monitoring-plugins-2.3.1.orig/plugins/check_ntp_time.c
|
||||
+++ monitoring-plugins-2.3.1/plugins/check_ntp_time.c
|
||||
--- monitoring-plugins-2.3.3.orig/plugins/check_ntp_time.c
|
||||
+++ monitoring-plugins-2.3.3/plugins/check_ntp_time.c
|
||||
@@ -533,7 +533,7 @@ int process_arguments(int argc, char **a
|
||||
|
||||
char *perfd_offset (double offset)
|
@ -1,8 +1,8 @@
|
||||
Index: monitoring-plugins-2.3.1/plugins/check_snmp.c
|
||||
Index: monitoring-plugins-2.3.3/plugins/check_snmp.c
|
||||
===================================================================
|
||||
--- monitoring-plugins-2.3.1.orig/plugins/check_snmp.c
|
||||
+++ monitoring-plugins-2.3.1/plugins/check_snmp.c
|
||||
@@ -576,7 +576,7 @@ main (int argc, char **argv)
|
||||
--- monitoring-plugins-2.3.3.orig/plugins/check_snmp.c
|
||||
+++ monitoring-plugins-2.3.3/plugins/check_snmp.c
|
||||
@@ -594,7 +594,7 @@ main (int argc, char **argv)
|
||||
len = sizeof(perfstr)-strlen(perfstr)-1;
|
||||
strncat(perfstr, show, len>ptr-show ? ptr-show : len);
|
||||
|
@ -26,11 +26,20 @@ Signed-off-by: Anton Lofgren <alofgren@op5.com>
|
||||
plugins/t/check_ssh.t | 97 ++++++++++++++++++++++++++-------
|
||||
2 files changed, 164 insertions(+), 55 deletions(-)
|
||||
|
||||
diff --git a/plugins/check_ssh.c b/plugins/check_ssh.c
|
||||
index 3658965e5..fc2ceb78b 100644
|
||||
--- a/plugins/check_ssh.c
|
||||
+++ b/plugins/check_ssh.c
|
||||
@@ -215,8 +215,13 @@ ssh_connect (char *haddr, int hport, char *remote_version, char *remote_protocol
|
||||
Index: monitoring-plugins-2.3.3/plugins/check_ssh.c
|
||||
===================================================================
|
||||
--- monitoring-plugins-2.3.3.orig/plugins/check_ssh.c
|
||||
+++ monitoring-plugins-2.3.3/plugins/check_ssh.c
|
||||
@@ -106,7 +106,7 @@ process_arguments (int argc, char **argv
|
||||
{"timeout", required_argument, 0, 't'},
|
||||
{"verbose", no_argument, 0, 'v'},
|
||||
{"remote-version", required_argument, 0, 'r'},
|
||||
- {"remote-protcol", required_argument, 0, 'P'},
|
||||
+ {"remote-protocol", required_argument, 0, 'P'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
@@ -215,8 +215,13 @@ ssh_connect (char *haddr, int hport, cha
|
||||
{
|
||||
int sd;
|
||||
int result;
|
||||
@ -44,7 +53,7 @@ index 3658965e5..fc2ceb78b 100644
|
||||
char *ssh_proto = NULL;
|
||||
char *ssh_server = NULL;
|
||||
static char *rev_no = VERSION;
|
||||
@@ -231,51 +236,94 @@ ssh_connect (char *haddr, int hport, char *remote_version, char *remote_protocol
|
||||
@@ -231,51 +236,118 @@ ssh_connect (char *haddr, int hport, cha
|
||||
return result;
|
||||
|
||||
output = (char *) malloc (BUFF_SZ + 1);
|
||||
@ -95,11 +104,35 @@ index 3658965e5..fc2ceb78b 100644
|
||||
+ printf("SSH CRITICAL - No version control string received");
|
||||
+ exit(STATE_CRITICAL);
|
||||
+ }
|
||||
+ /*
|
||||
+ * "When the connection has been established, both sides MUST send an
|
||||
+ * identification string. This identification string MUST be
|
||||
+ *
|
||||
+ * SSH-protoversion-softwareversion SP comments CR LF"
|
||||
+ * - RFC 4253:4.2
|
||||
+ */
|
||||
+ strip (version_control_string);
|
||||
+ if (verbose)
|
||||
+ printf ("%s\n", version_control_string);
|
||||
+ ssh_proto = version_control_string + 4;
|
||||
+ ssh_server = ssh_proto + strspn (ssh_proto, "-0123456789.");
|
||||
+
|
||||
+ /*
|
||||
+ * We assume the protoversion is of the form Major.Minor, although
|
||||
+ * this is not _strictly_ required. See
|
||||
+ *
|
||||
+ * "Both the 'protoversion' and 'softwareversion' strings MUST consist of
|
||||
+ * printable US-ASCII characters, with the exception of whitespace
|
||||
+ * characters and the minus sign (-)"
|
||||
+ * - RFC 4253:4.2
|
||||
+ * and,
|
||||
+ *
|
||||
+ * "As stated earlier, the 'protoversion' specified for this protocol is
|
||||
+ * "2.0". Earlier versions of this protocol have not been formally
|
||||
+ * documented, but it is widely known that they use 'protoversion' of
|
||||
+ * "1.x" (e.g., "1.5" or "1.3")."
|
||||
+ * - RFC 4253:5
|
||||
+ */
|
||||
+ ssh_server = ssh_proto + strspn (ssh_proto, "0123456789.") + 1; /* (+1 for the '-' separating protoversion from softwareversion) */
|
||||
+
|
||||
+ /* If there's a space in the version string, whatever's after the space is a comment
|
||||
+ * (which is NOT part of the server name/version)*/
|
||||
@ -131,8 +164,7 @@ index 3658965e5..fc2ceb78b 100644
|
||||
- close(sd);
|
||||
- exit (STATE_CRITICAL);
|
||||
- }
|
||||
+ ssh_proto[strspn (ssh_proto, "0123456789. ")] = 0;
|
||||
|
||||
-
|
||||
- if (remote_protocol && strcmp(remote_protocol, ssh_proto)) {
|
||||
- printf
|
||||
- (_("SSH CRITICAL - %s (protocol %s) protocol version mismatch, expected '%s'\n"),
|
||||
@ -140,31 +172,33 @@ index 3658965e5..fc2ceb78b 100644
|
||||
- close(sd);
|
||||
- exit (STATE_CRITICAL);
|
||||
- }
|
||||
+ ssh_proto[strspn (ssh_proto, "0123456789. ")] = 0;
|
||||
|
||||
- elapsed_time = (double)deltime(tv) / 1.0e6;
|
||||
+ xasprintf (&buffer, "SSH-%s-check_ssh_%s\r\n", ssh_proto, rev_no);
|
||||
+ send (sd, buffer, strlen (buffer), MSG_DONTWAIT);
|
||||
+ if (verbose)
|
||||
+ printf ("%s\n", buffer);
|
||||
|
||||
- elapsed_time = (double)deltime(tv) / 1.0e6;
|
||||
+ if (remote_version && strcmp(remote_version, ssh_server)) {
|
||||
+ printf
|
||||
+ (_("SSH CRITICAL - %s (protocol %s) version mismatch, expected '%s'\n"),
|
||||
+ ssh_server, ssh_proto, remote_version);
|
||||
+ close(sd);
|
||||
+ exit (STATE_CRITICAL);
|
||||
+ }
|
||||
|
||||
+ if (remote_protocol && strcmp(remote_protocol, ssh_proto)) {
|
||||
printf
|
||||
- (_("SSH OK - %s (protocol %s) | %s\n"),
|
||||
- ssh_server, ssh_proto, fperfdata("time", elapsed_time, "s",
|
||||
- FALSE, 0, FALSE, 0, TRUE, 0, TRUE, (int)socket_timeout));
|
||||
+ (_("SSH CRITICAL - %s (protocol %s) protocol version mismatch, expected '%s'\n"),
|
||||
+ ssh_server, ssh_proto, remote_protocol);
|
||||
+ (_("SSH CRITICAL - %s (protocol %s) version mismatch, expected '%s'\n"),
|
||||
+ ssh_server, ssh_proto, remote_version);
|
||||
close(sd);
|
||||
- exit (STATE_OK);
|
||||
+ exit (STATE_CRITICAL);
|
||||
}
|
||||
+
|
||||
+ if (remote_protocol && strcmp(remote_protocol, ssh_proto)) {
|
||||
+ printf
|
||||
+ (_("SSH CRITICAL - %s (protocol %s) protocol version mismatch, expected '%s'\n"),
|
||||
+ ssh_server, ssh_proto, remote_protocol);
|
||||
+ close(sd);
|
||||
+ exit (STATE_CRITICAL);
|
||||
+ }
|
||||
+ elapsed_time = (double)deltime(tv) / 1.0e6;
|
||||
+
|
||||
+ printf
|
||||
@ -176,71 +210,3 @@ index 3658965e5..fc2ceb78b 100644
|
||||
}
|
||||
|
||||
|
||||
diff --git a/plugins/check_ssh.c b/plugins/check_ssh.c
|
||||
index fc2ceb78b..7b576895f 100644
|
||||
--- a/plugins/check_ssh.c
|
||||
+++ b/plugins/check_ssh.c
|
||||
@@ -278,11 +278,35 @@ ssh_connect (char *haddr, int hport, char *remote_version, char *remote_protocol
|
||||
printf("SSH CRITICAL - No version control string received");
|
||||
exit(STATE_CRITICAL);
|
||||
}
|
||||
+ /*
|
||||
+ * "When the connection has been established, both sides MUST send an
|
||||
+ * identification string. This identification string MUST be
|
||||
+ *
|
||||
+ * SSH-protoversion-softwareversion SP comments CR LF"
|
||||
+ * - RFC 4253:4.2
|
||||
+ */
|
||||
strip (version_control_string);
|
||||
if (verbose)
|
||||
printf ("%s\n", version_control_string);
|
||||
ssh_proto = version_control_string + 4;
|
||||
- ssh_server = ssh_proto + strspn (ssh_proto, "-0123456789.");
|
||||
+
|
||||
+ /*
|
||||
+ * We assume the protoversion is of the form Major.Minor, although
|
||||
+ * this is not _strictly_ required. See
|
||||
+ *
|
||||
+ * "Both the 'protoversion' and 'softwareversion' strings MUST consist of
|
||||
+ * printable US-ASCII characters, with the exception of whitespace
|
||||
+ * characters and the minus sign (-)"
|
||||
+ * - RFC 4253:4.2
|
||||
+ * and,
|
||||
+ *
|
||||
+ * "As stated earlier, the 'protoversion' specified for this protocol is
|
||||
+ * "2.0". Earlier versions of this protocol have not been formally
|
||||
+ * documented, but it is widely known that they use 'protoversion' of
|
||||
+ * "1.x" (e.g., "1.5" or "1.3")."
|
||||
+ * - RFC 4253:5
|
||||
+ */
|
||||
+ ssh_server = ssh_proto + strspn (ssh_proto, "0123456789.") + 1; /* (+1 for the '-' separating protoversion from softwareversion) */
|
||||
|
||||
/* If there's a space in the version string, whatever's after the space is a comment
|
||||
* (which is NOT part of the server name/version)*/
|
||||
|
||||
|
||||
From 59bed139e84fd6342d4203ebebca28bf2f4dcc82 Mon Sep 17 00:00:00 2001
|
||||
From: Anton Lofgren <alofgren@op5.com>
|
||||
Date: Fri, 30 Jan 2015 10:52:20 +0100
|
||||
Subject: [PATCH 4/4] check_ssh: Fix a typo in "remote-protocol parameter
|
||||
|
||||
remote-protcol -> remote-protocol
|
||||
|
||||
Signed-off-by: Anton Lofgren <alofgren@op5.com>
|
||||
---
|
||||
plugins/check_ssh.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/plugins/check_ssh.c b/plugins/check_ssh.c
|
||||
index 7b576895f..f12f34051 100644
|
||||
--- a/plugins/check_ssh.c
|
||||
+++ b/plugins/check_ssh.c
|
||||
@@ -106,7 +106,7 @@ process_arguments (int argc, char **argv)
|
||||
{"timeout", required_argument, 0, 't'},
|
||||
{"verbose", no_argument, 0, 'v'},
|
||||
{"remote-version", required_argument, 0, 'r'},
|
||||
- {"remote-protcol", required_argument, 0, 'P'},
|
||||
+ {"remote-protocol", required_argument, 0, 'P'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
@ -1,7 +1,7 @@
|
||||
Index: monitoring-plugins-2.3.1/plugins/t/check_ssh.t
|
||||
Index: monitoring-plugins-2.3.3/plugins/t/check_ssh.t
|
||||
===================================================================
|
||||
--- monitoring-plugins-2.3.1.orig/plugins/t/check_ssh.t
|
||||
+++ monitoring-plugins-2.3.1/plugins/t/check_ssh.t
|
||||
--- monitoring-plugins-2.3.3.orig/plugins/t/check_ssh.t
|
||||
+++ monitoring-plugins-2.3.3/plugins/t/check_ssh.t
|
||||
@@ -8,34 +8,105 @@ use strict;
|
||||
use Test::More;
|
||||
use NPTest;
|
||||
@ -21,7 +21,8 @@ Index: monitoring-plugins-2.3.1/plugins/t/check_ssh.t
|
||||
- );
|
||||
-cmp_ok($result->return_code, '==', 0, "Exit with return code 0 (OK)");
|
||||
-like($result->output, '/^SSH OK - /', "Status text if command returned none (OK)");
|
||||
-
|
||||
+my $res;
|
||||
|
||||
-
|
||||
-$result = NPTest->testCmd(
|
||||
- "./check_ssh -H $host_nonresponsive -t 2"
|
||||
@ -36,8 +37,6 @@ Index: monitoring-plugins-2.3.1/plugins/t/check_ssh.t
|
||||
- );
|
||||
-cmp_ok($result->return_code, '==', 3, "Exit with return code 0 (OK)");
|
||||
-like($result->output, '/^check_ssh: Invalid hostname/', "Status text if command returned none (OK)");
|
||||
+my $res;
|
||||
|
||||
+# Required parameters
|
||||
+my $ssh_host = getTestParameter("NP_SSH_HOST",
|
||||
+ "A host providing SSH service",
|
||||
@ -137,4 +136,4 @@ Index: monitoring-plugins-2.3.1/plugins/t/check_ssh.t
|
||||
+ cmp_ok( $res->return_code, '==', 0, "Got delayed SSH protocol version control string");
|
||||
+ like( $res->output, '/^SSH OK - nagiosplug.ssh.0.2 \(protocol 2.0\)/', "Output OK");
|
||||
+ close NC;
|
||||
+
|
||||
|
@ -30,22 +30,20 @@ Closes: https://github.com/monitoring-plugins/monitoring-plugins/issues/1508
|
||||
plugins/check_mysql_query.c | 8 ++++++--
|
||||
2 files changed, 12 insertions(+), 4 deletions(-)
|
||||
|
||||
Index: monitoring-plugins-2.3.1/plugins/check_mysql.c
|
||||
Index: monitoring-plugins-2.3.3/plugins/check_mysql.c
|
||||
===================================================================
|
||||
--- monitoring-plugins-2.3.1.orig/plugins/check_mysql.c
|
||||
+++ monitoring-plugins-2.3.1/plugins/check_mysql.c
|
||||
@@ -36,6 +36,10 @@ const char *email = "devel@monitoring-pl
|
||||
--- monitoring-plugins-2.3.3.orig/plugins/check_mysql.c
|
||||
+++ monitoring-plugins-2.3.3/plugins/check_mysql.c
|
||||
@@ -35,6 +35,8 @@ const char *copyright = "1999-2011";
|
||||
const char *email = "devel@monitoring-plugins.org";
|
||||
|
||||
#define SLAVERESULTSIZE 70
|
||||
|
||||
+/* The default port that MySQL servers listen on. */
|
||||
+#define CHECK_PORT_DEFAULT 3306
|
||||
+
|
||||
+
|
||||
|
||||
#include "common.h"
|
||||
#include "utils.h"
|
||||
#include "utils_base.h"
|
||||
@@ -58,7 +62,7 @@ char *ciphers = NULL;
|
||||
@@ -58,7 +60,7 @@ char *ciphers = NULL;
|
||||
bool ssl = false;
|
||||
char *opt_file = NULL;
|
||||
char *opt_group = NULL;
|
||||
@ -54,7 +52,7 @@ Index: monitoring-plugins-2.3.1/plugins/check_mysql.c
|
||||
int check_slave = 0, warn_sec = 0, crit_sec = 0;
|
||||
int ignore_auth = 0;
|
||||
int verbose = 0;
|
||||
@@ -508,7 +512,7 @@ void
|
||||
@@ -508,7 +510,7 @@ void
|
||||
print_help (void)
|
||||
{
|
||||
char *myport;
|
||||
@ -63,22 +61,21 @@ Index: monitoring-plugins-2.3.1/plugins/check_mysql.c
|
||||
|
||||
print_revision (progname, NP_VERSION);
|
||||
|
||||
Index: monitoring-plugins-2.3.1/plugins/check_mysql_query.c
|
||||
Index: monitoring-plugins-2.3.3/plugins/check_mysql_query.c
|
||||
===================================================================
|
||||
--- monitoring-plugins-2.3.1.orig/plugins/check_mysql_query.c
|
||||
+++ monitoring-plugins-2.3.1/plugins/check_mysql_query.c
|
||||
@@ -33,6 +33,10 @@ const char *progname = "check_mysql_quer
|
||||
--- monitoring-plugins-2.3.3.orig/plugins/check_mysql_query.c
|
||||
+++ monitoring-plugins-2.3.3/plugins/check_mysql_query.c
|
||||
@@ -33,6 +33,9 @@ const char *progname = "check_mysql_quer
|
||||
const char *copyright = "1999-2007";
|
||||
const char *email = "devel@monitoring-plugins.org";
|
||||
|
||||
+/* The default port that MySQL servers listen on. */
|
||||
+#define CHECK_PORT_DEFAULT 3306
|
||||
+
|
||||
+
|
||||
#include "common.h"
|
||||
#include "utils.h"
|
||||
#include "utils_base.h"
|
||||
@@ -48,7 +52,7 @@ char *db_pass = NULL;
|
||||
@@ -48,7 +51,7 @@ char *db_pass = NULL;
|
||||
char *db = NULL;
|
||||
char *opt_file = NULL;
|
||||
char *opt_group = NULL;
|
||||
@ -87,7 +84,7 @@ Index: monitoring-plugins-2.3.1/plugins/check_mysql_query.c
|
||||
|
||||
int process_arguments (int, char **);
|
||||
int validate_arguments (void);
|
||||
@@ -299,7 +303,7 @@ void
|
||||
@@ -299,7 +302,7 @@ void
|
||||
print_help (void)
|
||||
{
|
||||
char *myport;
|
@ -0,0 +1,21 @@
|
||||
Index: monitoring-plugins-2.3.3/plugins-root/Makefile.am
|
||||
===================================================================
|
||||
--- monitoring-plugins-2.3.3.orig/plugins-root/Makefile.am
|
||||
+++ monitoring-plugins-2.3.3/plugins-root/Makefile.am
|
||||
@@ -49,7 +49,6 @@ INSTALL_SUID = \
|
||||
p=$$f; \
|
||||
echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libexecdir)/$$p"; \
|
||||
$(INSTALL_PROGRAM) $$p $(DESTDIR)$(libexecdir)/$$p; \
|
||||
- echo " chown root $(DESTDIR)$(libexecdir)/$$p"; \
|
||||
chown root $(DESTDIR)$(libexecdir)/$$p; \
|
||||
echo " chmod $(setuid_root_mode) $(DESTDIR)$(libexecdir)/$$p"; \
|
||||
chmod $(setuid_root_mode) $(DESTDIR)$(libexecdir)/$$p; \
|
||||
@@ -64,7 +63,7 @@ install-exec-local: $(noinst_PROGRAMS)
|
||||
echo > $$TMPFILE; \
|
||||
## See if we can create a setuid root executable in $(libexecdir).
|
||||
## If not, then don't even try to install setuid plugins.
|
||||
- can_create_suid_root_executable=no; \
|
||||
+ can_create_suid_root_executable=yes; \
|
||||
chown root $$TMPFILE > /dev/null 2>&1 \
|
||||
&& chmod $(setuid_root_mode) $$TMPFILE > /dev/null 2>&1 \
|
||||
&& can_create_suid_root_executable=yes; \
|
@ -29,16 +29,16 @@ SWAP CRITICAL - 0% free (0 MB out of 0 MB) |swap=0MB;0;0;0;0
|
||||
Additional info:
|
||||
https://bugzilla.redhat.com/512559
|
||||
|
||||
Index: monitoring-plugins-2.3.1/plugins/check_swap.c
|
||||
Index: monitoring-plugins-2.3.3/plugins/check_swap.c
|
||||
===================================================================
|
||||
--- monitoring-plugins-2.3.1.orig/plugins/check_swap.c
|
||||
+++ monitoring-plugins-2.3.1/plugins/check_swap.c
|
||||
@@ -125,7 +125,7 @@ main (int argc, char **argv)
|
||||
--- monitoring-plugins-2.3.3.orig/plugins/check_swap.c
|
||||
+++ monitoring-plugins-2.3.3/plugins/check_swap.c
|
||||
@@ -137,7 +137,7 @@ main (int argc, char **argv)
|
||||
free_swap_mb += dskfree_mb;
|
||||
if (allswaps) {
|
||||
if (dsktotal_mb == 0)
|
||||
- percent=100.0;
|
||||
+ percent = 0.0;
|
||||
+ percent= 0.0;
|
||||
else
|
||||
percent = 100 * (((double) dskused_mb) / ((double) dsktotal_mb));
|
||||
result = max_state (result, check_swap (percent, dskfree_mb, dsktotal_mb));
|
||||
result = max_state (result, check_swap (dskfree_mb, dsktotal_mb));
|
3
monitoring-plugins-2.3.3.tar.gz
Normal file
3
monitoring-plugins-2.3.3.tar.gz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7023b1dc17626c5115b061e7ce02e06f006e35af92abf473334dffe7ff3c2d6d
|
||||
size 2620192
|
1
monitoring-plugins-2.3.3.tar.gz.sha1
Normal file
1
monitoring-plugins-2.3.3.tar.gz.sha1
Normal file
@ -0,0 +1 @@
|
||||
4424d4ed0bfffa42b215ae4702a70adea968ad6d *monitoring-plugins-2.3.3.tar.gz
|
@ -1,13 +0,0 @@
|
||||
Index: monitoring-plugins-2.3.1/plugins/check_disk.c
|
||||
===================================================================
|
||||
--- monitoring-plugins-2.3.1.orig/plugins/check_disk.c
|
||||
+++ monitoring-plugins-2.3.1/plugins/check_disk.c
|
||||
@@ -1030,7 +1030,7 @@ get_stats (struct parameter_list *p, str
|
||||
if (verbose >= 3)
|
||||
printf("Group %s: adding %llu blocks sized %llu, (%s) used_units=%g free_units=%g total_units=%g fsu_blocksize=%llu mult=%llu\n",
|
||||
p_list->group, tmpfsp.fsu_bavail, tmpfsp.fsu_blocksize, p_list->best_match->me_mountdir, p_list->dused_units, p_list->dfree_units,
|
||||
- p_list->dtotal_units, mult);
|
||||
+ p_list->dtotal_units, tmpfsp.fsu_blocksize, mult);
|
||||
|
||||
/* prevent counting the first FS of a group twice since its parameter_list entry
|
||||
* is used to carry the information of all file systems of the entire group */
|
@ -1,3 +1,211 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Oct 30 18:19:23 CET 2023 - ro@suse.de
|
||||
|
||||
- renamed patches
|
||||
monitoring-plugins-wrong_return_in_check_swap.patch
|
||||
to monitoring-plugins-2.3.3-wrong_percent_in_check_swap.patch
|
||||
monitoring-plugins.check_snmp.arrayaddress.patch
|
||||
to monitoring-plugins-2.3.3-check_snmp.arrayaddress.patch
|
||||
monitoring-plugins-2.3-check_ntp_perf_absolute.patch
|
||||
to monitoring-plugins-2.3.3-check_ntp_perf_absolute.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Oct 16 13:23:42 UTC 2023 - Thorsten Kukuk <kukuk@suse.com>
|
||||
|
||||
- Add buildrequires for coreutils-systemd, as the configure script
|
||||
checks for uptime [bsc#1216148]
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Jun 15 14:44:14 UTC 2023 - Thorsten Kukuk <kukuk@suse.com>
|
||||
|
||||
- systemd-not-utmp.patch: let check_users prefer systemd-logind
|
||||
over utmp (jsc#PED-3144)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed May 31 21:57:07 UTC 2023 - David Disseldorp <ddiss@suse.com>
|
||||
|
||||
- Add attach_disconnected flag for usr.lib.nagios.plugins.check_procs
|
||||
and usr.lib.nagios.plugins.check_procs.sle15 apparmor profiles to
|
||||
permit /proc/PID/exe access; (bsc#1209194)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Apr 13 15:27:12 UTC 2023 - Lars Vogdt <lars@linux-schulserver.de> - 2.3.3
|
||||
|
||||
- added monitoring-plugins-2.3.3-check_icmp.patch
|
||||
Simple patch to avoid compiler errors with latest gcc
|
||||
- removed monitoring-plugins-2.3.1-fixing-shellcheck.patch - upstream
|
||||
- renamed monitoring-plugins-2.2-mariadb_102_build_fix.patch
|
||||
to monitoring-plugins-2.3.3-mariadb_102_build_fix.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Apr 12 20:54:19 UTC 2023 - Archie Cobbs <archie.cobbs@gmail.com>
|
||||
|
||||
- added monitoring-plugins-2.3.3-check_http-proxy.patch
|
||||
Fixes a check_http bug when trying to follow a redirect
|
||||
returned from a URL retrieved via SSL proxy (issue #1764)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Apr 12 17:35:53 UTC 2023 - Lars Vogdt <lars@linux-schulserver.de> - 2.3.3
|
||||
|
||||
- finally remove monitoring-plugins-1.4.6-Makefile_-_no_chown.patch:
|
||||
obsoleted by monitoring-plugins-2.3.3-root-plugins-Makefile_-_no_chown.patch
|
||||
- monitoring-plugins-2.1.1-check_log_-_quoting.patch renamed to
|
||||
monitoring-plugins-2.3.3-check_log_-_quoting.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Feb 2 17:11:00 UTC 2023 - Lars Vogdt <lars@linux-schulserver.de> - 2.3.3
|
||||
|
||||
- Update to 2.3.3
|
||||
Enhancements
|
||||
General
|
||||
+ using PRId64 and PRIu64 instead of %ld directly
|
||||
Single Plugins
|
||||
+ check_http: Make faster with larger files
|
||||
+ check_snmp: add 'multiplier' to modify current value
|
||||
+ check_http: Implement chunked encoding decoding
|
||||
+ check_http/check_curl: add chunked encoding test
|
||||
+ check_log: Added --exclude to exclude patterns
|
||||
+ check_log: Add tests
|
||||
+ check_disk: Clarify usage possibilites
|
||||
|
||||
Fixes
|
||||
General
|
||||
+ fixed two PRId64 to PRIu64 in perfdata_uint64
|
||||
Single Plugins
|
||||
+ check_pgsql: Removing is_pg_dbname alltogether,using postgres API.
|
||||
+ check_http: Remove superflous CRLF in HTTP-Requests
|
||||
+ check_curl: detect ipv6
|
||||
+ check_icmp: fix parsing help/version long options
|
||||
+ check_http: fix test plan
|
||||
+ check_disk: Find accessible mount path if multiple are available
|
||||
+ check_apt: Fix unknown escape sequence error output
|
||||
+ check_curl: fix checking large bodys
|
||||
+ check_snmp: Improve tests for check_snmp & multiply option
|
||||
+ check_snmp: always apply format when applying multiplier
|
||||
+ check_http: Use real booleans instead of ints
|
||||
+ check_http: Document process_arguments a little bit better
|
||||
+ check_http: Remove dead code
|
||||
+ check_http: Fix several bug in the implementation of unchunking
|
||||
+ check_http: Reformat a part to increase readability
|
||||
+ check_apt: Put upgrade options in the root sections
|
||||
+ check_apt: Fix comment
|
||||
+ check_apt: Use real booleans
|
||||
+ check_mailq: Fixing nullmailer regex
|
||||
+ check_snmp: Fix regex matches
|
||||
+ check_log: Fixed a bug when using --all
|
||||
+ check_log: Cleaned up duplicated code in the args
|
||||
+ check_http: Fix memory reallocation error in chunk decoding logic
|
||||
+ check_http: Add space for ending NULL byte in array for chunked encoding
|
||||
|
||||
- included changes in 2.3.2
|
||||
General
|
||||
+ Use silent automake by default
|
||||
|
||||
Fixes
|
||||
Single Plugins
|
||||
+ check_by_ssh: added option to exit with an warning, if there is output on STDERR
|
||||
+ check_by_ssh: Add "-U" flag (#1123).
|
||||
+ check_by_ssh: Let ssh decide if a host is valid, enables usage of ssh .config file
|
||||
+ check_curl: Add an option to check_curl to verify the peer certificate & host using the system CA's
|
||||
+ check_curl: fixed -ffollow for HTTP/2.0 (Fixes #1685): added major_version parsing to PicoHTTPParser
|
||||
+ check_curl: fixes check_curl: "CRITICAL - Cannot retrieve certificate subject."
|
||||
+ check_curl: fix if http header contains leading spaces
|
||||
+ check_curl: Update check_curl.c to display a specific human-readable error message where possible
|
||||
+ check_curl: verify certificates option should not force SSL to be used
|
||||
+ check_disk: Description for -M was the wrong way around
|
||||
+ check_disk: Fixing the stuff that is broken on btrfs
|
||||
+ check_disk: Fix perfdata for big values for check disk
|
||||
+ check_disk_smb: Add configfile feature
|
||||
+ check_disk_smb: Add timeout
|
||||
+ check_dns: Add --expect-nxdomain
|
||||
+ check_dns: split multiple IP addresses passed in one -a argument
|
||||
+ check_file_age: Make size parameter a little bit more intelligible
|
||||
+ check_fping: Implements 'host-alive' mode (Closes. #1027)
|
||||
+ check_game: Update Url to qstat
|
||||
+ check_http: changed 'STATE_CRITICAL' to 'STATE_WARNING' for infinite loop
|
||||
+ check_http: Increase regexp limit by @hydrapolic
|
||||
+ check_http: Support http redirect by @waja
|
||||
+ check_icmp: buffer offerflow
|
||||
+ check_icmp: delay set_source_ip() until address_family is detected
|
||||
+ check_icmp: Fix "Invalid Argument" from sendmsg() under FreeBSD 13.1 and "setsockopt failed" for TTL setting
|
||||
+ check_icmp: Fix pkt perfdata in check_host mode
|
||||
+ check_ldap: Allows check_ldap to read password from environment variable
|
||||
+ check_load: add LOAD prefix to load plugin
|
||||
+ check_load: Display total and scaled load values if check_load scales the values by number of CPUs
|
||||
+ check_log: Missing oldlog now aborts check_log
|
||||
+ check_mailq: Add mailq -C option for config dir or config file
|
||||
+ check_mailq: Check mailq domain specific warnings
|
||||
+ check_mailq: Fix regexp for nullmailer "mailq" output
|
||||
+ check_mysql: fix segfaults with mysql-connector-c #1562
|
||||
+ check_pgsql: add --queryname parameter to check_pgsql
|
||||
+ check_ping: Do not show RTA if no connection was possible
|
||||
+ check_ping: understang ping6 output from iputils package
|
||||
+ check_proc: Fix check proc ps detection
|
||||
+ check_procs: exchange needle and haystack in strstr() for proper state match
|
||||
+ check_smtp: add -L flag to support LMTP (LHLO instead of HELO/EHLO).
|
||||
+ check_snmp: Added option for null zero length string exit codes
|
||||
+ check_snmp: fix performance thresholds when using multiple oids
|
||||
+ check_snmp fix segfaults
|
||||
+ check_snmp: put the "c" (to mark a counter) after the perfdata value
|
||||
+ check_swap: fix parsing swap values
|
||||
+ check_swap: Fix perfdata for check swap
|
||||
+ check_swap: Fix unit for total in perfdata
|
||||
+ check_swap: Handle cached swap
|
||||
+ check_swap: Small fix to threshold validation and style (indentation) fixes
|
||||
+ check_ups: Fix possible overflow in check_ups
|
||||
+ check_uptime: Add option to report uptime in days instead of seconds
|
||||
+ check_uptime: Fix/improve output message "Uptime is ..."
|
||||
|
||||
Multiple Plugins
|
||||
+ check_http, check_curl: added --max-redirs=N option (feature #1684)
|
||||
+ check_http, check_curl: Enhancement --continue-after-certificate (backport from nagios-plugins)
|
||||
+ check_http, check_curl: Remove check_http and check_curl test which are somehow always failing
|
||||
+ check_log, check_oracle, check_sensors: Several fixes shellcheck complaining about
|
||||
+ sslutils: use chain from client certificates
|
||||
|
||||
Non functional changes
|
||||
+ Trivial source code whitespace formatting fixes to standard.
|
||||
+ docs: fix simple typo, conspicuosly -> conspicuously
|
||||
+ Migrate to GitHub actions
|
||||
+ Point to Icinga Exchange instead of dead Monitoring Exchange
|
||||
+ github actions: fix check_users test case
|
||||
+ Add CodeQL checks
|
||||
+ Fix some QL problems
|
||||
+ Update CodeQL and update runner before installing
|
||||
+ check_disk: Check disk compiler warnings
|
||||
+ check_disk: Trivial printf fix and a little bit of code style
|
||||
+ check_http: Docs: make -C obvious
|
||||
+ check_ifoperstatus: Re-attach a comment to where it actually belongs
|
||||
+ check_ircd: Restrict the nickname length of the test user for check_ircd
|
||||
+ check_load: Check load compiler warnings
|
||||
+ check_log Modernize check log
|
||||
+ check_mailq: remove duplicate W=i/C=i args in check_mailq.pl
|
||||
+ check_ntp: Check ntp remove unused variables
|
||||
+ check_pgsql: Using snprintf which honors the buffers size and guarantees null temination. (Closes: #1601)
|
||||
+ check_procs: Fix double percentage sign in usage
|
||||
+ check_sensors.sh: Make shellcheck happier
|
||||
+ check_snmp: Fixed option description authpassword -> authpasswd + whitespaces
|
||||
+ check_swap: Check swap compiler warnings
|
||||
|
||||
- refreshed monitoring-plugins-1.4.6-Makefile_-_no_chown.patch
|
||||
-> monitoring-plugins-2.3.3-root-plugins-Makefile_-_no_chown.patch
|
||||
- refreshed monitoring-plugins-2.3.1-check_ssh.patch
|
||||
-> monitoring-plugins-2.3.3-check_ssh.patch
|
||||
- refreshed monitoring-plugins-2.3.1-check_dhcp_-_detect_rogue_dhcp_servers.patch
|
||||
-> monitoring-plugins-2.3.3-check_dhcp_-_detect_rogue_dhcp_servers.patch
|
||||
- refreshed monitoring-plugins-2.3.1-check_ssh.t_-_improve_testing.patch
|
||||
-> monitoring-plugins-2.3.3-check_ssh.t_-_improve_testing.patch
|
||||
- refreshed monitoring-plugins-2.3.1-check_disk_on_btrfs.patch
|
||||
-> monitoring-plugins-2.3.3-check_disk_on_btrfs.patch
|
||||
- refreshed monitoring-plugins-2.3.1-check_by_ssh.patch
|
||||
-> monitoring-plugins-2.3.3-check_by_ssh.patch
|
||||
- removed monitoring-plugins-too_few_arguments_for_check_disk.patch
|
||||
-> fixed upstream
|
||||
- removed monitoring-plugins.check_hpjd.c-64bit-portability-issue.patch
|
||||
-> fixed upstream
|
||||
- removed monitoring-plugins-2.3.1-check_snmp_segfaults.patch
|
||||
-> fixed upstream
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Oct 6 12:28:59 CEST 2022 - ro@suse.de
|
||||
|
||||
|
@ -1,13 +0,0 @@
|
||||
Index: monitoring-plugins-2.3.1/plugins/check_hpjd.c
|
||||
===================================================================
|
||||
--- monitoring-plugins-2.3.1.orig/plugins/check_hpjd.c
|
||||
+++ monitoring-plugins-2.3.1/plugins/check_hpjd.c
|
||||
@@ -66,7 +66,7 @@ void print_usage (void);
|
||||
|
||||
char *community = NULL;
|
||||
char *address = NULL;
|
||||
-char *port = NULL;
|
||||
+int port = NULL;
|
||||
int check_paper_out = 1;
|
||||
|
||||
int
|
@ -17,7 +17,7 @@
|
||||
|
||||
|
||||
Name: monitoring-plugins
|
||||
Version: 2.3.1
|
||||
Version: 2.3.3
|
||||
Release: 0
|
||||
Summary: The Monitoring Plug-Ins
|
||||
License: GPL-2.0-or-later AND GPL-3.0-only
|
||||
@ -62,33 +62,32 @@ Source58: nrpe-check_zombie_procs
|
||||
Source59: nrpe-check_mysql
|
||||
Source60: nrpe-check_ups
|
||||
# PATCH-FIX-UPSTREAM Quote the options comming in from users (path names might contain whitespaces)
|
||||
Patch1: %{name}-2.1.1-check_log_-_quoting.patch
|
||||
Patch1: %{name}-2.3.3-check_log_-_quoting.patch
|
||||
# PATH-FIX-openSUSE - do not use/run chown in Makefile: we use RPM for this
|
||||
Patch6: %{name}-1.4.6-Makefile_-_no_chown.patch
|
||||
Patch6: %{name}-2.3.3-root-plugins-Makefile_-_no_chown.patch
|
||||
# PATCH-FIX-UPSTREAM Use correct pointer
|
||||
Patch11: %{name}.check_snmp.arrayaddress.patch
|
||||
# PATCH-FIX-UPSTREAM print out all arguments out a Group if in verbose mode
|
||||
Patch15: %{name}-too_few_arguments_for_check_disk.patch
|
||||
# PATCH-FIX-UPSTREAM port should be integer, not character
|
||||
Patch118: %{name}.check_hpjd.c-64bit-portability-issue.patch
|
||||
Patch11: %{name}-2.3.3-check_snmp.arrayaddress.patch
|
||||
# PATCH-FIX-UPSTREAM kstreitova@suse.com -- fix build with MariaDB 10.2
|
||||
Patch119: monitoring-plugins-2.2-mariadb_102_build_fix.patch
|
||||
Patch119: %{name}-2.3.3-mariadb_102_build_fix.patch
|
||||
# PATCH-FIX-UPSTREAM see https://bugzilla.redhat.com/512559
|
||||
Patch121: %{name}-wrong_return_in_check_swap.patch
|
||||
Patch121: %{name}-2.3.3-wrong_percent_in_check_swap.patch
|
||||
# PATCH-FIX-UPSTREAM - return ntp offset absolute (as positive value) in performance data since warn and crit are also positive values
|
||||
Patch122: monitoring-plugins-2.3-check_ntp_perf_absolute.patch
|
||||
# PATCH-FIX-UPSTREAM - see https://github.com/monitoring-plugins/monitoring-plugins/pull/1589
|
||||
Patch123: monitoring-plugins-2.3.1-check_snmp_segfaults.patch
|
||||
# PATCH-FIX-UPSTREAM - see https://github.com/monitoring-plugins/monitoring-plugins/pull/1459
|
||||
Patch124: monitoring-plugins-2.3.1-fixing-shellcheck.patch
|
||||
Patch122: %{name}-2.3.3-check_ntp_perf_absolute.patch
|
||||
# PATCH-FIX-UPSTREAM - see https://github.com/monitoring-plugins/monitoring-plugins/pull/1322
|
||||
Patch125: monitoring-plugins-2.3.1-check_ssh.patch
|
||||
Patch126: monitoring-plugins-2.3.1-check_ssh.t_-_improve_testing.patch
|
||||
Patch125: monitoring-plugins-2.3.3-check_ssh.patch
|
||||
Patch126: monitoring-plugins-2.3.3-check_ssh.t_-_improve_testing.patch
|
||||
# PATCH-FIX-UPSTREAM - see https://github.com/monitoring-plugins/monitoring-plugins/issues/1375
|
||||
Patch127: monitoring-plugins-2.3.1-check_dhcp_-_detect_rogue_dhcp_servers.patch
|
||||
Patch128: monitoring-plugins-2.3.1-check_disk_on_btrfs.patch
|
||||
Patch127: monitoring-plugins-2.3.3-check_dhcp_-_detect_rogue_dhcp_servers.patch
|
||||
Patch128: monitoring-plugins-2.3.3-check_disk_on_btrfs.patch
|
||||
# PATCH-FIX-UPSTREAM - see https://github.com/monitoring-plugins/monitoring-plugins/pull/1774
|
||||
Patch129: monitoring-plugins-2.3.1-check_by_ssh.patch
|
||||
Patch129: monitoring-plugins-2.3.3-check_by_ssh.patch
|
||||
#
|
||||
# PATCH-FIX-UPSTREAM - see https://github.com/monitoring-plugins/monitoring-plugins/pull/1862
|
||||
Patch130: monitoring-plugins-2.3.3-check_http-proxy.patch
|
||||
# PATCH-FIX-UPSTREAM - simple fix for compiler error regarding no return value in function get_ip_address
|
||||
Patch131: monitoring-plugins-2.3.3-check_icmp.patch
|
||||
# PATCH-FEATURE-SLE - Use systemd-logind instead of utmp (jsc#PED-3144)
|
||||
Patch132: systemd-not-utmp.patch
|
||||
BuildRequires: bind-utils
|
||||
BuildRequires: dhcp-devel
|
||||
BuildRequires: fping
|
||||
@ -98,6 +97,9 @@ PreReq: permissions
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: automake
|
||||
%if 0%{?suse_version} > 1599
|
||||
BuildRequires: coreutils-systemd
|
||||
%endif
|
||||
BuildRequires: iputils
|
||||
BuildRequires: libdbi-devel
|
||||
BuildRequires: pkgconfig(smbclient)
|
||||
@ -112,11 +114,14 @@ BuildRequires: openssl-devel
|
||||
BuildRequires: net-snmp-perl
|
||||
BuildRequires: net-snmp-utils
|
||||
%else
|
||||
BuildRequires: perl-Net-SNMP
|
||||
BuildRequires: perl(Net::SNMP)
|
||||
%endif
|
||||
BuildRequires: postfix
|
||||
BuildRequires: postgresql-devel
|
||||
BuildRequires: procps
|
||||
%if 0%{?suse_version} > 1599
|
||||
BuildRequires: systemd-devel
|
||||
%endif
|
||||
BuildRequires: samba-client
|
||||
%if 0%{?suse_version}
|
||||
%if 0%{?suse_version} > 1020
|
||||
@ -631,7 +636,7 @@ Requires: %{name}-common = %{version}
|
||||
Requires: net-snmp-perl
|
||||
Requires: net-snmp-utils
|
||||
%else
|
||||
Requires: perl-Net-SNMP
|
||||
Requires: perl(Net::SNMP)
|
||||
%endif
|
||||
Provides: nagios-plugins-ifoperstatus = %{version}
|
||||
Obsoletes: nagios-plugins-ifoperstatus <= 1.5
|
||||
@ -648,7 +653,7 @@ Requires: %{name}-common = %{version}
|
||||
Requires: net-snmp-perl
|
||||
Requires: net-snmp-utils
|
||||
%else
|
||||
Requires: perl-Net-SNMP
|
||||
Requires: perl(Net::SNMP)
|
||||
%endif
|
||||
Provides: nagios-plugins-ifstatus = %{version}
|
||||
Obsoletes: nagios-plugins-ifstatus <= 1.5
|
||||
@ -1130,20 +1135,19 @@ done
|
||||
%patch1 -p1
|
||||
%patch6 -p1
|
||||
%patch11 -p1
|
||||
%patch15 -p1
|
||||
# Debian patches
|
||||
%patch118 -p1
|
||||
%patch119 -p1
|
||||
%patch121 -p1
|
||||
%patch122 -p1
|
||||
# Github patches
|
||||
%patch123 -p1
|
||||
%patch124 -p1
|
||||
%patch125 -p1
|
||||
%patch126 -p1
|
||||
%patch127 -p1
|
||||
%patch128 -p1
|
||||
%patch129 -p1
|
||||
%patch130 -p1
|
||||
%patch131 -p1
|
||||
%patch132 -p1
|
||||
find -type f -exec chmod 644 {} +
|
||||
|
||||
%build
|
||||
|
78
systemd-not-utmp.patch
Normal file
78
systemd-not-utmp.patch
Normal file
@ -0,0 +1,78 @@
|
||||
--- monitoring-plugins-2.3.3.old/configure.ac 2023-02-01 14:40:55.000000000 +0100
|
||||
+++ monitoring-plugins-2.3.3/configure.ac 2023-06-15 16:21:19.637049416 +0200
|
||||
@@ -328,6 +328,25 @@
|
||||
LIBS="$_SAVEDLIBS"
|
||||
])
|
||||
|
||||
+
|
||||
+AC_ARG_WITH([systemd], [AS_HELP_STRING([--without-systemd], [Skips systemd support])])
|
||||
+
|
||||
+dnl Check for libsystemd
|
||||
+AS_IF([test "x$with_systemd" != "xno"], [
|
||||
+ _SAVEDLIBS="$LIBS"
|
||||
+ AC_CHECK_LIB(systemd,sd_get_sessions,,,-lsystemd)
|
||||
+ if test "$ac_cv_lib_systemd_sd_get_sessions" = "yes"; then
|
||||
+ SYSTEMDLIBS="-lsystemd"
|
||||
+ SYSTEMDINCLUDE=""
|
||||
+ AC_SUBST(SYSTEMDLIBS)
|
||||
+ AC_SUBST(SYSTEMDINCLUDE)
|
||||
+ else
|
||||
+ AC_MSG_WARN([Skipping systemd support])
|
||||
+ fi
|
||||
+ LIBS="$_SAVEDLIBS"
|
||||
+])
|
||||
+
|
||||
+
|
||||
dnl Check for headers used by check_ide_smart
|
||||
case $host in
|
||||
*linux*)
|
||||
diff -wur monitoring-plugins-2.3.3.old/plugins/check_users.c monitoring-plugins-2.3.3/plugins/check_users.c
|
||||
--- monitoring-plugins-2.3.3.old/plugins/check_users.c 2023-02-01 14:40:55.000000000 +0100
|
||||
+++ monitoring-plugins-2.3.3/plugins/check_users.c 2023-06-15 16:16:34.879700400 +0200
|
||||
@@ -48,6 +48,11 @@
|
||||
# include "popen.h"
|
||||
#endif
|
||||
|
||||
+#ifdef HAVE_LIBSYSTEMD
|
||||
+#include <systemd/sd-daemon.h>
|
||||
+#include <systemd/sd-login.h>
|
||||
+#endif
|
||||
+
|
||||
#define possibly_set(a,b) ((a) == 0 ? (b) : 0)
|
||||
|
||||
int process_arguments (int, char **);
|
||||
@@ -115,6 +120,11 @@
|
||||
|
||||
WTSFreeMemory(wtsinfo);
|
||||
#elif HAVE_UTMPX_H
|
||||
+#ifdef HAVE_LIBSYSTEMD
|
||||
+ if (sd_booted () > 0)
|
||||
+ users = sd_get_sessions (NULL);
|
||||
+ else {
|
||||
+#endif
|
||||
/* get currently logged users from utmpx */
|
||||
setutxent ();
|
||||
|
||||
@@ -123,6 +133,9 @@
|
||||
users++;
|
||||
|
||||
endutxent ();
|
||||
+#ifdef HAVE_LIBSYSTEMD
|
||||
+ }
|
||||
+#endif
|
||||
#else
|
||||
/* run the command */
|
||||
child_process = spopen (WHO_COMMAND);
|
||||
Nur in monitoring-plugins-2.3.3/plugins: check_users.c~.
|
||||
diff -wur monitoring-plugins-2.3.3.old/plugins/Makefile.am monitoring-plugins-2.3.3/plugins/Makefile.am
|
||||
--- monitoring-plugins-2.3.3.old/plugins/Makefile.am 2023-02-01 14:40:55.000000000 +0100
|
||||
+++ monitoring-plugins-2.3.3/plugins/Makefile.am 2023-06-15 16:23:36.925699810 +0200
|
||||
@@ -112,7 +112,7 @@
|
||||
check_time_LDADD = $(NETLIBS)
|
||||
check_ntp_time_LDADD = $(NETLIBS) $(MATHLIBS)
|
||||
check_ups_LDADD = $(NETLIBS)
|
||||
-check_users_LDADD = $(BASEOBJS) $(WTSAPI32LIBS)
|
||||
+check_users_LDADD = $(BASEOBJS) $(WTSAPI32LIBS) $(SYSTEMDLIBS)
|
||||
check_by_ssh_LDADD = $(NETLIBS)
|
||||
check_ide_smart_LDADD = $(BASEOBJS)
|
||||
negate_LDADD = $(BASEOBJS)
|
@ -1,5 +1,5 @@
|
||||
#include <tunables/global>
|
||||
/usr/lib/nagios/plugins/check_procs {
|
||||
/usr/lib/nagios/plugins/check_procs flags=(attach_disconnected) {
|
||||
#include <abstractions/nameservice>
|
||||
#include <abstractions/base>
|
||||
#include <abstractions/consoles>
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include <tunables/global>
|
||||
/usr/lib/nagios/plugins/check_procs {
|
||||
/usr/lib/nagios/plugins/check_procs flags=(attach_disconnected) {
|
||||
#include <abstractions/nameservice>
|
||||
#include <abstractions/base>
|
||||
#include <abstractions/consoles>
|
||||
|
Loading…
x
Reference in New Issue
Block a user