[icinga-checkins] icinga.org: icinga-nrpe/mfriedrich/fixes: Fix the DEBUG issue , modifying the syslog (LOG_DEBUG ...) to be syslog (LOG_INFO ...) to enable verbose output

git at icinga.org git at icinga.org
Wed Nov 23 18:46:33 CET 2011


Module: icinga-nrpe
Branch: mfriedrich/fixes
Commit: da9db187fa5b1501ca5598aeeaa781bbc5dcf769
URL:    https://git.icinga.org/?p=icinga-nrpe.git;a=commit;h=da9db187fa5b1501ca5598aeeaa781bbc5dcf769

Author: assaf <assaf at AikiLinux-laptop.(none)>
Date:   Mon Nov 21 14:29:14 2011 +0000

Fix the DEBUG issue , modifying the syslog (LOG_DEBUG ...) to be syslog (LOG_INFO ...) to enable verbose output
when nrpe debug is enabled

---

 src/nrpe.c |   30 +++++++++++++++---------------
 1 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/src/nrpe.c b/src/nrpe.c
index ee2f08f..e6b9cdf 100644
--- a/src/nrpe.c
+++ b/src/nrpe.c
@@ -703,7 +703,7 @@ int add_command(char *command_name, char *command_line) {
 	command_list = new_command;
 
 	if (debug == TRUE)
-		syslog(LOG_DEBUG, "Added command[%s]=%s\n", command_name, command_line);
+		syslog(LOG_INFO, "Added command[%s]=%s\n", command_name, command_line);
 
 	return OK;
 }
@@ -901,7 +901,7 @@ void wait_for_connections(void) {
 
 					/* log info to syslog facility */
 					if (debug == TRUE)
-						syslog(LOG_DEBUG, "Connection from %s port %d", get_ip_str(remoteaddr, buf, BUFLEN), get_port(remoteaddr));
+						syslog(LOG_INFO, "Connection from %s port %d", get_ip_str(remoteaddr, buf, BUFLEN), get_port(remoteaddr));
 
 					/* is this is a blessed machine? */
 					if (allowed_hosts) {
@@ -911,7 +911,7 @@ void wait_for_connections(void) {
 
 							/* log info to syslog facility */
 							if (debug == TRUE)
-								syslog(LOG_DEBUG, "Connection from %s closed.", get_ip_str(remoteaddr, buf, BUFLEN));
+								syslog(LOG_INFO, "Connection from %s closed.", get_ip_str(remoteaddr, buf, BUFLEN));
 
 							/* close socket prior to exiting */
 							close(new_sd);
@@ -921,7 +921,7 @@ void wait_for_connections(void) {
 
 							/* log info to syslog facility */
 							if (debug == TRUE)
-								syslog(LOG_DEBUG, "Host address is in allowed_hosts");
+								syslog(LOG_INFO, "Host address is in allowed_hosts");
 						}
 					}
 
@@ -933,7 +933,7 @@ void wait_for_connections(void) {
 
 					if (!hosts_access(&req)) {
 
-						syslog(LOG_DEBUG, "Connection refused by TCP wrapper");
+						syslog(LOG_INFO, "Connection refused by TCP wrapper");
 
 						/* refuse the connection */
 						refuse(&req);
@@ -950,7 +950,7 @@ void wait_for_connections(void) {
 
 					/* log info to syslog facility */
 					if (debug == TRUE)
-						syslog(LOG_DEBUG, "Connection from %s closed.", get_ip_str(remoteaddr, buf, BUFLEN));
+						syslog(LOG_INFO, "Connection from %s closed.", get_ip_str(remoteaddr, buf, BUFLEN));
 
 					/* close socket prior to exiting */
 					close(new_sd);
@@ -1009,7 +1009,7 @@ int is_an_allowed_host(const struct sockaddr *connecting_host) {
 		addrinfo.ai_protocol = IPPROTO_TCP;
 
 		if (rval = getaddrinfo(temp_ptr, NULL, &addrinfo, &res) != 0) {
-			syslog(LOG_DEBUG, "Invalid host name in allowed_hosts '%s'\n", temp_ptr);
+			syslog(LOG_INFO, "Invalid host name in allowed_hosts '%s'\n", temp_ptr);
 		} else {
 			for (r = res; r; r = r->ai_next) {
 				if (sockaddr_equal(r->ai_addr, connecting_host)) {
@@ -1054,7 +1054,7 @@ void handle_connection(int sock) {
 
 	/* log info to syslog facility */
 	if (debug == TRUE)
-		syslog(LOG_DEBUG, "Handling the connection...");
+		syslog(LOG_INFO, "Handling the connection...");
 
 #ifdef OLDSTUFF
 	/* socket should be non-blocking */
@@ -1171,7 +1171,7 @@ void handle_connection(int sock) {
 
 	/* log info to syslog facility */
 	if (debug == TRUE)
-		syslog(LOG_DEBUG, "Host is asking for command '%s' to be run...", receive_packet.buffer);
+		syslog(LOG_INFO, "Host is asking for command '%s' to be run...", receive_packet.buffer);
 
 	/* disable connection alarm - a new alarm will be setup during my_system */
 	alarm(0);
@@ -1187,7 +1187,7 @@ void handle_connection(int sock) {
 
 		/* log info to syslog facility */
 		if (debug == TRUE)
-			syslog(LOG_DEBUG, "Response: %s", buffer);
+			syslog(LOG_INFO, "Response: %s", buffer);
 
 		result = STATE_OK;
 	}
@@ -1202,7 +1202,7 @@ void handle_connection(int sock) {
 
 			/* log error to syslog facility */
 			if (debug == TRUE)
-				syslog(LOG_DEBUG, "%s", buffer);
+				syslog(LOG_INFO, "%s", buffer);
 
 			result = STATE_CRITICAL;
 		}
@@ -1219,7 +1219,7 @@ void handle_connection(int sock) {
 
 			/* log info to syslog facility */
 			if (debug == TRUE)
-				syslog(LOG_DEBUG, "Running command: %s", processed_command);
+				syslog(LOG_INFO, "Running command: %s", processed_command);
 
 			/* run the command */
 			strcpy(buffer, "");
@@ -1227,7 +1227,7 @@ void handle_connection(int sock) {
 
 			/* log debug info */
 			if (debug == TRUE)
-				syslog(LOG_DEBUG, "Command completed with return code %d and output: %s", result, buffer);
+				syslog(LOG_INFO, "Command completed with return code %d and output: %s", result, buffer);
 
 			/* see if the command timed out */
 			if (early_timeout == TRUE)
@@ -1265,7 +1265,7 @@ void handle_connection(int sock) {
 	/* START MULTI_PACKET LOOP */
 	do {
 		if (debug == TRUE)
-			syslog(LOG_DEBUG, "Sending response - bytes left: %d", strlen(pbuffer));
+			syslog(LOG_INFO, "Sending response - bytes left: %d", strlen(pbuffer));
 
 		/* clear the response packet buffer */
 		memset(&send_packet, 0, sizeof(send_packet));
@@ -1316,7 +1316,7 @@ void handle_connection(int sock) {
 
 	/* log info to syslog facility */
 	if (debug == TRUE)
-		syslog(LOG_DEBUG, "Return Code: %d, Output: %s", result, buffer);
+		syslog(LOG_INFO, "Return Code: %d, Output: %s", result, buffer);
 
 	return;
 }





More information about the icinga-checkins mailing list