--- check_dhcp.c.orig 2005-11-18 13:47:21.000000000 -0500 +++ check_dhcp.c 2005-11-18 13:55:21.000000000 -0500 @@ -27,8 +27,8 @@ *****************************************************************************/ const char *progname = "check_dhcp"; -const char *revision = "$Revision: 1.7 $"; -const char *copyright = "2001-2004"; +const char *revision = "$Revision: 1.8 $"; +const char *copyright = "2001-2005"; const char *email = "nagiosplug-devel@lists.sourceforge.net"; #include "common.h" @@ -106,11 +106,6 @@ /**** Common definitions ****/ -#define STATE_OK 0 -#define STATE_WARNING 1 -#define STATE_CRITICAL 2 -#define STATE_UNKNOWN -1 - #define OK 0 #define ERROR -1 @@ -241,7 +236,7 @@ int main(int argc, char **argv){ int dhcp_socket; - int result; + int result = STATE_UNKNOWN; setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); @@ -921,8 +916,14 @@ else if(request_specific_address==TRUE && received_requested_address==FALSE) result=STATE_WARNING; - - printf("DHCP %s: ",(result==STATE_OK)?"ok":"problem"); + if(result==0) /* garrett honeycutt 2005 */ + printf("OK: "); + else if(result==1) + printf("WARNING: "); + else if(result==2) + printf("CRITICAL: "); + else if(result==3) + printf("UNKNOWN: "); /* we didn't receive any DHCPOFFERs */ if(dhcp_offer_list==NULL){