Package: nagios-nrpe-plugin Version: 3.0.1-3+deb9u1 Severity: important Dear Maintainer,
check_nrpe logs "Remote %s accepted a Version %d Packet" for every invocation which on a large installation leads to logs overrunning the disk. The issue here is the same: https://support.nagios.com/forum/viewtopic.php?f=7&t=41115 Applying https://github.com/NagiosEnterprises/nrpe/commit/fe006d2556c906de84321188630ab0d25c317cc1 and https://github.com/NagiosEnterprises/nrpe/commit/fe006d2556c906de84321188630ab0d25c317cc1 appear to resolve the issue in our installation. -- System Information: Debian Release: 9.5 APT prefers stable-updates APT policy: (500, 'stable-updates'), (500, 'stable') Architecture: amd64 (x86_64) Kernel: Linux 4.9.0-8-amd64 (SMP w/32 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) Versions of packages nagios-nrpe-plugin depends on: ii libc6 2.24-11+deb9u3 ii libssl1.0.2 1.0.2l-2+deb9u3 nagios-nrpe-plugin recommends no packages. nagios-nrpe-plugin suggests no packages. -- Configuration Files: /etc/nagios-plugins/config/check_nrpe.cfg [Errno 2] No such file or directory: '/etc/nagios-plugins/config/check_nrpe.cfg' -- no debconf information
>From fe006d2556c906de84321188630ab0d25c317cc1 Mon Sep 17 00:00:00 2001 From: "John C. Frickson" <jfrick...@nagios.com> Date: Mon, 26 Sep 2016 13:52:22 -0500 Subject: [PATCH] check_nrpe info logging Fix for issue https://github.com/NagiosEnterprises/nrpe/issues/64 --- src/check_nrpe.c | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) 3.0 - 2016-08-01 diff --git a/src/check_nrpe.c b/src/check_nrpe.c index f5d32d2..41d92a9 100644 --- a/src/check_nrpe.c +++ b/src/check_nrpe.c @@ -46,6 +46,7 @@ int show_help = FALSE; int show_license = FALSE; int show_version = FALSE; int packet_ver = NRPE_PACKET_VERSION_3; +int force_v2_packet = 0; int payload_size = 0; #ifdef HAVE_SSL @@ -149,7 +150,7 @@ int main(int argc, char **argv) if (result == -1) { /* Failure reading from remote, so try version 2 packet */ - syslog(LOG_NOTICE, "Remote %s does not support Version 3 Packets", rem_host); + syslog(LOG_INFO, "Remote %s does not support Version 3 Packets", rem_host); packet_ver = NRPE_PACKET_VERSION_2; /* Rerun the setup */ @@ -168,8 +169,12 @@ int main(int argc, char **argv) result = read_response(); /* Get the response */ } - if (result != -1) - syslog(LOG_NOTICE, "Remote %s accepted a Version %d Packet", rem_host, packet_ver); + if (result != -1) { + if (force_v2_packet = 0 && packet_ver == NRPE_PACKET_VERSION_2) + syslog(LOG_INFO, "Remote %s accepted a Version %d Packet", rem_host, packet_ver); + else + syslog(LOG_DEBUG, "Remote %s accepted a Version %d Packet", rem_host, packet_ver); + } return result; } @@ -336,6 +341,7 @@ int process_arguments(int argc, char **argv, int from_config_file) break; } packet_ver = NRPE_PACKET_VERSION_2; + force_v2_packet = 1; break; case '4':
>From 08425ff922b71a108da8bd457a9c63c3a20c04c6 Mon Sep 17 00:00:00 2001 From: "John C. Frickson" <jfrick...@nagios.com> Date: Mon, 5 Dec 2016 14:18:38 -0600 Subject: [PATCH] "Remote %s accepted a Version %s Packet", please add to debug Partial fix for issue #72 I would really rather not add another command-line flag at this point, so instead I changed a little what gets logged. If check_nrpe is v3.x, it will NOT log any messages if the remote accepts a version 3 packet. If the `-2` switch (only use version 2 packet) was set, it will NOT log any messages. It will only log a message if it first tried to send a version 3 packet, failed, and sent a version 2 packet which succeeded. It will be logged with logleve `LOG_DEBUG`. It's not quite what the origianal poster wanted, but it should reduce the number of log messages. --- src/check_nrpe.c | 8 ++------ 2 files changed, 3 insertions(+), 6 deletions(-) 3.0.1 - 2016-09-08 diff --git a/src/check_nrpe.c b/src/check_nrpe.c index 5b51234..e9df2b3 100644 --- a/src/check_nrpe.c +++ b/src/check_nrpe.c @@ -169,12 +169,8 @@ int main(int argc, char **argv) result = read_response(); /* Get the response */ } - if (result != -1) { - if (force_v2_packet = 0 && packet_ver == NRPE_PACKET_VERSION_2) - syslog(LOG_INFO, "Remote %s accepted a Version %d Packet", rem_host, packet_ver); - else - syslog(LOG_DEBUG, "Remote %s accepted a Version %d Packet", rem_host, packet_ver); - } + if (result != -1 && force_v2_packet == 0 && packet_ver == NRPE_PACKET_VERSION_2) + syslog(LOG_DEBUG, "Remote %s accepted a Version %d Packet", rem_host, packet_ver); return result; }