Adding a cgi file to nagios

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
rakesh514
Posts: 8
Joined: Fri Mar 08, 2013 6:40 am

Adding a cgi file to nagios

Post by rakesh514 »

Hello,
I want to add a cgi file to Nagios. I wrote a C program referring the other programs I found inside /cgi folder and kept it in the same location. I modified Makefile.in (added lines for my cgi file) and then configured and compiled using make all (according to nagios installation guides). But I am getting the following error.
(jobs.c is my file)

[root@localhost nagios-3.2.3]# make all
cd ./base && make
make[1]: Entering directory `/root/downloads/nagios-3.2.3/base'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/downloads/nagios-3.2.3/base'
cd ./cgi && make
make[1]: Entering directory `/root/downloads/nagios-3.2.3/cgi'
make[1]: *** No rule to make target `gcc', needed by `jobs.cgi'. Stop.
make[1]: Leaving directory `/root/downloads/nagios-3.2.3/cgi'
make: *** [all] Error 2

Do I need to make changes elsewhere? Please help.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Adding a cgi file to nagios

Post by abrist »

Can you post your makefile in code wraps?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
rakesh514
Posts: 8
Joined: Fri Mar 08, 2013 6:40 am

Re: Adding a cgi file to nagios

Post by rakesh514 »

I made the following two changes to cgi/Makefile.in (before I configured and compiled according to http://nagios.sourceforge.net/docs/3_0/ ... edora.html)

1) I included 'jobs.cgi' in the below line.
CGIS=avail.cgi cmd.cgi config.cgi extinfo.cgi history.cgi notifications.cgi jobs.cgi outages.cgi showlog.cgi status.cgi statuswml.cgi summary.cgi tac.cgi $(CGIEXTRAS)

2) And in the following portion, I added an entry for jobs.cgi.
########## CGIS ##########
notifications.cgi: notifications.c $(CGIDEPS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ notifications.c $(CGILIBS) $(LIBS)

jobs.cgi: jobs.c $(CGIDEPS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ jobs.c $(CGILIBS) $(LIBS)

outages.cgi: outages.c $(CGIDEPS) $(CDATADEPS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ outages.c $(CGILIBS) $(CDATALIBS) $(LIBS)


What other modifications I need to do? For testing, I have included the same code of notifications.c in jobs.c inside cgi/
When I compile using make all, I get the error.


Thanks and regards,
Rakesh
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Adding a cgi file to nagios

Post by abrist »

Makefiles have a *very* strict syntax. Could you post the full file?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked