Closed bernardoaraujor closed 7 years ago
Humm... So there was a typo in the instructions for makefile I can see. The command would have been make -f agentxTutorial_Makefile
but I noted it to be make -f agentxTutorial_makefile
. That is minor.
Coming to the issue that you are having. You cannot use the makefile as-is that is generated by mib2c. If you do a diff between the two makefiles (one that is autogenerated and one that is in step1_scalars_implement), you will see following. Basically I removed use of $(USER_SRCS)
, $(USER_OBJS)
which requires data_get, data_set, _data_access.c, interface.c files which are not necessary for this step. And running the make is complaining about missing rule for agentxTutorial_data_get.o for which we do not have the source and we do not need it.
vishalj@dreams:~/workspace/tmp/agentx-tutorial⟫ diff -u <(git show step1_scalars_autogenerated:agentxTutorial_Makefile) <(git show step1_scalars_implement:agentxTutorial_Makefile)
--- /dev/fd/63 2017-08-07 19:26:39.917833701 -0400
+++ /dev/fd/62 2017-08-07 19:26:39.917833701 -0400
@@ -22,20 +22,18 @@
$(TABLE_PREFIX)_data_set.c \
$(TABLE_PREFIX)_data_access.c
-SRCS = $(USER_SRCS) \
+SRCS = \
$(TABLE_PREFIX).c \
- $(TABLE_PREFIX)_subagent.c \
- $(TABLE_PREFIX)_interface.c
+ $(TABLE_PREFIX)_subagent.c
USER_OBJS = \
$(TABLE_PREFIX)_data_get.o \
$(TABLE_PREFIX)_data_set.o \
$(TABLE_PREFIX)_data_access.o
-OBJS = $(USER_OBJS) \
+OBJS = \
$(TABLE_PREFIX).o \
- $(TABLE_PREFIX)_subagent.o \
- $(TABLE_PREFIX)_interface.o
+ $(TABLE_PREFIX)_subagent.o
TARGETS=$(TABLE_PREFIX)
@@ -53,5 +51,4 @@
$(CC) -o $(TABLE_PREFIX) $(OBJS) $(LIBS)
clean:
- rm -f $(OBJS) $(TARGETS)
-
+ rm -f $(OBJS) $(TARGETS)
\ No newline at end of file
vishalj@dreams:~/workspace/tmp/agentx-tutorial⟫
Hey Jain, thanks for the quick reply!
Now that makes sense! Perhaps you could talk about these changes in the tutorial, so other people don't get confused like me with these modifications.
Hey Jain, it's me again.
I put AGENTX-TUTORIAL-MIB into ~/.snmp/mibs, generated the .c, .h, and makefile with mib2c, and copied (from a repo with
step1_scalars_implement
tag) the modified versions to introduce the monitor variables and alarm handler.But now I'm having problems with the Makefile generated by mib2c. Note that if I overwrite it with the one from
step1_scalars_implement
tagged repo, it compiles alright. Am I doing something wrong??