From 0b6423f9c99d9edf8c96fefd0f6c453859395aa1 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Mon, 30 Sep 2013 00:03:24 +0200 Subject: Import Nagios Plugins site Import the Nagios Plugins web site, Cronjobs, infrastructure scripts, and configuration files. --- .../156798-check_dhcp--standardize.diff | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 web/attachments/156798-check_dhcp--standardize.diff (limited to 'web/attachments/156798-check_dhcp--standardize.diff') diff --git a/web/attachments/156798-check_dhcp--standardize.diff b/web/attachments/156798-check_dhcp--standardize.diff new file mode 100644 index 0000000..00cfc4c --- /dev/null +++ b/web/attachments/156798-check_dhcp--standardize.diff @@ -0,0 +1,51 @@ +--- 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){ -- cgit v1.2.3-74-g34f1