--000e0cd14efc5f111504683dd1fb
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
- I'm new to developing in Nagios and am having trouble adding the
helloworld module that comes in the nagios-3.1.0/module/ directory. When
using the suggested command of "gcc -shared -o helloworld.o helloworld.c" or
the given module/Makefile or via nagios's overall "make all" (when removing
the -undefined supress gcc option) I receive the following error:
--------------------------------------------
ERROR BELOW:
--------------------------------------------
[module]$ gcc -shared -o helloworld.o helloworld.c
Undefined symbols:
"_main", referenced from:
start in crt1.10.5.o
"_schedule_new_event", referenced from:
_nebmodule_init in cctSjeOe.o
"_neb_deregister_callback", referenced from:
_nebmodule_deinit in cctSjeOe.o
"_write_to_all_logs", referenced from:
_nebmodule_init in cctSjeOe.o
_nebmodule_init in cctSjeOe.o
_nebmodule_deinit in cctSjeOe.o
_helloworld_reminder_message in cctSjeOe.o
_helloworld_handle_data in cctSjeOe.o
"_neb_set_module_info", referenced from:
_nebmodule_init in cctSjeOe.o
_nebmodule_init in cctSjeOe.o
_nebmodule_init in cctSjeOe.o
_nebmodule_init in cctSjeOe.o
_nebmodule_init in cctSjeOe.o
_nebmodule_init in cctSjeOe.o
"_neb_register_callback", referenced from:
_nebmodule_init in cctSjeOe.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
[module]$
--------------------------------------------
- The neb_set_module_info function does exist, shown below:
[nagios-3.1.0]$ grep -Hnr "neb_set_module_info" *cd ..
Binary file base/nagios matches
Binary file base/nagios.dSYM/Contents/Resources/DWARF/nagios matches
base/nebmods.c:391:int neb_set_module_info(void *handle, int type, char
*data){
Binary file base/nebmods.o matches
include/nebmodules.h:96:int neb_set_module_info(void *,int,char *);
module/helloworld.c:61:
neb_set_module_info(helloworld_module_handle,NEBMODULE_MODINFO_TITLE,"helloworld");
[nagios-3.1.0]$
--------------------------------------------
Makefile BELOW
--------------------------------------------
# Makefile for NEB examples
#
# Last Modified: 12-14-2007
# Source code directories
SRC_INCLUDE=../include
CC=gcc
MOD_CFLAGS= -fno-common
CFLAGS=-g -O2 -I/sw/include/ -DHAVE_CONFIG_H
#MOD_LDFLAGS=-bundle -flat_namespace -undefined suppress
MOD_LDFLAGS=-bundle -flat_namespace
LDFLAGS= -L/sw/lib/
LIBS=
prefix=/usr/local/nagios
exec_prefix=${prefix}
BINDIR=${exec_prefix}/bin
INSTALL=/usr/bin/install -c
INSTALL_OPTS=-o nagios -g nagios
COMMAND_OPTS=-o nagios -g nagiocmd
STRIP=/usr/bin/strip
CP=@CP@
all: helloworld.o
helloworld.o: helloworld.c
$(CC) $(MOD_CFLAGS) $(CFLAGS) -o helloworld.o helloworld.c
$(MOD_LDFLAGS) $(LDFLAGS) $(LIBS)
--------------------------------------------
- Finally, I copy helloworld.o from where nagios runs and enable the
even_broker in nagios.cfg"
broker_module=/usr/local/nagios/bin/helloworld.o
Why would gcc not find/compile the needed files? I'd appreciate any pointers
you would give in how to successfully compile the sample module.
thank you,
atoosaah
--000e0cd14efc5f111504683dd1fb
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
- I'm new to developing in Nagios and am having trouble adding the hell=
oworld module that comes in the =A0nagios-3.1.0/module/ directory. When usi=
ng the suggested command of "gcc -shared -o helloworld.o helloworld.c&=
quot; or the given module/Makefile or via nagios's overall "make a=
ll" (when removing the -undefined supress gcc option) I receive the fo=
llowing error:
---------------=
-----------------------------ERROR BELOW:=
--------------------------------------------
[module]$ gcc -shared -o helloworld.o helloworld.cUndefined=
symbols:=A0=A0"_main", referenced from:=A0=
=A0 =A0 =A0start in crt1.10.5.o=A0=A0"_schedule_new_ev
...[email truncated]...
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]