plugin compile error
Posted: Fri Dec 07, 2012 2:17 pm
please let me know if this is in the wrong place.
Compiling nagios-plugins-1.4.16 on Red Hat
this is the log:
This is the pertinent code: check_http.c
<snip>
<snip>
and
<snip>
<snip>
the highlighted line will still be reached and compile attempted even though the #IFDEF skipped the declaration when HAVE_SSL = FALSE.
Compiling nagios-plugins-1.4.16 on Red Hat
Code: Select all
uname -a
Linux <hostname> 2.6.32-220.el6.x86_64 #1 SMP Wed Nov 9 08:03:13 EST 2011 x86_64 x86_64 x86_64 GNU/Linux
Code: Select all
make[2]: Entering directory `/u04/apps/nagios_install/nagios-plugins-1.4.16/plugins'
gcc -DLOCALEDIR=\"/usr/local/nagios/share/locale\" -DHAVE_CONFIG_H -I. -I.. -I.. -I../lib -I../gl -I../intl -I/usr/include -DNP_VERSION='"1.4.16"' -g -O2 -MT check_http.o -MD -MP -MF .deps/check_http.Tpo -c -o check_http.o check_http.c
check_http.c: In function 'process_arguments':
check_http.c:312: error: 'ssl_version' undeclared (first use in this function)
check_http.c:312: error: (Each undeclared identifier is reported only once
check_http.c:312: error: for each function it appears in.)
make[2]: *** [check_http.o] Error 1
make[2]: Leaving directory `/u04/apps/nagios_install/nagios-plugins-1.4.16/plugins'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/u04/apps/nagios_install/nagios-plugins-1.4.16'
make: *** [all] Error 2
<snip>
Code: Select all
#ifdef HAVE_SSL
int check_cert = FALSE;
int ssl_version;
int days_till_exp_warn, days_till_exp_crit;
char *randbuff;
X509 *server_cert;
# define my_recv(buf, len) ((use_ssl) ? np_net_ssl_read(buf, len) : read(sd, buf, len))
# define my_send(buf, len) ((use_ssl) ? np_net_ssl_write(buf, len) : send(sd, buf, len, 0))
#else /* ifndef HAVE_SSL */
# define my_recv(buf, len) read(sd, buf, len)
# define my_send(buf, len) send(sd, buf, len, 0)
#endif /* HAVE_SSL */
and
<snip>
Code: Select all
#ifdef HAVE_SSL
if ((temp=strchr(optarg,','))!=NULL) {
*temp='\0';
if (!is_intnonneg (temp))
usage2 (_("Invalid certificate expiration period"), optarg);
days_till_exp_warn = atoi(optarg);
*temp=',';
temp++;
if (!is_intnonneg (temp))
usage2 (_("Invalid certificate expiration period"), temp);
days_till_exp_crit = atoi (temp);
}
else {
days_till_exp_crit=0;
if (!is_intnonneg (optarg))
usage2 (_("Invalid certificate expiration period"), optarg);
days_till_exp_warn = atoi (optarg);
}
check_cert = TRUE;
/* Fall through to -S option */
#endif
case 'S': /* use SSL */
#ifndef HAVE_SSL
usage4 (_("Invalid option - SSL is not available"));
#endif
use_ssl = TRUE;
if (optarg == NULL || c != 'S')
>>>>>>>>>>>>>> ssl_version = 0; <<<<<<<<<<<<<<<<<<<<<
else {
the highlighted line will still be reached and compile attempted even though the #IFDEF skipped the declaration when HAVE_SSL = FALSE.