Module: check_mk
Branch: master
Commit: 84ea9dec58ba83b88826058562ffe96345baa8f4
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=84ea9dec58ba83…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Tue Jan 8 15:44:08 2019 +0100
6965 FIX Fixed socket timeout handling in check_mkevents active check
The microseconds part of the socket timeout was not set, so a "Numerical
argument out of domain" error could happen randomly. This has been fixed.
Change-Id: I5d8712b81cc83e4e585fb07ba286ae1bc73a6390
---
.werks/6965 | 11 +++++++++++
active_checks/check_mkevents.cc | 2 ++
2 files changed, 13 insertions(+)
diff --git a/.werks/6965 b/.werks/6965
new file mode 100644
index 0000000..082e631
--- /dev/null
+++ b/.werks/6965
@@ -0,0 +1,11 @@
+Title: Fixed socket timeout handling in check_mkevents active check
+Level: 2
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1546958524
+Class: fix
+
+The microseconds part of the socket timeout was not set, so a "Numerical
+argument out of domain" error could happen randomly. This has been fixed.
diff --git a/active_checks/check_mkevents.cc b/active_checks/check_mkevents.cc
index 1925e92..ba4845e 100644
--- a/active_checks/check_mkevents.cc
+++ b/active_checks/check_mkevents.cc
@@ -168,6 +168,7 @@ int main(int argc, char **argv) {
struct timeval tv;
tv.tv_sec = 10;
+ tv.tv_usec = 0;
if (setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, &tv,
sizeof(struct timeval)) == -1) {
ioError("Cannot set socket reveive timeout");
@@ -205,6 +206,7 @@ int main(int argc, char **argv) {
struct timeval tv;
tv.tv_sec = 3;
+ tv.tv_usec = 0;
if (setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, &tv,
sizeof(struct timeval)) == -1) {
ioError("Cannot set socket reveive timeout");