[SOLVED] compile only cmd.c

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
V3xX
Posts: 26
Joined: Wed Aug 29, 2012 6:48 am
Location: Switzerland

[SOLVED] compile only cmd.c

Post by V3xX »

Hello everyone,

I'm tired of click checkboxes if I acknowledge a service in Nagios.
So I wan't du modify the prechecked checkboxes.
I found this lines in cmd.cgi, so this is a compiled .c file.
I downloaded source-code of installed version and copied out the cmd.c
so my problem:
if I want to compile this cmd.c - file, it gives a lot of errors.
how can I compile this file?

I tried with "gcc cmd.c -o cmd.cgi",
this throws a lot of errors like "error: âOKâ undeclared (first use in this function)"

Can someone please help me?


Thanks a lot and kind regards
V3xX
Last edited by V3xX on Fri Nov 23, 2012 4:02 am, edited 1 time in total.
agriffin
Posts: 876
Joined: Mon May 09, 2011 9:36 am

Re: compile only cmd.c

Post by agriffin »

You should really recompile all of Nagios. The CGIs are not separate executables.
V3xX
Posts: 26
Joined: Wed Aug 29, 2012 6:48 am
Location: Switzerland

Re: compile only cmd.c

Post by V3xX »

Thanks for your answer.

Didn't get it how to compile whole nagios under RHEL 5.8.
can someone assist me?



Thanks and kind regards
agriffin
Posts: 876
Joined: Mon May 09, 2011 9:36 am

Re: compile only cmd.c

Post by agriffin »

I think this document will help you a lot with that.
V3xX
Posts: 26
Joined: Wed Aug 29, 2012 6:48 am
Location: Switzerland

Re: compile only cmd.c

Post by V3xX »

hello,

every time i try to run

Code: Select all

./configure --with-command-group=nagcmd
following error occures:

Code: Select all

[root@ch10mgm9001 nagios-3.2.3]# ./configure --with-command-group=nagcmd
-bash: ./configure: Permission denied

here is the group:

Code: Select all

nagcmd:x:501:nagios
here is user nagios:

Code: Select all

nagios:x:101:102:nagios:/var/log/nagios:/bin/sh
i'm logged in with root



where is my fault?


Thanks for your help and kind regards
V3xX
V3xX
Posts: 26
Joined: Wed Aug 29, 2012 6:48 am
Location: Switzerland

Re: compile only cmd.c

Post by V3xX »

oh, i got it.
the file permission was the problem.
edit it with chmod cleared that error.


thanks anyway

V3xX
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: [SOLVED] compile only cmd.c

Post by slansing »

If this is related to your other "cmd.cgi" thread please let us know so that we may check that one as solved as well.
V3xX
Posts: 26
Joined: Wed Aug 29, 2012 6:48 am
Location: Switzerland

Re: [SOLVED] compile only cmd.c

Post by V3xX »

hi, this is only a few related. after i could compile the .c - file i'm unable to replace the .cgi - file.
but for this case i opened a new thread.
Locked