[Nagiosplug-help] check_dhcp

Andreas Ericsson ae at op5.se
Tue Jul 6 02:56:07 CEST 2004


carole verdon wrote:
> Do it exist a version of this plugin for solaris?
> 
> I tried to compile it on my nagios server to check the DHCP server that 
> it's a remote host. But i have got errors.
> 
> $ make check_dhcp
> cc     check_dhcp.c   -o check_dhcp
> check_dhcp.c:35:22: features.h: No such file or directory
> check_dhcp.c:36:28: linux/if_ether.h: No such file or directory
> check_dhcp.c:37:20: getopt.h: No such file or directory

This is the real problem. You need to install the glibc and linux kernel 
header files, and they must be readable to the user compiling the 
program. In the header files there are typedef statements, which 
identify various types of variables so that gcc knows their width. 
Without these statements you get warnings of the type shown below.
What does 'ls -l /usr/include/{getopt,linux/if_ether,features}.h' say on 
your system?

> In file included from check_dhcp.c:38:
> /usr/include/net/if.h:225: error: field `ifa_addr' has incomplete type
> /usr/include/net/if.h:473: error: parse error before "sa_family_t"
> /usr/include/net/if.h:476: error: parse error before '}' token
> /usr/include/net/if.h:626: error: field `ifta_saddr' has incomplete type
> check_dhcp.c:74: error: parse error before "u_int8_t"
> check_dhcp.c:74: warning: no semicolon at end of struct or union
> check_dhcp.c:149: error: parse error before '*' token
> check_dhcp.c:149: warning: data definition has no type or storage class
> check_dhcp.c: In function `get_hardware_address':
> check_dhcp.c:230: error: `SIOCGIFHWADDR' undeclared (first use in this 
> function)
> check_dhcp.c:230: error: (Each undeclared identifier is reported only once
> check_dhcp.c:230: error: for each function it appears in.)
> check_dhcp.c:235: error: structure has no member named `ifr_hwaddr'
> check_dhcp.c:639: error: `u_int32_t' undeclared (first use in this 
> function)
> check_dhcp.c:639: error: parse error before ')' token
> check_dhcp.c: In function `free_dhcp_offer_list':
> check_dhcp.c:895: warning: excess elements in struct initializer
> check_dhcp.c:895: warning: (near initialization for `long_options[0]')
> check_dhcp.c:895: error: `required_argument' undeclared (first use in 
> this function)

-- 
Andreas Ericsson
OP5 AB
+46 (0)733 709032
andreas.ericsson at op5.se




More information about the Help mailing list