forked from pool/monitoring-plugins
Compare commits
5 Commits
Author | SHA256 | Date | |
---|---|---|---|
|
928fa3db7e | ||
|
a6edd8cb54 | ||
|
3cfdf68871 | ||
|
6e6a59f53d | ||
|
dd6cd0cb02 |
20
_service
Normal file
20
_service
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<services>
|
||||||
|
<service name="download_url" mode="manual">
|
||||||
|
<param name="host">www.monitoring-plugins.org</param>
|
||||||
|
<param name="protocol">https</param>
|
||||||
|
<param name="path">/download/monitoring-plugins-2.4.0.tar.gz</param>
|
||||||
|
<param name="filename">monitoring-plugins-2.4.0.tar.gz</param>
|
||||||
|
</service>
|
||||||
|
<service name="download_url" mode="manual">
|
||||||
|
<param name="host">www.monitoring-plugins.org</param>
|
||||||
|
<param name="protocol">https</param>
|
||||||
|
<param name="path">/download/monitoring-plugins-2.4.0.tar.gz.sha1</param>
|
||||||
|
<param name="filename">monitoring-plugins-2.4.0.tar.gz.sha1</param>
|
||||||
|
</service>
|
||||||
|
<service name="verify_file" mode="manual">
|
||||||
|
<param name="verifier">sha1</param>
|
||||||
|
<param name="checksum">595fcfe92a5273031e8ad7f294ba683c27078a1a</param>
|
||||||
|
<!-- <param name="file">monitoring-plugins-2.4.0.tar.gz</param> -->
|
||||||
|
<param name="file">_service:download_url:monitoring-plugins-2.4.0.tar.gz</param>
|
||||||
|
</service>
|
||||||
|
</services>
|
@ -1,13 +0,0 @@
|
|||||||
Index: monitoring-plugins-2.3.3/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)
|
|
||||||
{
|
|
||||||
- return fperfdata ("offset", offset, "s",
|
|
||||||
+ return fperfdata ("offset", fabs(offset), "s",
|
|
||||||
TRUE, offset_thresholds->warning->end,
|
|
||||||
TRUE, offset_thresholds->critical->end,
|
|
||||||
FALSE, 0, FALSE, 0);
|
|
@ -1,212 +0,0 @@
|
|||||||
From e56255ee2f2887551e15aba2410138238efab030 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Anton Lofgren <alofgren@op5.com>
|
|
||||||
Date: Mon, 21 Oct 2013 08:18:30 +0200
|
|
||||||
Subject: [PATCH 1/4] check_ssh: properly parse a delayed version control
|
|
||||||
string
|
|
||||||
|
|
||||||
This resolves an issue with SSH servers which do not respond with their
|
|
||||||
version control string as the first thing in the SSH protocol version
|
|
||||||
exchange phase after connection establishment.
|
|
||||||
|
|
||||||
This patch also makes sure that we disregard a potential comment in the
|
|
||||||
version exchange string to avoid nonsense mismatches. In the future, we
|
|
||||||
might want to add the capability to match against a user specified comment.
|
|
||||||
|
|
||||||
In addition, the patch largely improves the communication towards the
|
|
||||||
server, which adds better protocol adherence.
|
|
||||||
|
|
||||||
Of course, new test cases are added to support the trigger and guard
|
|
||||||
against regressions of the bugs solved by this patch.
|
|
||||||
|
|
||||||
This fixes op5#7945 (https://bugs.op5.com/view.php?id=7945)
|
|
||||||
|
|
||||||
Signed-off-by: Anton Lofgren <alofgren@op5.com>
|
|
||||||
---
|
|
||||||
plugins/check_ssh.c | 122 +++++++++++++++++++++++++++++-------------
|
|
||||||
plugins/t/check_ssh.t | 97 ++++++++++++++++++++++++++-------
|
|
||||||
2 files changed, 164 insertions(+), 55 deletions(-)
|
|
||||||
|
|
||||||
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;
|
|
||||||
+ int len = 0;
|
|
||||||
+ ssize_t byte_offset = 0;
|
|
||||||
+ ssize_t recv_ret = 0;
|
|
||||||
+ char *version_control_string = NULL;
|
|
||||||
char *output = NULL;
|
|
||||||
char *buffer = NULL;
|
|
||||||
+ char *tmp= NULL, *saveptr = NULL;
|
|
||||||
char *ssh_proto = NULL;
|
|
||||||
char *ssh_server = NULL;
|
|
||||||
static char *rev_no = VERSION;
|
|
||||||
@@ -231,51 +236,118 @@ ssh_connect (char *haddr, int hport, cha
|
|
||||||
return result;
|
|
||||||
|
|
||||||
output = (char *) malloc (BUFF_SZ + 1);
|
|
||||||
- memset (output, 0, BUFF_SZ + 1);
|
|
||||||
- recv (sd, output, BUFF_SZ, 0);
|
|
||||||
- if (strncmp (output, "SSH", 3)) {
|
|
||||||
- printf (_("Server answer: %s"), output);
|
|
||||||
- close(sd);
|
|
||||||
+ memset(output, 0, BUFF_SZ+1);
|
|
||||||
+ while (!version_control_string && (recv_ret = recv(sd, output+byte_offset, BUFF_SZ - byte_offset, 0)) > 0) {
|
|
||||||
+ if (strchr(output, '\n')) { /* we've got at least one full line, start parsing*/
|
|
||||||
+ byte_offset = 0;
|
|
||||||
+ while (strchr(output+byte_offset, '\n') != NULL) {
|
|
||||||
+ /*Partition the buffer so that this line is a separate string,
|
|
||||||
+ * by replacing the newline with NUL*/
|
|
||||||
+ output[(strchr(output+byte_offset, '\n')-output)]= '\0';
|
|
||||||
+ len = strlen(output+byte_offset);
|
|
||||||
+ if (len >= 4) {
|
|
||||||
+ /*if the string starts with SSH-, this _should_ be a valid version control string*/
|
|
||||||
+ if (strncmp (output+byte_offset, "SSH-", 4) == 0) {
|
|
||||||
+ version_control_string = output+byte_offset;
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /*the start of the next line (if one exists) will be after the current one (+ NUL)*/
|
|
||||||
+ byte_offset+=len+1;
|
|
||||||
+ }
|
|
||||||
+ if(!version_control_string) {
|
|
||||||
+ /* move unconsumed data to beginning of buffer, null rest */
|
|
||||||
+ memmove((void *)output, (void *)output+byte_offset+1, BUFF_SZ - len+1);
|
|
||||||
+ memset(output+byte_offset+1, 0, BUFF_SZ-byte_offset+1);
|
|
||||||
+
|
|
||||||
+ /*start reading from end of current line chunk on next recv*/
|
|
||||||
+ byte_offset = strlen(output);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ else {
|
|
||||||
+ byte_offset += recv_ret;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ tmp = NULL;
|
|
||||||
+ if (recv_ret < 0) {
|
|
||||||
+ printf("SSH CRITICAL - %s", strerror(errno));
|
|
||||||
+ exit(STATE_CRITICAL);
|
|
||||||
+ }
|
|
||||||
+ if (!version_control_string) {
|
|
||||||
+ 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;
|
|
||||||
+
|
|
||||||
+ /*
|
|
||||||
+ * 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)*/
|
|
||||||
+ tmp = strchr(ssh_server, ' ');
|
|
||||||
+ if (tmp) {
|
|
||||||
+ ssh_server[tmp - ssh_server] = '\0';
|
|
||||||
+ }
|
|
||||||
+ if (strlen(ssh_proto) == 0 || strlen(ssh_server) == 0) {
|
|
||||||
+ printf(_("SSH CRITICAL - Invalid protocol version control string %s\n"), version_control_string);
|
|
||||||
exit (STATE_CRITICAL);
|
|
||||||
}
|
|
||||||
- else {
|
|
||||||
- strip (output);
|
|
||||||
- if (verbose)
|
|
||||||
- printf ("%s\n", output);
|
|
||||||
- ssh_proto = output + 4;
|
|
||||||
- ssh_server = ssh_proto + strspn (ssh_proto, "-0123456789. ");
|
|
||||||
- ssh_proto[strspn (ssh_proto, "0123456789. ")] = 0;
|
|
||||||
-
|
|
||||||
- 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);
|
|
||||||
-
|
|
||||||
- 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 CRITICAL - %s (protocol %s) protocol version mismatch, expected '%s'\n"),
|
|
||||||
- ssh_server, ssh_proto, remote_protocol);
|
|
||||||
- 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);
|
|
||||||
|
|
||||||
+ if (remote_version && strcmp(remote_version, ssh_server)) {
|
|
||||||
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) 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
|
|
||||||
+ (_("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));
|
|
||||||
+ close(sd);
|
|
||||||
+ exit (STATE_OK);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,139 +0,0 @@
|
|||||||
Index: monitoring-plugins-2.3.3/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;
|
|
||||||
|
|
||||||
-# Required parameters
|
|
||||||
-my $ssh_host = getTestParameter("NP_SSH_HOST", "A host providing SSH service", "localhost");
|
|
||||||
-my $host_nonresponsive = getTestParameter("NP_HOST_NONRESPONSIVE", "The hostname of system not responsive to network requests", "10.0.0.1" );
|
|
||||||
-my $hostname_invalid = getTestParameter("NP_HOSTNAME_INVALID", "An invalid (not known to DNS) hostname", "nosuchhost" );
|
|
||||||
-
|
|
||||||
-
|
|
||||||
-plan skip_all => "SSH_HOST must be defined" unless $ssh_host;
|
|
||||||
-plan tests => 6;
|
|
||||||
-
|
|
||||||
-
|
|
||||||
-my $result = NPTest->testCmd(
|
|
||||||
- "./check_ssh -H $ssh_host"
|
|
||||||
- );
|
|
||||||
-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"
|
|
||||||
- );
|
|
||||||
-cmp_ok($result->return_code, '==', 2, "Exit with return code 0 (OK)");
|
|
||||||
-like($result->output, '/^CRITICAL - Socket timeout after 2 seconds/', "Status text if command returned none (OK)");
|
|
||||||
-
|
|
||||||
-
|
|
||||||
-
|
|
||||||
-$result = NPTest->testCmd(
|
|
||||||
- "./check_ssh -H $hostname_invalid -t 2"
|
|
||||||
- );
|
|
||||||
-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)");
|
|
||||||
+# Required parameters
|
|
||||||
+my $ssh_host = getTestParameter("NP_SSH_HOST",
|
|
||||||
+ "A host providing SSH service",
|
|
||||||
+ "localhost");
|
|
||||||
+my $host_nonresponsive = getTestParameter("NP_HOST_NONRESPONSIVE",
|
|
||||||
+ "The hostname of system not responsive to network requests",
|
|
||||||
+ "10.0.0.1" );
|
|
||||||
+my $hostname_invalid = getTestParameter("NP_HOSTNAME_INVALID",
|
|
||||||
+ "An invalid (not known to DNS) hostname",
|
|
||||||
+ "nosuchhost" );
|
|
||||||
+
|
|
||||||
+plan tests => 14 + 6;
|
|
||||||
+
|
|
||||||
+SKIP: {
|
|
||||||
+ skip "SSH_HOST must be defined", 6 unless $ssh_host;
|
|
||||||
+ my $result = NPTest->testCmd(
|
|
||||||
+ "./check_ssh -H $ssh_host"
|
|
||||||
+ );
|
|
||||||
+ cmp_ok($result->return_code, '==', 0, "Exit with return code 0 (OK)");
|
|
||||||
+ like($result->output, '/^SSH OK - /', "Status text if command returned none (OK)");
|
|
||||||
+
|
|
||||||
+ $result = NPTest->testCmd(
|
|
||||||
+ "./check_ssh -H $host_nonresponsive -t 2"
|
|
||||||
+ );
|
|
||||||
+ cmp_ok($result->return_code, '==', 2, "Exit with return code 0 (OK)");
|
|
||||||
+ like($result->output, '/^CRITICAL - Socket timeout after 2 seconds/', "Status text if command returned none (OK)");
|
|
||||||
+
|
|
||||||
+ $result = NPTest->testCmd(
|
|
||||||
+ "./check_ssh -H $hostname_invalid -t 2"
|
|
||||||
+ );
|
|
||||||
+ 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)");
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+SKIP: {
|
|
||||||
+ skip "No netcat available", 12 unless (system("which nc > /dev/null") == 0);
|
|
||||||
+
|
|
||||||
+ my $nc_flags = "-l 5003 -i 1";
|
|
||||||
+ #A valid protocol version control string has the form
|
|
||||||
+ # SSH-protoversion-softwareversion SP comments CR LF
|
|
||||||
+ #
|
|
||||||
+ # where `comments` is optional, protoversion is the SSH protocol version and
|
|
||||||
+ # softwareversion is an arbitrary string representing the server software version
|
|
||||||
+ open(NC, "echo 'SSH-2.0-nagiosplug.ssh.0.1' | nc ${nc_flags}|");
|
|
||||||
+ sleep 1;
|
|
||||||
+ $res = NPTest->testCmd( "./check_ssh -H localhost -p 5003" );
|
|
||||||
+ cmp_ok( $res->return_code, '==', 0, "Got SSH protocol version control string");
|
|
||||||
+ like( $res->output, '/^SSH OK - nagiosplug.ssh.0.1 \(protocol 2.0\)/', "Output OK");
|
|
||||||
+ close NC;
|
|
||||||
+
|
|
||||||
+ open(NC, "echo 'SSH-2.0-3.2.9.1' | nc ${nc_flags}|");
|
|
||||||
+ sleep 1;
|
|
||||||
+ $res = NPTest->testCmd( "./check_ssh -H localhost -p 5003" );
|
|
||||||
+ cmp_ok( $res->return_code, "==", 0, "Got SSH protocol version control string with non-alpha softwareversion string");
|
|
||||||
+ like( $res->output, '/^SSH OK - 3.2.9.1 \(protocol 2.0\)/', "Output OK for non-alpha softwareversion string");
|
|
||||||
+ close NC;
|
|
||||||
+
|
|
||||||
+ open(NC, "echo 'SSH-2.0-nagiosplug.ssh.0.1 this is a comment' | nc ${nc_flags} |");
|
|
||||||
+ sleep 1;
|
|
||||||
+ $res = NPTest->testCmd( "./check_ssh -H localhost -p 5003 -r nagiosplug.ssh.0.1" );
|
|
||||||
+ cmp_ok( $res->return_code, '==', 0, "Got SSH protocol version control string, and parsed comment appropriately");
|
|
||||||
+ like( $res->output, '/^SSH OK - nagiosplug.ssh.0.1 \(protocol 2.0\)/', "Output OK");
|
|
||||||
+ close NC;
|
|
||||||
+
|
|
||||||
+ open(NC, "echo 'SSH-' | nc ${nc_flags}|");
|
|
||||||
+ sleep 1;
|
|
||||||
+ $res = NPTest->testCmd( "./check_ssh -H localhost -p 5003" );
|
|
||||||
+ cmp_ok( $res->return_code, '==', 2, "Got invalid SSH protocol version control string");
|
|
||||||
+ like( $res->output, '/^SSH CRITICAL/', "Output OK");
|
|
||||||
+ close NC;
|
|
||||||
+
|
|
||||||
+ open(NC, "echo '' | nc ${nc_flags}|");
|
|
||||||
+ sleep 1;
|
|
||||||
+ $res = NPTest->testCmd( "./check_ssh -H localhost -p 5003" );
|
|
||||||
+ cmp_ok( $res->return_code, '==', 2, "No version control string received");
|
|
||||||
+ like( $res->output, '/^SSH CRITICAL - No version control string received/', "Output OK");
|
|
||||||
+ close NC;
|
|
||||||
+
|
|
||||||
+ open(NC, "echo 'Not a version control string' | nc ${nc_flags}|");
|
|
||||||
+ sleep 1;
|
|
||||||
+ $res = NPTest->testCmd( "./check_ssh -H localhost -p 5003" );
|
|
||||||
+ cmp_ok( $res->return_code, '==', 2, "No version control string received");
|
|
||||||
+ like( $res->output, '/^SSH CRITICAL - No version control string received/', "Output OK");
|
|
||||||
+ close NC;
|
|
||||||
+
|
|
||||||
+ #RFC 4253 permits servers to send any number of data lines prior to sending the protocol version control string
|
|
||||||
+ open(NC, "{ echo 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'; sleep 1;
|
|
||||||
+ echo 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB'; sleep 1;
|
|
||||||
+ echo 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC'; sleep 1;
|
|
||||||
+ echo 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD'; sleep 1;
|
|
||||||
+ printf 'EEEEEEEEEEEEEEEEEE'; sleep 1;
|
|
||||||
+ printf 'EEEEEEEEEEEEEEEEEE\n'; sleep 1;
|
|
||||||
+ echo 'Some\nPrepended\nData\nLines\n'; sleep 1;
|
|
||||||
+ echo 'SSH-2.0-nagiosplug.ssh.0.2';} | nc ${nc_flags}|");
|
|
||||||
+ sleep 1;
|
|
||||||
+ $res = NPTest->testCmd( "./check_ssh -H localhost -p 5003" );
|
|
||||||
+ 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;
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
|||||||
--- monitoring-plugins-2.3.5/plugins-root/Makefile.in.orig 2023-11-28 17:23:06.400019507 -0600
|
|
||||||
+++ monitoring-plugins-2.3.5/plugins-root/Makefile.in 2023-11-28 17:49:03.832492223 -0600
|
|
||||||
@@ -1960,8 +1960,6 @@
|
|
||||||
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; \
|
|
||||||
done
|
|
||||||
@@ -2484,7 +2482,7 @@
|
|
||||||
@TMPFILE=$(DESTDIR)$(libexecdir)/.setuid-$$$$; \
|
|
||||||
rm -f $$TMPFILE; \
|
|
||||||
echo > $$TMPFILE; \
|
|
||||||
- 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; \
|
|
BIN
monitoring-plugins-2.3.5.tar.gz
(Stored with Git LFS)
BIN
monitoring-plugins-2.3.5.tar.gz
(Stored with Git LFS)
Binary file not shown.
@ -1 +0,0 @@
|
|||||||
fcbe2068cb55aeaca3ebe67b619cb345a6705184 *monitoring-plugins-2.3.5.tar.gz
|
|
14
monitoring-plugins-2.4.0-check_dbi-type_mismatch.patch
Normal file
14
monitoring-plugins-2.4.0-check_dbi-type_mismatch.patch
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
--- monitoring-plugins-2.4.0/plugins/check_dbi.c 2024/12/02 16:16:03 1.1
|
||||||
|
+++ monitoring-plugins-2.4.0/plugins/check_dbi.c 2024/12/02 17:02:44
|
||||||
|
@@ -141,9 +141,9 @@
|
||||||
|
if (verbose > 2)
|
||||||
|
printf ("Initializing DBI\n");
|
||||||
|
|
||||||
|
- dbi_inst *instance_p = { 0 };
|
||||||
|
+ dbi_inst instance_p = { 0 };
|
||||||
|
|
||||||
|
- if (dbi_initialize_r(NULL, instance_p) < 0) {
|
||||||
|
+ if (dbi_initialize_r(NULL, &instance_p) < 0) {
|
||||||
|
printf ("UNKNOWN - failed to initialize DBI; possibly you don't have any drivers installed.\n");
|
||||||
|
return STATE_UNKNOWN;
|
||||||
|
}
|
@ -1,5 +1,5 @@
|
|||||||
diff --git a/plugins/check_http.c b/plugins/check_http.c
|
diff --git a/plugins/check_http.c b/plugins/check_http.c
|
||||||
index 8dda046f..2ab6a7a3 100644
|
index 425ce86bb..e460e11ac 100644
|
||||||
--- a/plugins/check_http.c
|
--- a/plugins/check_http.c
|
||||||
+++ b/plugins/check_http.c
|
+++ b/plugins/check_http.c
|
||||||
@@ -126,6 +126,9 @@ int sd;
|
@@ -126,6 +126,9 @@ int sd;
|
||||||
@ -20,7 +20,7 @@ index 8dda046f..2ab6a7a3 100644
|
|||||||
bool server_type_check(const char *type);
|
bool server_type_check(const char *type);
|
||||||
int server_port_check(int ssl_flag);
|
int server_port_check(int ssl_flag);
|
||||||
char *perfd_time (double microsec);
|
char *perfd_time (double microsec);
|
||||||
@@ -609,6 +613,17 @@ bool process_arguments (int argc, char **argv)
|
@@ -608,6 +612,17 @@ bool process_arguments (int argc, char **argv)
|
||||||
if (virtual_port == 0)
|
if (virtual_port == 0)
|
||||||
virtual_port = server_port;
|
virtual_port = server_port;
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ index 8dda046f..2ab6a7a3 100644
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -940,18 +955,18 @@ check_http (void)
|
@@ -939,18 +954,18 @@ check_http (void)
|
||||||
|
|
||||||
/* try to connect to the host at the given port number */
|
/* try to connect to the host at the given port number */
|
||||||
gettimeofday (&tv_temp, NULL);
|
gettimeofday (&tv_temp, NULL);
|
||||||
@ -65,7 +65,7 @@ index 8dda046f..2ab6a7a3 100644
|
|||||||
asprintf (&buf, "%s %s:%d HTTP/1.1\r\n%s\r\n", http_method, host_name, HTTPS_PORT, user_agent);
|
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)) {
|
if (strlen(proxy_auth)) {
|
||||||
base64_encode_alloc (proxy_auth, strlen (proxy_auth), &auth);
|
base64_encode_alloc (proxy_auth, strlen (proxy_auth), &auth);
|
||||||
@@ -986,7 +1001,7 @@ check_http (void)
|
@@ -985,7 +1000,7 @@ check_http (void)
|
||||||
if (use_ssl == true) {
|
if (use_ssl == true) {
|
||||||
gettimeofday (&tv_temp, NULL);
|
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);
|
result = np_net_ssl_init_with_hostname_version_and_cert(sd, (use_sni ? host_name : NULL), ssl_version, client_cert, client_privkey);
|
||||||
@ -74,7 +74,7 @@ index 8dda046f..2ab6a7a3 100644
|
|||||||
if (result != STATE_OK)
|
if (result != STATE_OK)
|
||||||
die (STATE_CRITICAL, NULL);
|
die (STATE_CRITICAL, NULL);
|
||||||
microsec_ssl = deltime (tv_temp);
|
microsec_ssl = deltime (tv_temp);
|
||||||
@@ -1002,9 +1017,8 @@ check_http (void)
|
@@ -1001,9 +1016,8 @@ check_http (void)
|
||||||
}
|
}
|
||||||
#endif /* HAVE_SSL */
|
#endif /* HAVE_SSL */
|
||||||
|
|
||||||
@ -86,7 +86,7 @@ index 8dda046f..2ab6a7a3 100644
|
|||||||
else
|
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);
|
asprintf (&buf, "%s %s %s\r\n%s\r\n", http_method, server_url, host_name ? "HTTP/1.1" : "HTTP/1.0", user_agent);
|
||||||
|
|
||||||
@@ -1033,8 +1047,7 @@ check_http (void)
|
@@ -1032,8 +1046,7 @@ check_http (void)
|
||||||
*/
|
*/
|
||||||
if ((use_ssl == false && virtual_port == HTTP_PORT) ||
|
if ((use_ssl == false && virtual_port == HTTP_PORT) ||
|
||||||
(use_ssl == true && virtual_port == HTTPS_PORT) ||
|
(use_ssl == true && virtual_port == HTTPS_PORT) ||
|
||||||
@ -96,7 +96,7 @@ index 8dda046f..2ab6a7a3 100644
|
|||||||
xasprintf (&buf, "%sHost: %s\r\n", buf, host_name);
|
xasprintf (&buf, "%sHost: %s\r\n", buf, host_name);
|
||||||
else
|
else
|
||||||
xasprintf (&buf, "%sHost: %s:%d\r\n", buf, host_name, virtual_port);
|
xasprintf (&buf, "%sHost: %s:%d\r\n", buf, host_name, virtual_port);
|
||||||
@@ -1138,10 +1151,17 @@ check_http (void)
|
@@ -1137,10 +1150,17 @@ check_http (void)
|
||||||
/* leave full_page untouched so we can free it later */
|
/* leave full_page untouched so we can free it later */
|
||||||
page = full_page;
|
page = full_page;
|
||||||
|
|
||||||
@ -118,7 +118,7 @@ index 8dda046f..2ab6a7a3 100644
|
|||||||
|
|
||||||
/* find status line and null-terminate it */
|
/* find status line and null-terminate it */
|
||||||
status_line = page;
|
status_line = page;
|
||||||
@@ -1301,7 +1321,12 @@ check_http (void)
|
@@ -1300,7 +1320,12 @@ check_http (void)
|
||||||
bcopy("...", &output_string_search[sizeof(output_string_search) - 4],
|
bcopy("...", &output_string_search[sizeof(output_string_search) - 4],
|
||||||
4);
|
4);
|
||||||
}
|
}
|
||||||
@ -132,7 +132,7 @@ index 8dda046f..2ab6a7a3 100644
|
|||||||
result = STATE_CRITICAL;
|
result = STATE_CRITICAL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1642,6 +1667,25 @@ redir (char *pos, char *status_line)
|
@@ -1641,6 +1666,25 @@ redir (char *pos, char *status_line)
|
||||||
check_http ();
|
check_http ();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,7 +158,7 @@ index 8dda046f..2ab6a7a3 100644
|
|||||||
|
|
||||||
bool
|
bool
|
||||||
server_type_check (const char *type)
|
server_type_check (const char *type)
|
||||||
@@ -1861,7 +1905,7 @@ print_help (void)
|
@@ -1860,7 +1904,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", _("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", _("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 (" %s\n", _("A STATE_CRITICAL will be returned when certificate expires in less than 14 days"));
|
@ -1,7 +1,7 @@
|
|||||||
Index: monitoring-plugins-2.3.3/plugins-scripts/check_log.sh
|
Index: monitoring-plugins-2.4.0/plugins-scripts/check_log.sh
|
||||||
===================================================================
|
===================================================================
|
||||||
--- monitoring-plugins-2.3.3.orig/plugins-scripts/check_log.sh
|
--- monitoring-plugins-2.4.0.orig/plugins-scripts/check_log.sh
|
||||||
+++ monitoring-plugins-2.3.3/plugins-scripts/check_log.sh
|
+++ monitoring-plugins-2.4.0/plugins-scripts/check_log.sh
|
||||||
@@ -112,23 +112,23 @@ while test -n "$1"; do
|
@@ -112,23 +112,23 @@ while test -n "$1"; do
|
||||||
exit "$STATE_UNKNOWN"
|
exit "$STATE_UNKNOWN"
|
||||||
;;
|
;;
|
13
monitoring-plugins-2.4.0-check_ntp_perf_absolute.patch
Normal file
13
monitoring-plugins-2.4.0-check_ntp_perf_absolute.patch
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
Index: monitoring-plugins-2.4.0/plugins/check_ntp_time.c
|
||||||
|
===================================================================
|
||||||
|
--- monitoring-plugins-2.4.0.orig/plugins/check_ntp_time.c
|
||||||
|
+++ monitoring-plugins-2.4.0/plugins/check_ntp_time.c
|
||||||
|
@@ -532,7 +532,7 @@ int process_arguments(int argc, char **a
|
||||||
|
}
|
||||||
|
|
||||||
|
char *perfd_offset (double offset) {
|
||||||
|
- return fperfdata ("offset", offset, "s",
|
||||||
|
+ return fperfdata ("offset", fabs(offset), "s",
|
||||||
|
true, offset_thresholds->warning->end,
|
||||||
|
true, offset_thresholds->critical->end,
|
||||||
|
false, 0, false, 0);
|
@ -0,0 +1,23 @@
|
|||||||
|
Index: monitoring-plugins-2.4.0/plugins-root/Makefile.am
|
||||||
|
===================================================================
|
||||||
|
--- monitoring-plugins-2.4.0.orig/plugins-root/Makefile.am
|
||||||
|
+++ monitoring-plugins-2.4.0/plugins-root/Makefile.am
|
||||||
|
@@ -49,8 +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; \
|
||||||
|
done
|
||||||
|
@@ -65,8 +63,7 @@ install-exec-local: $(noinst_PROGRAMS)
|
||||||
|
## 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; \
|
||||||
|
- chown root $$TMPFILE > /dev/null 2>&1 \
|
||||||
|
- && chmod $(setuid_root_mode) $$TMPFILE > /dev/null 2>&1 \
|
||||||
|
+ 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 \
|
3
monitoring-plugins-2.4.0.tar.gz
Normal file
3
monitoring-plugins-2.4.0.tar.gz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:e5dfd4ad8fde0a40da50aab3aff6d9a27020b8f283e332bc4da6ef9914f4028c
|
||||||
|
size 2746382
|
1
monitoring-plugins-2.4.0.tar.gz.sha1
Normal file
1
monitoring-plugins-2.4.0.tar.gz.sha1
Normal file
@ -0,0 +1 @@
|
|||||||
|
595fcfe92a5273031e8ad7f294ba683c27078a1a *monitoring-plugins-2.4.0.tar.gz
|
@ -1,3 +1,95 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Feb 7 13:52:07 CET 2025 - ro@suse.de
|
||||||
|
|
||||||
|
- update apparmor profiles:
|
||||||
|
- check_load: allow to read /run/systemd/sessions/*
|
||||||
|
- check_procs: allow to read /sys/devices/system/node/
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Dec 2 17:52:44 CET 2024 - ro@suse.de
|
||||||
|
|
||||||
|
- add patch monitoring-plugins-2.4.0-check_dbi-type_mismatch.patch
|
||||||
|
to fix compilation with gcc-14
|
||||||
|
passing argument 2 of ‘dbi_driver_open_r’ from incompatible pointer type
|
||||||
|
- change mode to "manual" in service file
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Jul 29 08:06:37 UTC 2024 - Lars Vogdt <lars@linux-schulserver.de>
|
||||||
|
|
||||||
|
- update to 2.4.0
|
||||||
|
General
|
||||||
|
+ Use C99 booleans @RincewindsHat
|
||||||
|
+ Improve negate plugin helptext @euniceremoquillo
|
||||||
|
+ Add new test function for percentage expressions @RincewindsHat
|
||||||
|
Single Plugins
|
||||||
|
+ check_mailq: remove trailing whitespaces @sni
|
||||||
|
+ check_mailq: unify tabs/spaces @sni
|
||||||
|
+ check_oracle: Shellcheck fixes @RincewindsHat
|
||||||
|
+ check_ups: output ups.realpower if supported @sbraz
|
||||||
|
+ check_disk: add -n short option for --ignore-missing @sni
|
||||||
|
+ check_procs: Improve help text, mentioning excluded processes @shartge
|
||||||
|
+ check_procs: Generalise wording, remove mentioning of nrpe @shartge
|
||||||
|
+ check_curl: add haproxy protocol option @emriver
|
||||||
|
+ check_disk: increase alert precision @sni
|
||||||
|
+ check_ircd: IPv6 support @oxzi
|
||||||
|
+ check_nwstat: adds percentage used space
|
||||||
|
+ check_swap: Possibility to run check_swap without thresholds @Napsty
|
||||||
|
+ check_ups: additional alarm conditions @RincewindsHat
|
||||||
|
+ check_http/check_curl: added a --regex-state option to change the state of a regex check @andreasbaumann
|
||||||
|
General Fixes
|
||||||
|
+ Fixes for -Wsign-compare @RincewindsHat
|
||||||
|
+ Fix logic in is_uint64_t to fix type-limit warning @RincewindsHat
|
||||||
|
+ Prevent -lcrypto from showing up in Makefile dependencies @EricFromCanada
|
||||||
|
+ Change irritating NULL assignment @RincewindsHat
|
||||||
|
Single Plugin Fixes
|
||||||
|
+ check_dbi: Compiler warning for uninitialized variable @RincewindsHat
|
||||||
|
+ check_curl: Initialize pointer before usage @RincewindsHat
|
||||||
|
+ check_ntp: Initialize intermediate results in any case @RincewindsHat
|
||||||
|
+ check_tcp: Fixes an error with using the wrong type for a variable @RincewindsHat
|
||||||
|
+ check_mailq: exit on empty strings and exit early @sni
|
||||||
|
+ check_users: Change option for sanity checking arguments to avoid segfault @RincewindsHat
|
||||||
|
+ check_users: Update help to properly show that thresholds are ranges @RincewindsHat
|
||||||
|
+ check_users: fix segfault @RincewindsHat
|
||||||
|
+ check_dbi: Fix compiler warning for uninitialized variable @RincewindsHat
|
||||||
|
+ check_curl: Initialize pointer before usage @RincewindsHat
|
||||||
|
+ check_ntp: Initialize intermediate results in any case @RincewindsHat
|
||||||
|
+ check_ntp_peer: Fixes for Wmaybe-unitialized and some restructuring @RincewindsHat
|
||||||
|
+ check_dns: Remove unused variable @RincewindsHat
|
||||||
|
+ check_disk: fix ignore-missing in combination with includes @sni
|
||||||
|
+ check_procs: ignore our own children @shartge
|
||||||
|
+ check_http: Remove self assignment of a variable and add some comments @RincewindsHat
|
||||||
|
+ check_snmp: Remove unused variable @RincewindsHat
|
||||||
|
+ check_dhcp: Make implicit conversion explicit to dismiss warning @RincewindsHat
|
||||||
|
+ Ini Parser: Avoid freeing symbols from text section @RincewindsHat
|
||||||
|
+ check_icmp: keep performance data order in case of none-reachable hosts @sni
|
||||||
|
+ check_swap: Change another fake boolean to a real one @RincewindsHat
|
||||||
|
+ check_swap: Rename type since *_t is reserved for C standard types @RincewindsHat
|
||||||
|
+ check_ssh: Fix a typo in "remote-protocol parameter
|
||||||
|
+ check_ssh: Handle non-alpha software versions
|
||||||
|
+ check_ssh: properly parse a delayed version control string
|
||||||
|
+ check_disk: Fail on missing arguments for --warning and --critical and fix a test case @RincewindsHat
|
||||||
|
+ check_disk: Use new test function for percentage expressions @RincewindsHat
|
||||||
|
+ check_load: remove unused code @RincewindsHat
|
||||||
|
+ check_curl/check_http: clarified format of POST data @andreasbaumann
|
||||||
|
- introduce _service
|
||||||
|
- refresh patches:
|
||||||
|
+ monitoring-plugins-2.3.5-check_http-proxy.patch
|
||||||
|
-> monitoring-plugins-2.4.0-check_http-proxy.patch
|
||||||
|
+ monitoring-plugins-2.3.5-check_log_-_quoting.patch
|
||||||
|
-> monitoring-plugins-2.4.0-check_log_-_quoting.patch
|
||||||
|
+ monitoring-plugins-2.3.5-check_ntp_perf_absolute.patch
|
||||||
|
-> monitoring-plugins-2.4.0-check_ntp_perf_absolute.patch
|
||||||
|
+ monitoring-plugins-2.3.5-check_swap_wrong_percent.patch
|
||||||
|
-> monitoring-plugins-2.4.0-check_swap_wrong_percent.patch
|
||||||
|
+ monitoring-plugins-2.3.5-plugins-root-Makefile_-_no_chown.patch
|
||||||
|
-> monitoring-plugins-2.4.0-plugins-root-Makefile_-_no_chown.patch
|
||||||
|
- dropped patches:
|
||||||
|
+ monitoring-plugins-2.3.5-check_ssh.patch
|
||||||
|
+ monitoring-plugins-2.3.5-check_ssh.t_-_improve_testing.patch
|
||||||
|
- remove old distribution flags and following subpackages:
|
||||||
|
+ monitoring-plugins-apt
|
||||||
|
+ monitoring-plugins-game
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Apr 8 15:31:23 CEST 2024 - ro@suse.de
|
Mon Apr 8 15:31:23 CEST 2024 - ro@suse.de
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
%bcond_with mssql
|
%bcond_with mssql
|
||||||
|
|
||||||
Name: monitoring-plugins
|
Name: monitoring-plugins
|
||||||
Version: 2.3.5
|
Version: 2.4.0
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: The Monitoring Plug-Ins
|
Summary: The Monitoring Plug-Ins
|
||||||
License: GPL-2.0-or-later AND GPL-3.0-only
|
License: GPL-2.0-or-later AND GPL-3.0-only
|
||||||
@ -63,18 +63,16 @@ Source58: nrpe-check_zombie_procs
|
|||||||
Source59: nrpe-check_mysql
|
Source59: nrpe-check_mysql
|
||||||
Source60: nrpe-check_ups
|
Source60: nrpe-check_ups
|
||||||
# PATCH-FIX-UPSTREAM Quote the options comming in from users (path names might contain whitespaces)
|
# PATCH-FIX-UPSTREAM Quote the options comming in from users (path names might contain whitespaces)
|
||||||
Patch1: %{name}-2.3.5-check_log_-_quoting.patch
|
Patch1: %{name}-2.4.0-check_log_-_quoting.patch
|
||||||
# PATH-FIX-openSUSE - do not use/run chown in Makefile: we use RPM for this
|
# PATH-FIX-openSUSE - do not use/run chown in Makefile: we use RPM for this
|
||||||
Patch6: %{name}-2.3.5-plugins-root-Makefile_-_no_chown.patch
|
Patch6: %{name}-2.4.0-plugins-root-Makefile_-_no_chown.patch
|
||||||
# PATCH-FIX-UPSTREAM see https://bugzilla.redhat.com/512559
|
# PATCH-FIX-UPSTREAM see https://bugzilla.redhat.com/512559
|
||||||
Patch121: %{name}-2.3.5-check_swap_wrong_percent.patch
|
Patch121: %{name}-2.4.0-check_swap_wrong_percent.patch
|
||||||
# PATCH-FIX-UPSTREAM - return ntp offset absolute (as positive value) in performance data since warn and crit are also positive values
|
# PATCH-FIX-UPSTREAM - return ntp offset absolute (as positive value) in performance data since warn and crit are also positive values
|
||||||
Patch122: %{name}-2.3.5-check_ntp_perf_absolute.patch
|
Patch122: %{name}-2.4.0-check_ntp_perf_absolute.patch
|
||||||
# PATCH-FIX-UPSTREAM - see https://github.com/monitoring-plugins/monitoring-plugins/pull/1322
|
Patch130: %{name}-2.4.0-check_http-proxy.patch
|
||||||
Patch125: %{name}-2.3.5-check_ssh.patch
|
Patch131: %{name}-2.4.0-check_dbi-type_mismatch.patch
|
||||||
Patch126: %{name}-2.3.5-check_ssh.t_-_improve_testing.patch
|
BuildRequires: automake
|
||||||
# PATCH-FIX-UPSTREAM - see https://github.com/monitoring-plugins/monitoring-plugins/pull/1862
|
|
||||||
Patch130: %{name}-2.3.5-check_http-proxy.patch
|
|
||||||
BuildRequires: bind-utils
|
BuildRequires: bind-utils
|
||||||
BuildRequires: dhcp-devel
|
BuildRequires: dhcp-devel
|
||||||
BuildRequires: fping
|
BuildRequires: fping
|
||||||
@ -115,22 +113,9 @@ BuildRequires: systemd-devel
|
|||||||
%endif
|
%endif
|
||||||
BuildRequires: samba-client
|
BuildRequires: samba-client
|
||||||
%if 0%{?suse_version}
|
%if 0%{?suse_version}
|
||||||
%if 0%{?suse_version} > 1020
|
|
||||||
BuildRequires: freeradius-client-devel
|
BuildRequires: freeradius-client-devel
|
||||||
BuildRequires: rpcbind
|
BuildRequires: rpcbind
|
||||||
%else
|
|
||||||
BuildRequires: portmap
|
|
||||||
BuildRequires: radiusclient
|
|
||||||
%endif
|
|
||||||
%if 0%{?suse_version} > 910
|
|
||||||
BuildRequires: krb5-devel
|
BuildRequires: krb5-devel
|
||||||
%else
|
|
||||||
BuildRequires: heimdal-devel
|
|
||||||
%endif
|
|
||||||
%else
|
|
||||||
BuildRequires: krb5-devel
|
|
||||||
%endif
|
|
||||||
%if 0%{?suse_version} > 1315
|
|
||||||
BuildRequires: libcurl-devel
|
BuildRequires: libcurl-devel
|
||||||
BuildRequires: uriparser-devel
|
BuildRequires: uriparser-devel
|
||||||
%endif
|
%endif
|
||||||
@ -321,20 +306,6 @@ This virtual package recommends all currently available, official
|
|||||||
Monitoring plugins and additional packages that are available in
|
Monitoring plugins and additional packages that are available in
|
||||||
https://build.opensuse.org/project/show/server:monitoring
|
https://build.opensuse.org/project/show/server:monitoring
|
||||||
|
|
||||||
%if 0%{?suse_version} < 01310
|
|
||||||
%package apt
|
|
||||||
Summary: Check for software updates via apt-get
|
|
||||||
Group: System/Monitoring
|
|
||||||
Requires: %{apt_get_command}
|
|
||||||
Provides: nagios-plugins-apt = %{version}
|
|
||||||
Obsoletes: nagios-plugins-apt <= 1.5
|
|
||||||
|
|
||||||
%description apt
|
|
||||||
This plugin checks for software updates on systems that use package management
|
|
||||||
systems based on the apt-get command found in Debian GNU/Linux or Ubuntu for
|
|
||||||
example.
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%package breeze
|
%package breeze
|
||||||
Summary: Monitor Breezecom wireless equipment
|
Summary: Monitor Breezecom wireless equipment
|
||||||
Group: System/Monitoring
|
Group: System/Monitoring
|
||||||
@ -390,7 +361,6 @@ Obsoletes: nagios-plugins-common <= 1.5
|
|||||||
This package includes the libraries (scripts) that are included by many
|
This package includes the libraries (scripts) that are included by many
|
||||||
of the standard checks.
|
of the standard checks.
|
||||||
|
|
||||||
%if 0%{?suse_version} > 1315
|
|
||||||
%package curl
|
%package curl
|
||||||
Summary: Test the HTTP service on the specified host, via libcurl
|
Summary: Test the HTTP service on the specified host, via libcurl
|
||||||
Group: System/Monitoring
|
Group: System/Monitoring
|
||||||
@ -405,7 +375,6 @@ certificate expiration times.
|
|||||||
|
|
||||||
It makes use of libcurl to do so. It tries to be as compatible to check_http
|
It makes use of libcurl to do so. It tries to be as compatible to check_http
|
||||||
as possible.
|
as possible.
|
||||||
%endif
|
|
||||||
|
|
||||||
%package dbi
|
%package dbi
|
||||||
Summary: Check databases using DBI
|
Summary: Check databases using DBI
|
||||||
@ -480,9 +449,6 @@ Obsoletes: nagios-plugins-dhcp <= 1.5
|
|||||||
%if 0%{?suse_version}
|
%if 0%{?suse_version}
|
||||||
Recommends: apparmor-parser
|
Recommends: apparmor-parser
|
||||||
Recommends: apparmor-profiles
|
Recommends: apparmor-profiles
|
||||||
%else
|
|
||||||
#Requires: apparmor-parser
|
|
||||||
#Requires: apparmor-profiles
|
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%description dhcp
|
%description dhcp
|
||||||
@ -584,19 +550,6 @@ Obsoletes: nagios-plugins-fping <= 1.5
|
|||||||
This plugin will use the fping command to ping the specified host for
|
This plugin will use the fping command to ping the specified host for
|
||||||
a fast check. Note that it is necessary to set the suid flag on fping.
|
a fast check. Note that it is necessary to set the suid flag on fping.
|
||||||
|
|
||||||
%if 0%{?suse_version} < 01310
|
|
||||||
%package game
|
|
||||||
Summary: Gameserver check
|
|
||||||
Group: System/Monitoring
|
|
||||||
Requires: %{qstat_command}
|
|
||||||
Provides: nagios-plugins-game = %{version}
|
|
||||||
Obsoletes: nagios-plugins-game <= 1.5
|
|
||||||
|
|
||||||
%description game
|
|
||||||
Check connections to game servers. This plugin uses the 'qstat' command, the
|
|
||||||
popular game server status query tool.
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%package hpjd
|
%package hpjd
|
||||||
Summary: Check status of an HP printer
|
Summary: Check status of an HP printer
|
||||||
Group: System/Monitoring
|
Group: System/Monitoring
|
||||||
@ -852,9 +805,6 @@ Provides: %{name}-ntp = %{version}
|
|||||||
%if 0%{?suse_version}
|
%if 0%{?suse_version}
|
||||||
Recommends: apparmor-parser
|
Recommends: apparmor-parser
|
||||||
Recommends: apparmor-profiles
|
Recommends: apparmor-profiles
|
||||||
%else
|
|
||||||
#Requires: apparmor-parser
|
|
||||||
#Requires: apparmor-profiles
|
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%description ntp_time
|
%description ntp_time
|
||||||
@ -1148,7 +1098,7 @@ or one selected. It can also check queue there:
|
|||||||
it will provide the size of the queue of age of queue.
|
it will provide the size of the queue of age of queue.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
%autosetup -p1
|
||||||
%if 0%{?suse_version}
|
%if 0%{?suse_version}
|
||||||
mkdir -p example/permissions.d
|
mkdir -p example/permissions.d
|
||||||
cp %{S:11} example/permissions.d/%{name}
|
cp %{S:11} example/permissions.d/%{name}
|
||||||
@ -1174,17 +1124,9 @@ with the libdbi driver for $extension.
|
|||||||
EOF
|
EOF
|
||||||
done
|
done
|
||||||
|
|
||||||
%patch -P 1 -p1
|
|
||||||
%patch -P 6 -p1
|
|
||||||
# Debian patches
|
|
||||||
%patch -P 121 -p1
|
|
||||||
%patch -P 122 -p1
|
|
||||||
# Github patches
|
|
||||||
%patch -P 125 -p1
|
|
||||||
%patch -P 126 -p1
|
|
||||||
%patch -P 130 -p1
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
autoreconf -v --force --install
|
||||||
export CFLAGS="%{optflags} -fno-strict-aliasing -DLDAP_DEPRECATED"
|
export CFLAGS="%{optflags} -fno-strict-aliasing -DLDAP_DEPRECATED"
|
||||||
# Translations were (temporarily?) removed upstream:
|
# Translations were (temporarily?) removed upstream:
|
||||||
# https://github.com/monitoring-plugins/monitoring-plugins/pull/1947
|
# https://github.com/monitoring-plugins/monitoring-plugins/pull/1947
|
||||||
@ -1207,18 +1149,15 @@ export CFLAGS="%{optflags} -fno-strict-aliasing -DLDAP_DEPRECATED"
|
|||||||
--with-ps-format='%s %d %d %d %d %d %f %s %s %n' \
|
--with-ps-format='%s %d %d %d %d %d %f %s %s %n' \
|
||||||
--with-ps-cols=10 \
|
--with-ps-cols=10 \
|
||||||
--with-ps-varlist='procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procetime,procprog,&pos' \
|
--with-ps-varlist='procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procetime,procprog,&pos' \
|
||||||
%if 0%{?suse_version} > 1300
|
|
||||||
--with-rpcinfo-command=/sbin/rpcinfo \
|
--with-rpcinfo-command=/sbin/rpcinfo \
|
||||||
%else
|
|
||||||
--with-rpcinfo-command=%{_sbindir}/rpcinfo \
|
|
||||||
%endif
|
|
||||||
--with-qstat-command=%{qstat_command} \
|
--with-qstat-command=%{qstat_command} \
|
||||||
--with-mysql=%{_prefix} \
|
--with-mysql=%{_prefix} \
|
||||||
--disable-rpath
|
--disable-rpath
|
||||||
|
|
||||||
make all %{?_smp_mflags}
|
make all %{?_smp_mflags}
|
||||||
|
|
||||||
%install
|
%install
|
||||||
sed -i 's,^MKINSTALLDIRS.*,MKINSTALLDIRS = ../mkinstalldirs,' po/Makefile
|
# sed -i 's,^MKINSTALLDIRS.*,MKINSTALLDIRS = ../mkinstalldirs,' po/Makefile
|
||||||
%make_install install-root
|
%make_install install-root
|
||||||
install -m 0755 %{S:18} %{buildroot}%{nagios_plugindir}/check_cups
|
install -m 0755 %{S:18} %{buildroot}%{nagios_plugindir}/check_cups
|
||||||
# provide check_host and check_rta_multi as on Debian
|
# provide check_host and check_rta_multi as on Debian
|
||||||
@ -1229,10 +1168,8 @@ if [ -x %{buildroot}%{nagios_plugindir}/check_icmp ] ; then
|
|||||||
ln -s %{nagios_plugindir}/check_icmp %{buildroot}%{nagios_plugindir}/check_rta_multi ;
|
ln -s %{nagios_plugindir}/check_icmp %{buildroot}%{nagios_plugindir}/check_rta_multi ;
|
||||||
fi
|
fi
|
||||||
# Factory maintainers do not want packages requiring software not in Factory: remove the checks
|
# Factory maintainers do not want packages requiring software not in Factory: remove the checks
|
||||||
%if 0%{?suse_version} >= 01310
|
|
||||||
rm %{buildroot}%{nagios_plugindir}/check_apt
|
rm %{buildroot}%{nagios_plugindir}/check_apt
|
||||||
rm %{buildroot}%{nagios_plugindir}/check_game
|
rm %{buildroot}%{nagios_plugindir}/check_game
|
||||||
%endif
|
|
||||||
|
|
||||||
# mssql plugin is not installable due to missing package DBD::Sybase - Do not ship until built --with=mssql
|
# mssql plugin is not installable due to missing package DBD::Sybase - Do not ship until built --with=mssql
|
||||||
%if %{without mssql}
|
%if %{without mssql}
|
||||||
@ -1304,41 +1241,31 @@ EOF
|
|||||||
install -Dm 644 %{SOURCE27} %{buildroot}%{_sysconfdir}/%{name}/README
|
install -Dm 644 %{SOURCE27} %{buildroot}%{_sysconfdir}/%{name}/README
|
||||||
touch %{buildroot}%{_sysconfdir}/%{name}/%{name}.ini
|
touch %{buildroot}%{_sysconfdir}/%{name}/%{name}.ini
|
||||||
|
|
||||||
# find locale files
|
|
||||||
%find_lang %{name}
|
%check
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
%if 0%{?suse_version}
|
%if 0%{?suse_version}
|
||||||
%post dhcp
|
%post dhcp
|
||||||
# in case somebody uses the permissions file we provide
|
# in case somebody uses the permissions file we provide
|
||||||
# in docdir, run permission here
|
# in docdir, run permission here
|
||||||
if [ -f %{_sysconfdir}/permissions.d/monitoring-plugins ]; then
|
if [ -f %{_sysconfdir}/permissions.d/monitoring-plugins ]; then
|
||||||
%if 0%{?suse_version} < 1210
|
|
||||||
%run_permissions
|
|
||||||
%else
|
|
||||||
%set_permissions monitoring-plugins
|
%set_permissions monitoring-plugins
|
||||||
%endif
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
%post icmp
|
%post icmp
|
||||||
if [ -f %{_sysconfdir}/permissions.d/monitoring-plugins ]; then
|
if [ -f %{_sysconfdir}/permissions.d/monitoring-plugins ]; then
|
||||||
# in case somebody uses the permissions file we provide
|
# in case somebody uses the permissions file we provide
|
||||||
# in docdir, run permission here
|
# in docdir, run permission here
|
||||||
%if 0%{?suse_version} < 1210
|
|
||||||
%run_permissions
|
|
||||||
%else
|
|
||||||
%set_permissions monitoring-plugins
|
%set_permissions monitoring-plugins
|
||||||
%endif
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
%post ide_smart
|
%post ide_smart
|
||||||
if [ -f %{_sysconfdir}/permissions.d/monitoring-plugins ]; then
|
if [ -f %{_sysconfdir}/permissions.d/monitoring-plugins ]; then
|
||||||
# in case somebody uses the permissions file we provide
|
# in case somebody uses the permissions file we provide
|
||||||
# in docdir, run permission here
|
# in docdir, run permission here
|
||||||
%if 0%{?suse_version} < 1210
|
|
||||||
%run_permissions
|
|
||||||
%else
|
|
||||||
%set_permissions monitoring-plugins
|
%set_permissions monitoring-plugins
|
||||||
%endif
|
|
||||||
fi
|
fi
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
@ -1381,7 +1308,7 @@ fi
|
|||||||
%dir %{nagios_plugindir}
|
%dir %{nagios_plugindir}
|
||||||
%{nagios_plugindir}/check_cluster
|
%{nagios_plugindir}/check_cluster
|
||||||
|
|
||||||
%files common -f %{name}.lang
|
%files common
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
%doc ABOUT-NLS ACKNOWLEDGEMENTS AUTHORS ChangeLog CODING FAQ
|
%doc ABOUT-NLS ACKNOWLEDGEMENTS AUTHORS ChangeLog CODING FAQ
|
||||||
%doc NEWS README REQUIREMENTS SUPPORT README.SUSE
|
%doc NEWS README REQUIREMENTS SUPPORT README.SUSE
|
||||||
@ -1404,12 +1331,10 @@ fi
|
|||||||
%{nagios_plugindir}/utils.sh
|
%{nagios_plugindir}/utils.sh
|
||||||
%attr(0644,root,root) %{nagios_plugindir}/utils.pm
|
%attr(0644,root,root) %{nagios_plugindir}/utils.pm
|
||||||
|
|
||||||
%if 0%{?suse_version} > 1315
|
|
||||||
%files curl
|
%files curl
|
||||||
%defattr(0755,root,root)
|
%defattr(0755,root,root)
|
||||||
%dir %{nagios_plugindir}
|
%dir %{nagios_plugindir}
|
||||||
%{nagios_plugindir}/check_curl
|
%{nagios_plugindir}/check_curl
|
||||||
%endif
|
|
||||||
|
|
||||||
%files dbi
|
%files dbi
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
@ -1482,13 +1407,6 @@ fi
|
|||||||
%dir %{nagios_plugindir}
|
%dir %{nagios_plugindir}
|
||||||
%{nagios_plugindir}/check_fping
|
%{nagios_plugindir}/check_fping
|
||||||
|
|
||||||
%if 0%{?suse_version} < 01310
|
|
||||||
%files game
|
|
||||||
%defattr(0755,root,root)
|
|
||||||
%dir %{nagios_plugindir}
|
|
||||||
%{nagios_plugindir}/check_game
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%files hpjd
|
%files hpjd
|
||||||
%defattr(0755,root,root)
|
%defattr(0755,root,root)
|
||||||
%dir %{nagios_plugindir}
|
%dir %{nagios_plugindir}
|
||||||
|
@ -8,5 +8,5 @@
|
|||||||
/proc/uptime r,
|
/proc/uptime r,
|
||||||
/proc/meminfo r,
|
/proc/meminfo r,
|
||||||
/proc/loadavg r,
|
/proc/loadavg r,
|
||||||
/run/systemd/sessions/1 r,
|
/run/systemd/sessions/* r,
|
||||||
}
|
}
|
||||||
|
@ -9,5 +9,6 @@
|
|||||||
/{usr/,}bin/ps rix,
|
/{usr/,}bin/ps rix,
|
||||||
/proc/ r,
|
/proc/ r,
|
||||||
/proc/** r,
|
/proc/** r,
|
||||||
|
/sys/devices/system/node/ r,
|
||||||
/usr/lib/nagios/plugins/check_procs mr,
|
/usr/lib/nagios/plugins/check_procs mr,
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user