From 530f99c0d840ddb52257175e61b963ae7ffb3212 Mon Sep 17 00:00:00 2001
From: Feraudet Cyril <cyril@feraudet.com>
Date: Mon, 20 May 2013 11:10:41 +0200
Subject: [PATCH] Prefix error with "CHECK_NRPE: " as in check_nrpe.c

---
 src/utils.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/utils.c b/src/utils.c
index 48d7e58..8791bae 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -136,7 +136,7 @@ int my_connect(char *host_name,int port,int *sd,char *proto){
                /* else do a DNS lookup */
                hp=gethostbyname((const char *)host_name);
                if(hp==NULL){
-                       printf("Invalid host name '%s'\n",host_name);
+                       printf("CHECK_NRPE: Invalid host name '%s'\n",host_name);
                        return STATE_UNKNOWN;
                        }
 
@@ -145,14 +145,14 @@ int my_connect(char *host_name,int port,int *sd,char *proto){
 
        /* map transport protocol name to protocol number */
        if(((ptrp=getprotobyname(proto)))==NULL){
-               printf("Cannot map \"%s\" to protocol number\n",proto);
+               printf("CHECK_NRPE: Cannot map \"%s\" to protocol number\n",proto);
                return STATE_UNKNOWN;
                }
 
        /* create a socket */
        *sd=socket(PF_INET,(!strcmp(proto,"udp"))?SOCK_DGRAM:SOCK_STREAM,ptrp->p_proto);
        if(*sd<0){
-               printf("Socket creation failed\n");
+               printf("CHECK_NRPE: Socket creation failed\n");
                return STATE_UNKNOWN;
                }
 
@@ -161,16 +161,16 @@ int my_connect(char *host_name,int port,int *sd,char *proto){
        if(result<0){
                switch(errno){  
                case ECONNREFUSED:
-                       printf("Connection refused by host\n");
+                       printf("CHECK_NRPE: Connection refused by host\n");
                        break;
                case ETIMEDOUT:
-                       printf("Timeout while attempting connection\n");
+                       printf("CHECK_NRPE: Timeout while attempting connection\n");
                        break;
                case ENETUNREACH:
-                       printf("Network is unreachable\n");
+                       printf("CHECK_NRPE: Network is unreachable\n");
                        break;
                default:
-                       printf("Connection refused or timed out\n");
+                       printf("CHECK_NRPE: Connection refused or timed out\n");
                        }
 
                return STATE_CRITICAL;
-- 
1.8.1.2

