diff options
| author | Holger Weiss <holger@zedat.fu-berlin.de> | 2013-09-30 00:03:24 +0200 |
|---|---|---|
| committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2013-09-30 00:03:24 +0200 |
| commit | 0b6423f9c99d9edf8c96fefd0f6c453859395aa1 (patch) | |
| tree | 1c2b6b21704a294940f87c7892676998d8371707 /web/attachments/156798-check_dhcp--standardize.diff | |
| download | site-0b6423f9c99d9edf8c96fefd0f6c453859395aa1.tar.gz | |
Import Nagios Plugins site
Import the Nagios Plugins web site, Cronjobs, infrastructure scripts,
and configuration files.
Diffstat (limited to 'web/attachments/156798-check_dhcp--standardize.diff')
| -rw-r--r-- | web/attachments/156798-check_dhcp--standardize.diff | 51 |
1 files changed, 51 insertions, 0 deletions
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 @@ | |||
| 1 | --- check_dhcp.c.orig 2005-11-18 13:47:21.000000000 -0500 | ||
| 2 | +++ check_dhcp.c 2005-11-18 13:55:21.000000000 -0500 | ||
| 3 | @@ -27,8 +27,8 @@ | ||
| 4 | *****************************************************************************/ | ||
| 5 | |||
| 6 | const char *progname = "check_dhcp"; | ||
| 7 | -const char *revision = "$Revision: 1.7 $"; | ||
| 8 | -const char *copyright = "2001-2004"; | ||
| 9 | +const char *revision = "$Revision: 1.8 $"; | ||
| 10 | +const char *copyright = "2001-2005"; | ||
| 11 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | ||
| 12 | |||
| 13 | #include "common.h" | ||
| 14 | @@ -106,11 +106,6 @@ | ||
| 15 | |||
| 16 | /**** Common definitions ****/ | ||
| 17 | |||
| 18 | -#define STATE_OK 0 | ||
| 19 | -#define STATE_WARNING 1 | ||
| 20 | -#define STATE_CRITICAL 2 | ||
| 21 | -#define STATE_UNKNOWN -1 | ||
| 22 | - | ||
| 23 | #define OK 0 | ||
| 24 | #define ERROR -1 | ||
| 25 | |||
| 26 | @@ -241,7 +236,7 @@ | ||
| 27 | |||
| 28 | int main(int argc, char **argv){ | ||
| 29 | int dhcp_socket; | ||
| 30 | - int result; | ||
| 31 | + int result = STATE_UNKNOWN; | ||
| 32 | |||
| 33 | setlocale (LC_ALL, ""); | ||
| 34 | bindtextdomain (PACKAGE, LOCALEDIR); | ||
| 35 | @@ -921,8 +916,14 @@ | ||
| 36 | else if(request_specific_address==TRUE && received_requested_address==FALSE) | ||
| 37 | result=STATE_WARNING; | ||
| 38 | |||
| 39 | - | ||
| 40 | - printf("DHCP %s: ",(result==STATE_OK)?"ok":"problem"); | ||
| 41 | + if(result==0) /* garrett honeycutt 2005 */ | ||
| 42 | + printf("OK: "); | ||
| 43 | + else if(result==1) | ||
| 44 | + printf("WARNING: "); | ||
| 45 | + else if(result==2) | ||
| 46 | + printf("CRITICAL: "); | ||
| 47 | + else if(result==3) | ||
| 48 | + printf("UNKNOWN: "); | ||
| 49 | |||
| 50 | /* we didn't receive any DHCPOFFERs */ | ||
| 51 | if(dhcp_offer_list==NULL){ | ||
