NRPE on Tru64 Alpha

Novick, Jeff novickj at toysrus.com
Fri Mar 5 19:13:20 CET 2004


Hi, 
 I applied this patch as I was receiving the "error: storage size of
`long_options' isn't known" error , but now I am receiving this error with
Compaq C :

# make
cd ./src/; make ; cd ..
cc -g -DHAVE_CONFIG_H -o nrpe nrpe.c utils.c
nrpe.c:
cc: Error: nrpe.c, line 520: In this declaration, "socklen_t" must specify a
type. (badparsedecl)
 socklen_t addrlen;
--------^
cc: Error: nrpe.c, line 619: In this statement, "addrlen" is not declared.
(undeclared)
     addrlen=sizeof(addr);
--------------------------------^
utils.c:
*** Exit 1
Stop.
*** Exit 1
Stop.


cc -V
Compaq C V6.3-029 on Compaq Tru64 UNIX P5.1 (Rev. 725)
Compiler Driver V6.3-029 (sys) cc Driver

and with gcc I get :
# make
cd ./src/; make ; cd ..
make[1]: Entering directory `/root/source/nrpe-2.0/src'
gcc -g -O2 -DHAVE_CONFIG_H -o nrpe nrpe.c utils.c
nrpe.c: In function `wait_for_connections':
nrpe.c:520: `socklen_t' undeclared (first use in this function)
nrpe.c:520: (Each undeclared identifier is reported only once
nrpe.c:520: for each function it appears in.)
nrpe.c:520: syntax error before "addrlen"
nrpe.c:619: `addrlen' undeclared (first use in this function)
make[1]: *** [nrpe] Error 1
make[1]: Leaving directory `/root/source/nrpe-2.0/src'

gcc --version
gcc (GCC) 3.2.3
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

What can I do?
Thank you,
Jeff
-----Original Message-----
From: Steve Feehan [mailto:sfeehan at sbb.uvm.edu] 
Sent: Tuesday, January 13, 2004 10:18 AM
To: nagios at acmecargo.com
Cc: nagios-users at lists.sourceforge.net
Subject: Re: [Nagios-users] NRPE on Tru64 Alpha


On Tue, Jan 13, 2004 at 09:01:39AM -0500, Steve Feehan wrote:
> On Tue, Jan 13, 2004 at 07:37:05AM -0500, nagios at acmecargo.com wrote:
> > I have 4 Compaq Alpha servers running Tru64. Does anybody know where
source 
> > for the NRPE agent might exists for these platforms?
> > 
> > Dylan
> 
> The source is the same for all platforms. I have successfully
> built nrpe for tru64 (5.1a). I recall that it required small
> changes to the source code. I think it was all related to 
> tru64 not having getopt_long.
> 
> Steve

Here's a patch that works for me:


diff -ur nrpe-2.0/src/check_nrpe.c nrpe-2.0-mod/src/check_nrpe.c
--- nrpe-2.0/src/check_nrpe.c	2003-09-08 22:52:37.000000000 -0400
+++ nrpe-2.0-mod/src/check_nrpe.c	2003-12-01 18:00:48.000000000 -0500
@@ -308,7 +308,7 @@
 	int c=1;
 	int i=1;
 
-#ifdef HAVE_GETOPT_H
+/* #ifdef HAVE_GETOPT_H
 	int option_index=0;
 	static struct option long_options[]={
 		{"host", required_argument, 0, 'H'},
@@ -321,7 +321,7 @@
 		{"license", no_argument, 0, 'l'},
 		{0, 0, 0, 0}
                 };
-#endif
+#endif */
 
 	/* no options were supplied */
 	if(argc<2)
@@ -330,11 +330,11 @@
 	snprintf(optchars,MAX_INPUT_BUFFER,"H:c:a:t:p:nhl");
 
 	while(1){
-#ifdef HAVE_GETOPT_H
+/* #ifdef HAVE_GETOPT_H
 
c=getopt_long(argc,argv,optchars,long_options,&option_index);
-#else
+#else */
 		c=getopt(argc,argv,optchars);
-#endif
+/*#endif*/
 		if(c==-1 || c==EOF)
 			break;
 
diff -ur nrpe-2.0/src/nrpe.c nrpe-2.0-mod/src/nrpe.c
--- nrpe-2.0/src/nrpe.c	2003-09-08 22:52:37.000000000 -0400
+++ nrpe-2.0-mod/src/nrpe.c	2003-12-01 18:01:25.000000000 -0500
@@ -1437,7 +1437,7 @@
 	int c=1;
 	int have_mode=FALSE;
 
-#ifdef HAVE_GETOPT_H
+/*#ifdef HAVE_GETOPT_H
 	int option_index=0;
 	static struct option long_options[]={
 		{"config", required_argument, 0, 'c'},
@@ -1448,7 +1448,7 @@
 		{"license", no_argument, 0, 'l'},
 		{0, 0, 0, 0}
                 };
-#endif
+#endif */
 
 	/* no options were supplied */
 	if(argc<2)
@@ -1457,11 +1457,11 @@
 	snprintf(optchars,MAX_INPUT_BUFFER,"c:nidhl");
 
 	while(1){
-#ifdef HAVE_GETOPT_H
+/*#ifdef HAVE_GETOPT_H
 
c=getopt_long(argc,argv,optchars,long_options,&option_index);
-#else
+#else */
 		c=getopt(argc,argv,optchars);
-#endif
+/* #endif */
 		if(c==-1 || c==EOF)
 			break;
 


-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting
any issue. 
::: Messages without supporting info will risk being sent to /dev/null


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list