summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 96d6281)
raw | patch | inline | side by side (parent: 96d6281)
author | Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> | |
Tue, 4 Nov 2008 04:46:31 +0000 (04:46 +0000) | ||
committer | Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> | |
Tue, 4 Nov 2008 04:46:31 +0000 (04:46 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2062 f882894a-f735-0410-b71e-b25c423dba1c
NEWS | patch | blob | history | |
THANKS.in | patch | blob | history | |
plugins/check_ups.c | patch | blob | history |
index e5c7d11e36bae09f9ded5e5e97dd528df04ffdf9..0156701730e5fc3de6be572ae0ce35ff451fae77 100644 (file)
--- a/NEWS
+++ b/NEWS
Updated tinderbox_build script to point to new tinderbox server
check_ifoperstatus -n flag now works as expected (sf.net #1569488)
check_ifoperstatus now supports ifType based lookup for ifIndex
+ check_ups now sends a LOGOUT string (debian bug #387001)
1.4.13 25th Sept 2008
Fix Debian bug #460097: check_http --max-age broken (Hilko Bengen)
diff --git a/THANKS.in b/THANKS.in
index a003fa8162f301dfb1ee4b2608ab81c418475343..80fa47a3d46c3853a254796b7c1d626c6a67614b 100644 (file)
--- a/THANKS.in
+++ b/THANKS.in
Hilko Bengen
Sven Nierlein
Erik Wasser
+Tilman Koschnick
+Olivier 'Babar' Raginel
diff --git a/plugins/check_ups.c b/plugins/check_ups.c
index 154508dba57c55d878820690033abe68b8bc89d4..bbd963a91983ad180e7d78a8edbe5eeaa14e321d 100644 (file)
--- a/plugins/check_ups.c
+++ b/plugins/check_ups.c
char temp_buffer[MAX_INPUT_BUFFER];
char send_buffer[MAX_INPUT_BUFFER];
char *ptr;
+ char *logout = "OK Goodbye\n";
+ int logout_len = strlen(logout);
int len;
*buf=0;
/* create the command string to send to the UPS daemon */
- sprintf (send_buffer, "GET VAR %s %s\n", ups_name, varname);
+ /* Add LOGOUT to avoid read failure logs */
+ sprintf (send_buffer, "GET VAR %s %s\nLOGOUT\n", ups_name, varname);
/* send the command to the daemon and get a response back */
if (process_tcp_request
ptr = temp_buffer;
len = strlen(ptr);
+ if (len > logout_len && strcmp (ptr + len - logout_len, logout) == 0) len -= logout_len;
if (len > 0 && ptr[len-1] == '\n') ptr[len-1]=0;
if (strcmp (ptr, "ERR UNKNOWN-UPS") == 0) {
printf (_("CRITICAL - no such ups '%s' on that host\n"), ups_name);