[Nagiosplug-help] check_dhcp

carole verdon verdon at cict.fr
Tue Jul 6 02:39:00 CEST 2004


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
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:227: error: field `ifu_broadaddr' has incomplete type
/usr/include/net/if.h:228: error: field `ifu_dstaddr' has incomplete type
/usr/include/net/if.h:260: error: field `lnr_addr' has incomplete type
/usr/include/net/if.h:329: error: field `lifru_addr' has incomplete type
/usr/include/net/if.h:330: error: field `lifru_dstaddr' has incomplete type
/usr/include/net/if.h:331: error: field `lifru_broadaddr' has incomplete 
type
/usr/include/net/if.h:332: error: field `lifru_token' has incomplete type
/usr/include/net/if.h:333: error: field `lifru_subnet' has incomplete type
/usr/include/net/if.h:372: error: field `sa_addr' has incomplete type
/usr/include/net/if.h:382: error: field `slr_src' has incomplete type
/usr/include/net/if.h:383: error: field `slr_grp' has incomplete type
/usr/include/net/if.h:402: error: field `ifru_addr' has incomplete type
/usr/include/net/if.h:403: error: field `ifru_dstaddr' has incomplete type
/usr/include/net/if.h:405: error: field `ifru_broadaddr' 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:486: error: parse error before "sa_family_t"
/usr/include/net/if.h:495: error: parse error before '}' token
/usr/include/net/if.h:626: error: field `ifta_saddr' has incomplete type
/usr/include/net/if.h:627: error: field `ifta_daddr' 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:75: warning: data definition has no type or storage class
check_dhcp.c:76: error: parse error before "hlen"
check_dhcp.c:76: warning: data definition has no type or storage class
check_dhcp.c:77: error: parse error before "hops"
check_dhcp.c:77: warning: data definition has no type or storage class
check_dhcp.c:78: error: parse error before "xid"
check_dhcp.c:78: warning: data definition has no type or storage class
check_dhcp.c:79: error: parse error before "secs"
check_dhcp.c:79: warning: data definition has no type or storage class
check_dhcp.c:80: error: parse error before "flags"
check_dhcp.c:80: warning: data definition has no type or storage class
check_dhcp.c:89: error: parse error before '}' token
check_dhcp.c:89: warning: data definition has no type or storage class
check_dhcp.c:95: error: parse error before "u_int32_t"
check_dhcp.c:95: warning: no semicolon at end of struct or union
check_dhcp.c:96: warning: data definition has no type or storage class
check_dhcp.c:97: error: parse error before "rebinding_time"
check_dhcp.c:97: warning: data definition has no type or storage class
check_dhcp.c:99: error: parse error before '}' token
check_dhcp.c:99: warning: data definition has no type or storage class
check_dhcp.c:141: error: parse error before "packet_xid"
check_dhcp.c:141: warning: data definition has no type or storage class
check_dhcp.c:143: error: parse error before "dhcp_lease_time"
check_dhcp.c:143: warning: data definition has no type or storage class
check_dhcp.c:144: error: parse error before "dhcp_renewal_time"
check_dhcp.c:144: warning: data definition has no type or storage class
check_dhcp.c:145: error: parse error before "dhcp_rebinding_time"
check_dhcp.c:145: warning: data definition has no type or storage class
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:174: error: parse error before "dhcp_packet"
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: In function `send_dhcp_discover':
check_dhcp.c:250: error: parse error before "discover_packet"
check_dhcp.c:255: error: `discover_packet' undeclared (first use in this 
function)
check_dhcp.c: In function `get_dhcp_offer':
check_dhcp.c:336: error: parse error before "offer_packet"
check_dhcp.c:359: error: `offer_packet' undeclared (first use in this 
function)
check_dhcp.c: In function `create_dhcp_socket':
check_dhcp.c:554: error: structure has no member named `ifr_ifrn'
check_dhcp.c:555: error: `SO_BINDTODEVICE' undeclared (first use in this 
function)
check_dhcp.c: At top level:
check_dhcp.c:610: error: parse error before "dhcp_packet"
check_dhcp.c: In function `add_dhcp_offer':
check_dhcp.c:611: error: `new_offer' undeclared (first use in this function)
check_dhcp.c:617: error: `offer_packet' undeclared (first use in this 
function)
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:641: error: parse error before ')' token
check_dhcp.c:643: error: parse error before ')' token
check_dhcp.c:664: error: parse error before ')' token
check_dhcp.c:670: error: `source' undeclared (first use in this function)
check_dhcp.c: In function `free_dhcp_offer_list':
check_dhcp.c:694: error: `this_offer' undeclared (first use in this 
function)
check_dhcp.c:695: error: `next_offer' undeclared (first use in this 
function)
check_dhcp.c: In function `get_results':
check_dhcp.c:724: error: `temp_offer' undeclared (first use in this 
function)
check_dhcp.c:727: error: `u_int32_t' undeclared (first use in this function)
check_dhcp.c:727: error: parse error before "max_lease_time"
check_dhcp.c:740: error: `max_lease_time' undeclared (first use in this 
function)
check_dhcp.c: In function `call_getopt':
check_dhcp.c:893: error: elements of array `long_options' have 
incomplete type
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)
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: warning: excess elements in struct initializer
check_dhcp.c:895: warning: (near initialization for `long_options[0]')
check_dhcp.c:895: warning: excess elements in struct initializer
check_dhcp.c:895: warning: (near initialization for `long_options[0]')
check_dhcp.c:896: warning: excess elements in struct initializer
check_dhcp.c:896: warning: (near initialization for `long_options[1]')
check_dhcp.c:896: warning: excess elements in struct initializer
check_dhcp.c:896: warning: (near initialization for `long_options[1]')
check_dhcp.c:896: warning: excess elements in struct initializer
check_dhcp.c:896: warning: (near initialization for `long_options[1]')
check_dhcp.c:896: warning: excess elements in struct initializer
check_dhcp.c:896: warning: (near initialization for `long_options[1]')
check_dhcp.c:897: warning: excess elements in struct initializer
check_dhcp.c:897: warning: (near initialization for `long_options[2]')
check_dhcp.c:897: warning: excess elements in struct initializer
check_dhcp.c:897: warning: (near initialization for `long_options[2]')
check_dhcp.c:897: warning: excess elements in struct initializer
check_dhcp.c:897: warning: (near initialization for `long_options[2]')
check_dhcp.c:897: warning: excess elements in struct initializer
check_dhcp.c:897: warning: (near initialization for `long_options[2]')
check_dhcp.c:898: warning: excess elements in struct initializer
check_dhcp.c:898: warning: (near initialization for `long_options[3]')
check_dhcp.c:898: warning: excess elements in struct initializer
check_dhcp.c:898: warning: (near initialization for `long_options[3]')
check_dhcp.c:898: warning: excess elements in struct initializer
check_dhcp.c:898: warning: (near initialization for `long_options[3]')
check_dhcp.c:898: warning: excess elements in struct initializer
check_dhcp.c:898: warning: (near initialization for `long_options[3]')
check_dhcp.c:899: warning: excess elements in struct initializer
check_dhcp.c:899: warning: (near initialization for `long_options[4]')
check_dhcp.c:899: error: `no_argument' undeclared (first use in this 
function)
check_dhcp.c:899: warning: excess elements in struct initializer
check_dhcp.c:899: warning: (near initialization for `long_options[4]')
check_dhcp.c:899: warning: excess elements in struct initializer
check_dhcp.c:899: warning: (near initialization for `long_options[4]')
check_dhcp.c:899: warning: excess elements in struct initializer
check_dhcp.c:899: warning: (near initialization for `long_options[4]')
check_dhcp.c:900: warning: excess elements in struct initializer
check_dhcp.c:900: warning: (near initialization for `long_options[5]')
check_dhcp.c:900: warning: excess elements in struct initializer
check_dhcp.c:900: warning: (near initialization for `long_options[5]')
check_dhcp.c:900: warning: excess elements in struct initializer
check_dhcp.c:900: warning: (near initialization for `long_options[5]')
check_dhcp.c:900: warning: excess elements in struct initializer
check_dhcp.c:900: warning: (near initialization for `long_options[5]')
check_dhcp.c:901: warning: excess elements in struct initializer
check_dhcp.c:901: warning: (near initialization for `long_options[6]')
check_dhcp.c:901: warning: excess elements in struct initializer
check_dhcp.c:901: warning: (near initialization for `long_options[6]')
check_dhcp.c:901: warning: excess elements in struct initializer
check_dhcp.c:901: warning: (near initialization for `long_options[6]')
check_dhcp.c:901: warning: excess elements in struct initializer
check_dhcp.c:901: warning: (near initialization for `long_options[6]')
check_dhcp.c:902: warning: excess elements in struct initializer
check_dhcp.c:902: warning: (near initialization for `long_options[7]')
check_dhcp.c:902: warning: excess elements in struct initializer
check_dhcp.c:902: warning: (near initialization for `long_options[7]')
check_dhcp.c:902: warning: excess elements in struct initializer
check_dhcp.c:902: warning: (near initialization for `long_options[7]')
check_dhcp.c:902: warning: excess elements in struct initializer
check_dhcp.c:902: warning: (near initialization for `long_options[7]')
check_dhcp.c:893: error: storage size of `long_options' isn't known
make: *** [check_dhcp] Error 1



Andreas Ericsson wrote:

> trevor obba wrote:
>
>> I installed check_dhcp.c so that nagios will check
>> dhcp server.
>>
>> I run cc check_dhcp.c this produce a.out(Executable
>> and Linking Format (ELF) files)
>> when I run ./a.out
>> I get the following in /var/log/messages
>> dhcpd: DHCPDISCOVER from 00:30:40:52:46:fc via eth0
>> dhcpd: DHCPOFFER on 161.67.140.172 to
>> 00:30:40:52:46:fc via eth0
>>
>> ./a.out attually make a dhcp request and according to
>> the /var/log/messages a dhcpoffer was made but ./a.out returns the 
>> following
>> DHCP problem: No DHCPOFFERs were received.
>>
>> My client machine where ./a.out was been excuted form
>> has it mac address in my dhcpd.conf on my dhcp server.
>>
>> what am I doing wrough? can you help please?
>>
>
> You're not doing anything wrong. This is a known bug with the 
> check_dhcp plugin.
>





More information about the Help mailing list