Explorar o código

Added multiline output capability to check_by_ssh. Thanks to Matthias Flacke (#1769653)

git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1792 f882894a-f735-0410-b71e-b25c423dba1c
Matthias Eble %!s(int64=18) %!d(string=hai) anos
pai
achega
e8d6f41fad
Modificáronse 2 ficheiros con 3 adicións e 1 borrados
  1. 1 0
      NEWS
  2. 2 1
      plugins/check_by_ssh.c

+ 1 - 0
NEWS

@@ -29,6 +29,7 @@ This file documents the major additions and syntax changes between releases.
 	  - enforce a full path for the command to run
 	The "negate" utility can now remap custom states
 	Check_radius now supports radiusclient-ng
+	Check_by_ssh now supports multiline output
 
 1.4.9 4th June 2006
 	Inclusion of contrib/check_cluster2 as check_cluster with some improvements

+ 2 - 1
plugins/check_by_ssh.c

@@ -110,7 +110,8 @@ main (int argc, char **argv)
 	 * Wrap up quickly and keep the tricks below */
 	if(!passive) {
 		if (chld_out.lines > skip_stdout)
-			puts (chld_out.line[skip_stdout]);
+			for (i = skip_stdout; i < chld_out.lines; i++)
+				puts (chld_out.line[i]);
 		else
 			printf (_("%s - check_by_ssh: Remote command '%s' returned status %d\n"),
 			        state_text(result), remotecmd, result);