summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/check_dhcp.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/plugins/check_dhcp.c b/plugins/check_dhcp.c
index 5c3c199..f668a88 100644
--- a/plugins/check_dhcp.c
+++ b/plugins/check_dhcp.c
@@ -55,7 +55,7 @@
55#include <sys/sysctl.h> 55#include <sys/sysctl.h>
56#include <net/if_dl.h> 56#include <net/if_dl.h>
57 57
58#elif defined(__sun__) || defined(__solaris__) 58#elif defined(__sun__) || defined(__solaris__) || defined(__hpux__)
59 59
60#define INSAP 22 60#define INSAP 22
61#define OUTSAP 24 61#define OUTSAP 24
@@ -367,13 +367,30 @@ int get_hardware_address(int sock,char *interface_name){
367 exit(STATE_UNKNOWN); 367 exit(STATE_UNKNOWN);
368 } 368 }
369 369
370#elif defined(__hpux__)
371
372 /* Martin Kompf again
373 *
374 * Nagios plugins thank you sincerely
375 */
376
377 long stat;
378 char dev[20] = "/dev/dlpi" ;
379 int unit = 0;
380
381 stat = mac_addr_dlpi(dev, unit, client_hardware_address);
382 if (stat != 0) {
383 printf("Error: can't read MAC address from DLPI streams interface for device %s unit %d.\n", dev, unit);
384 exit(STATE_UNKNOWN);
385 }
386
370#else 387#else
371 printf("Error: can't get MAC address for this architcture.\n"); 388 printf("Error: can't get MAC address for this architecture.\n");
372 exit(STATE_UNKNOWN); 389 exit(STATE_UNKNOWN);
373#endif 390#endif
374 391
375 if (verbose) { 392 if (verbose) {
376 printf( "Hadrware address: "); 393 printf( "Hardware address: ");
377 for (i=0; i<6; ++i) 394 for (i=0; i<6; ++i)
378 printf("%2.2x", client_hardware_address[i]); 395 printf("%2.2x", client_hardware_address[i]);
379 printf( "\n"); 396 printf( "\n");
@@ -1137,7 +1154,7 @@ int validate_arguments(void){
1137 return OK; 1154 return OK;
1138 } 1155 }
1139 1156
1140#if defined(__sun__) || defined(__solaris__) 1157#if defined(__sun__) || defined(__solaris__) || defined(__hpux__)
1141 1158
1142 1159
1143/* 1160/*