[Pkg-nagios-changes] [pkg-nagios-plugins] 169/413: fix logout problems

Jan Wagner waja at moszumanska.debian.org
Tue Nov 26 23:13:19 UTC 2013


This is an automated email from the git hooks/post-receive script.

waja pushed a commit to branch master
in repository pkg-nagios-plugins.

commit e55ac6cafee0cbb7e03b43bd943750d665fd37ba
Author: Jan Wagner <waja at cyconet.org>
Date:   Fri Jan 30 21:40:48 2009 +0000

    fix logout problems
---
 debian/changelog                             |  2 ++
 debian/patches/00list                        |  1 +
 debian/patches/42_check_ups_logoutfix.dpatch | 34 ++++++++++++++++++++++++++++
 3 files changed, 37 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index e670910..7889b99 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,8 @@ nagios-plugins (1.4.12-5) UNRELEASED; urgency=low
     it's behavior in etch (Closes: #505610)
   * add -e to all preconfigured check commands using check_disk, to only display
     effected partitions, when warning or critical (Closes: #395389)
+  * add 42_check_ups_logoutfix.dpatch to fix logout problem with check_ups
+    (Closes: #387001)
 
  -- Jan Wagner <waja at cyconet.org>  Thu, 02 Oct 2008 00:45:31 +0200
 
diff --git a/debian/patches/00list b/debian/patches/00list
index 6caeff5..0d29d8f 100644
--- a/debian/patches/00list
+++ b/debian/patches/00list
@@ -16,4 +16,5 @@
 39_check_dig_options.dpatch
 40_check_http_status_line.dpatch
 41_check_http_fix_http_header.dpatch
+42_check_ups_logoutfix.dpatch
 50_misc_typos.dpatch
diff --git a/debian/patches/42_check_ups_logoutfix.dpatch b/debian/patches/42_check_ups_logoutfix.dpatch
new file mode 100644
index 0000000..f106ca4
--- /dev/null
+++ b/debian/patches/42_check_ups_logoutfix.dpatch
@@ -0,0 +1,34 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 42_check_ups_logoutfix.dpatch by Olivier 'Babar' Raginel <nagios at babar.us>
+##
+## DP: Fixing Lougout
+
+ at DPATCH@
+diff -urNad nagios-plugins-1.4.12~/plugins/check_ups.c nagios-plugins-1.4.12/plugins/check_ups.c
+--- nagios-plugins-1.4.12~/plugins/check_ups.c	2008-05-07 12:02:42.000000000 +0200
++++ nagios-plugins-1.4.12/plugins/check_ups.c	2009-01-30 22:31:37.000000000 +0100
+@@ -398,12 +398,15 @@
+ 	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
+@@ -415,6 +418,7 @@
+ 
+ 	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);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-nagios/pkg-nagios-plugins.git



More information about the Pkg-nagios-changes mailing list