[Nagiosplug-help] Compiling in cygwin

Andreas Ericsson ae at op5.se
Mon Jan 31 06:26:02 CET 2005


Vanderveken, Jan wrote:
> Hello,
> 
> I'm trying to get a nagios setup running on a Windows system using the
> cygwin tools. I cannot use Linux on this project for the simple reason that
> Windows is the only allowed platform (not my choice, but I can't change it
> so don't ask)
> 

Funny place. Usually it's the other way around in mission-critical 
networks. I know the swedish military are forbidden by law to use 
anything but NetBSD in most of their networks. Windows' IP-stack is just 
too shoddy to be used in really critical places, even if they made a 
near-complete ripoff from OpenBSD when they released Win2K (it seems 
they screwed up enough of it to make it malfunction anyway).

> Nagios itself compiled nicely, and is already running. I'm having some
> problems with compiling the plugins though. I downloaded version 1.4-beta1
> of the plugins, and when I try to compile them it bombs out with the errors
> below:
> 

The nagios plugins lean heavily on certain system applications usually 
only found on unix systems. I don't think a cygwin port is currently 
planned and I seriously doubt if you will have any luck in making many 
of them run.

> check_icmp.c:260: warning: `struct icmp' declared inside parameter list
> check_icmp.c:260: warning: its scope is only this definition or declaration,
> whi
> ch is probably not what you want
> check_icmp.c: In function `main':
> check_icmp.c:505: error: `ICMP_MINLEN' undeclared (first use in this
> function)
> check_icmp.c:505: error: (Each undeclared identifier is reported only once
> check_icmp.c:505: error: for each function it appears in.)
> check_icmp.c: In function `send_ping':
> check_icmp.c:794: error: dereferencing pointer to incomplete type
> check_icmp.c:794: error: `ICMP_ECHO' undeclared (first use in this function)
> check_icmp.c:795: error: dereferencing pointer to incomplete type
> check_icmp.c:796: error: dereferencing pointer to incomplete type
> check_icmp.c:797: error: dereferencing pointer to incomplete type
> check_icmp.c:798: error: dereferencing pointer to incomplete type
> check_icmp.c:800: error: `ICMP_MINLEN' undeclared (first use in this
> function)
> check_icmp.c:804: error: dereferencing pointer to incomplete type
> check_icmp.c: In function `wait_for_reply':
> check_icmp.c:862: error: `ICMP_MINLEN' undeclared (first use in this
> function)
> check_icmp.c:870: error: dereferencing pointer to incomplete type
> check_icmp.c:870: error: `ICMP_ECHOREPLY' undeclared (first use in this
> function
> )
> check_icmp.c:872: warning: passing arg 1 of `handle_random_icmp' from
> incompatib
> le pointer type
> check_icmp.c:878: error: dereferencing pointer to incomplete type
> check_icmp.c:883: error: dereferencing pointer to incomplete type
> check_icmp.c:886: error: dereferencing pointer to incomplete type
> check_icmp.c:895: error: dereferencing pointer to incomplete type
> check_icmp.c:897: error: dereferencing pointer to incomplete type
> check_icmp.c: At top level:
> check_icmp.c:927: warning: `struct icmp' declared inside parameter list
> check_icmp.c:928: error: conflicting types for `handle_random_icmp'
> check_icmp.c:260: error: previous declaration of `handle_random_icmp'
> check_icmp.c: In function `handle_random_icmp':
> check_icmp.c:934: error: dereferencing pointer to incomplete type
> check_icmp.c:935: error: `ICMP_UNREACH' undeclared (first use in this
> function)
> check_icmp.c:938: error: dereferencing pointer to incomplete type
> check_icmp.c:938: error: `ICMP_ECHO' undeclared (first use in this function)
> check_icmp.c:939: error: dereferencing pointer to incomplete type
> check_icmp.c:940: error: dereferencing pointer to incomplete type
> check_icmp.c:942: error: dereferencing pointer to incomplete type
> check_icmp.c:944: error: dereferencing pointer to incomplete type
> check_icmp.c:964: error: `ICMP_SOURCEQUENCH' undeclared (first use in this
> funct
> ion)
> check_icmp.c:965: error: `ICMP_REDIRECT' undeclared (first use in this
> function)
> 
> check_icmp.c:966: error: `ICMP_TIMXCEED' undeclared (first use in this
> function)
> 
> check_icmp.c:967: error: `ICMP_PARAMPROB' undeclared (first use in this
> function
> )
> check_icmp.c:969: error: dereferencing pointer to incomplete type
> check_icmp.c:970: error: dereferencing pointer to incomplete type
> check_icmp.c:971: error: dereferencing pointer to incomplete type
> check_icmp.c:973: error: dereferencing pointer to incomplete type
> check_icmp.c:987: error: `ICMP_TSTAMP' undeclared (first use in this
> function)
> check_icmp.c:988: error: `ICMP_TSTAMPREPLY' undeclared (first use in this
> functi
> on)
> check_icmp.c:989: error: `ICMP_IREQ' undeclared (first use in this function)
> check_icmp.c:990: error: `ICMP_IREQREPLY' undeclared (first use in this
> function
> )
> check_icmp.c:991: error: `ICMP_MASKREQ' undeclared (first use in this
> function)
> check_icmp.c:992: error: `ICMP_MASKREPLY' undeclared (first use in this
> function
> )
> make[2]: *** [check_icmp.o] Error 1
> make[2]: Leaving directory `/usr/src/nagios-plugins-1.4-beta1/plugins'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/usr/src/nagios-plugins-1.4-beta1'
> make: *** [all] Error 2
> 
> Any idea what I can do about this?
> 

check_icmp (as included in the dist) won't compile under CYGWIN unless 
you have BSD-compatible headers installed (which you apparently don't).
If it weren't for the initial "struct icmp" warnings (which later causes 
the errors of "dereferencing pointer to incomplete type") I would 
recommend you download the latest check_icmp plugin (although it 
wouldn't work under XP SP2 anyway, due to imbecile (and easily bypassed) 
socket restrictions).

The best option you have is probably to run make -i (continue on errors) 
and take whatever plugins happen to build. You'll be running a severely 
crippled install, but in a windows-only environment I assume the 
IT-staff are used to a certain degree of wobbliness anyway.

> Kind regards,
> Jan Van der Veken
> 

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Lead Developer




More information about the Help mailing list