AW: AW: [Nagiosplug-help] Problems with check_icmp

Lutz Rethberg Lutz_Rethberg at dresden-tourist.de
Tue Mar 15 23:46:18 CET 2005


OS: SunOS 5.9, V:Nagios 2.0b1

It is a little step to success - can you help me again :)  ?

root at triebisch # gcc -lnsl -lsocket check_icmp.o -o check_icmp
Undefined                       first referenced
 symbol                             in file
hstrerror                           check_icmp.o
inet_aton                           check_icmp.o
ld: fatal: Symbol referencing errors. No output written to check_icmp
collect2: ld returned 1 exit status

Many thanks for your patience

Lutz

On Tue, Mar 15, 2005 at 01:59:48PM +0100, Andreas Ericsson wrote:
> Lutz_Rethberg wrote:
> > Hmmm - did I get the right file... ?
> >
>
> Yes, but it seems your make program doesn't execute the statement after
> the pipes, which is a bit weird.
>
> Anyways. In the directory where you've run make, you can do
>
> gcc -lnsl -lsocket check_icmp.o -o check_icmp
>
> and it should produce the binary executable just fine.
>
> > root at triebisch # cd check_icmp-2005-03-15
> > root at triebisch # ls
> > Makefile      check_icmp.c
> > root at triebisch # make
> > gcc -O2 -funroll-loops -fomit-frame-pointer    -c  check_icmp.c
> > gcc check_icmp.o -o check_icmp || gcc -lnsl -lsocket check_icmp.o -o
> > check_icmp
> > Undefined                       first referenced
> >  symbol                             in file
> > gethostbyname                       check_icmp.o
> > sendto                              check_icmp.o
> > socket                              check_icmp.o
> > setsockopt                          check_icmp.o
> > hstrerror                           check_icmp.o
> > recvfrom                            check_icmp.o
> > inet_aton                           check_icmp.o
> > inet_ntoa                           check_icmp.o
> > h_errno                             check_icmp.o
> > ld: fatal: Symbol referencing errors. No output written to check_icmp
> > collect2: ld returned 1 exit status
> > Undefined                       first referenced
> >  symbol                             in file
> > hstrerror                           check_icmp.o
> > inet_aton                           check_icmp.o
> > ld: fatal: Symbol referencing errors. No output written to check_icmp
> > collect2: ld returned 1 exit status
> > *** Error code 1
> > make: Fatal error: Command failed for target `check_icmp'
> > root at triebisch #
> >
> > ***********************************
> > Dresden-Werbung und Tourismus GmbH
> > Lutz Rethberg
> > Ostra-Allee 11
> > 01067 Dresden
> > Tel.: +49 351 49192 239
> > Fax : +49 351 49192 116
> > ***********************************
> >
> >
> >
> >>-----Ursprüngliche Nachricht-----
> >>Von: Andreas Ericsson [mailto:ae at op5.se]
> >>Gesendet: Dienstag, 15. März 2005 11:32
> >>An: Lutz_Rethberg
> >>Betreff: Re: AW: [Nagiosplug-help] Problems with check_icmp
> >>
> >>
> >>Lutz_Rethberg wrote:
> >>
> >>>>-----Ursprüngliche Nachricht-----
> >>>>Von: nagiosplug-help-admin at lists.sourceforge.net
> >>>>[mailto:nagiosplug-help-admin at lists.sourceforge.net]Im Auftrag von
> >>>>Andreas Ericsson
> >>>>Gesendet: Montag, 14. März 2005 17:21
> >>>
> >>>
> >>>Thanks for your answer!
> >>>I'm using SunOS:
> >>>root at triebisch # uname -a
> >>>SunOS triebisch 5.9 Generic_117171-15 sun4u sparc SUNW,UltraAX-i2
> >>>
> >>
> >>That's a 32bit pid_t system.
> >>
> >>
> >>>No success - don't know how to get the undefined symbols...:
> >>
> >>Sorry. My bad. There's a new one (freshly hatched) at
> >>http://oss.op5.se/nagios
> >>
> >>The only difference is that I uncommented the LIBS line in
> >>the Makefile,
> >>so if you'd rather not download freshly you can just do that
> >>and re-run
> >>make.
> >>
> >>
> >>>root at triebisch # ls
> >>>Makefile      check_icmp.c
> >>>root at triebisch # make
> >>>gcc check_icmp.o -o check_icmp || gcc  check_icmp.o -o check_icmp
> >>>Undefined                       first referenced
> >>> symbol                             in file
> >>>gethostbyname                       check_icmp.o
> >>>sendto                              check_icmp.o
> >>>socket                              check_icmp.o
> >>>setsockopt                          check_icmp.o
> >>>hstrerror                           check_icmp.o
> >>>recvfrom                            check_icmp.o
> >>>inet_aton                           check_icmp.o
> >>>inet_ntoa                           check_icmp.o
> >>>h_errno                             check_icmp.o
> >>>ld: fatal: Symbol referencing errors. No output written to
> >>
> >>check_icmp
> >>
> >>>collect2: ld returned 1 exit status
> >>>Undefined                       first referenced
> >>> symbol                             in file
> >>>gethostbyname                       check_icmp.o
> >>>sendto                              check_icmp.o
> >>>socket                              check_icmp.o
> >>>setsockopt                          check_icmp.o
> >>>hstrerror                           check_icmp.o
> >>>recvfrom                            check_icmp.o
> >>>inet_aton                           check_icmp.o
> >>>inet_ntoa                           check_icmp.o
> >>>h_errno                             check_icmp.o
> >>>ld: fatal: Symbol referencing errors. No output written to
> >>
> >>check_icmp
> >>
> >>>collect2: ld returned 1 exit status
> >>>*** Error code 1
> >>>make: Fatal error: Command failed for target `check_icmp'
> >>>root at triebisch #
> >>>
> >>>
> >>>
> >>>
> >>>>An: nagiosplug-help at lists.sourceforge.net
> >>>>Betreff: Re: [Nagiosplug-help] Problems with check_icmp
> >>>>
> >>>>
> >>>>Lutz_Rethberg wrote:
> >>>>
> >>>>
> >>>>>I wont to make host-alive-check of a hosts, who is a
> >>>>
> >>>>unknown ( for me )
> >>>>
> >>>>
> >>>>>router behind the firewall. I don't know anything about
> >>>>
> >>>>him. He doesn't
> >>>>
> >>>>
> >>>>>answer for question by ssh, therefore I had the Idea to
> >>>>
> >>>>test him by icmp.
> >>>>
> >>>>
> >>>>>It works from command-line, but it doesnt work as
> >>>>
> >>>>checkkommand. Why ?
> >>>>
> >>>>If you're using FreeBSD 5.x or any other operating system
> >>>>where pid_t is
> >>>>wider than 16 bits (if processes can have ID values that are greater
> >>>>than 65535), you need to download and install the latest check_icmp
> >>>>version. It's at
> >>
> >>http://oss.op5.se/nagios/check_icmp-2005-03-14.tar.gz
> >>
> >>>>
> >>>>>Details:
> >>>>>cause of:
> >>>>>
> >>>>>bash-2.05$ /usr/local/nagios/libexec/check_icmp -H gw
> >>>>>check_icmp: Failed to obtain ICMP socket: Permission denied
> >>>>>
> >>>>>I've set root-permissions, then it works from command-line
> >>>>
> >>>>as user nagios:
> >>>>
> >>>>
> >>>>>bash-2.05$ id
> >>>>>uid=987(nagios) gid=1(other)
> >>>>>bash-2.05$ /usr/local/nagios/libexec/check_icmp -H gw
> >>>>>OK - gw: rta 0.674ms, lost
> >>>>
> >>>>0%|rta=0.674ms;200.000;500.000;0; pl=0%;40;80;;
> >>>>
> >>>>
> >>>>>bash-2.05$
> >>>>>
> >>>>>
> >>>>>Some of the Definitions:
> >>>>>
> >>>>>checkcommands.cfg:
> >>>>>define command{
> >>>>>       command_name    check-icmp
> >>>>>       command_line    $USER1$/check_icmp -H $HOSTADDRESS$
> >>>>>       }
> >>>>>
> >>>>>services.cfg
> >>>>>define service{
> >>>>>       use                     generic_service
> >>>>>       host_name               gw
> >>>>>       service_description     TK_GW_ICMP
> >>>>>       check_command           check-icmp
> >>>>>}
> >>>>>
> >>>>>
> >>>>>Result:
> >>>>>
> >>>>>
> >>>>>Current Status:   CRITICAL
> >>>>>Status Information: CRITICAL - 195.243.217.110: rta nan, lost 100%
> >>>>>Performance Data: rta=0.000ms;200.000;500.000;0; pl=100%;40;80;;
> >>>>>Current Attempt: 1/5
> >>>>>State Type: HARD
> >>>>>Last Check Type: ACTIVE
> >>>>>Last Check Time: 2005-03-13 11:02:23
> >>>>>Status Data Age: 0d 0h 0m 51s
> >>>>>Next Scheduled Active Check:   2005-03-13 11:07:23
> >>>>>Latency: 0.011 seconds
> >>>>>Check Duration: 3.857 seconds
> >>>>>Last State Change: 2005-03-12 19:51:07
> >>>>>Current State Duration: 0d 15h 12m 7s
> >>>>>Last Service Notification: N/A
> >>>>>Current Notification Number: 0
> >>>>>Is This Service Flapping?   NO
> >>>>>Percent State Change: 0.00%
> >>>>>In Scheduled Downtime?   NO
> >>>>>Last Update: 2005-03-13 11:03:05
> >>>>>
> >>>>>
> >>>>>Active Checks:   ENABLED
> >>>>>Passive Checks:   ENABLED
> >>>>>Obsessing:   DISABLED
> >>>>>Notifications:   ENABLED
> >>>>>Event Handler:   ENABLED
> >>>>>Flap Detection:   ENABLED
> >>>>>
> >>>>>Thanks for help
> >>>>>
> >>>>>Lutz rethberg
> >>>>>
> >>>>>
> >>>>>
> >>>>>-------------------------------------------------------
> >>>>>SF email is sponsored by - The IT Product Guide
> >>>>>Read honest & candid reviews on hundreds of IT Products
> >>>>
> >>>>from real users.
> >>>
> >>>>>Discover which products truly live up to the hype. Start
> >>>>
> >>>>reading now.
> >>>>
> >>>>
> >>>>>http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> >>>>>_______________________________________________
> >>>>>Nagiosplug-help mailing list
> >>>>>Nagiosplug-help at lists.sourceforge.net
> >>>>>https://lists.sourceforge.net/lists/listinfo/nagiosplug-help
> >>>>>::: Please include plugins version (-v) and OS when
> >>>>
> >>>>reporting any issue.
> >>>>
> >>>>
> >>>>>::: Messages without supporting info will risk being sent
> >>>>
> >>>>to /dev/null
> >>>>
> >>>>--
> >>>>Andreas Ericsson                   andreas.ericsson at op5.se
> >>>>OP5 AB                             www.op5.se
> >>>>Lead Developer
> >>>>
> >>>>
> >>>>-------------------------------------------------------
> >>>>SF email is sponsored by - The IT Product Guide
> >>>>Read honest & candid reviews on hundreds of IT Products from
> >>>>real users.
> >>>>Discover which products truly live up to the hype. Start
> >>
> >>reading now.
> >>
> >>>>http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> >>>>_______________________________________________
> >>>>Nagiosplug-help mailing list
> >>>>Nagiosplug-help at lists.sourceforge.net
> >>>>https://lists.sourceforge.net/lists/listinfo/nagiosplug-help
> >>>>::: Please include plugins version (-v) and OS when reporting
> >>>>any issue.
> >>>>::: Messages without supporting info will risk being sent
> >>
> >>to /dev/null
> >>
> >>>>
> >>>
> >>>
> >>--
> >>Andreas Ericsson                   andreas.ericsson at op5.se
> >>OP5 AB                             www.op5.se
> >>Lead Developer
> >>
> >>
> >
> >
> >
>
> --
> Andreas Ericsson                   andreas.ericsson at op5.se
> OP5 AB                             www.op5.se
> Lead Developer
>





More information about the Help mailing list