Compiling Spine on AIX error in ping.c

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
dasch
Posts: 7
Joined: Mon Aug 24, 2009 10:47 am

Compiling Spine on AIX error in ping.c

Post by dasch »

Hi,

I am trying to compile spine on AIX 5.2. All the prerequisites are there. The commands to prepare the compilation of spine mentioned in part 2.7. of the cacti manual run fine for me. Those are

Code: Select all

shell>aclocal
shell>libtoolize --force (glibtoolize --force on Max OS)
shell>autoheader
shell>autoconf
shell>automake
shell>./configure
When I then try to run

Code: Select all

shell>make
I get the following output and compilation fails:

Code: Select all

if gcc -DHAVE_CONFIG_H -I. -I. -I./config     -I/usr/local/include/net-snmp -I/usr/local/include/net-snmp/.. -I/usr/include/mysql -g -O2 -MT sql.o -MD -MP -MF ".deps/sql.Tpo" -c -o sql.o sql.c; \
then mv -f ".deps/sql.Tpo" ".deps/sql.Po"; else rm -f ".deps/sql.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I./config     -I/usr/local/include/net-snmp -I/usr/local/include/net-snmp/.. -I/usr/include/mysql -g -O2 -MT spine.o -MD -MP -MF ".deps/spine.Tpo" -c -o spine.o spine.c; \
then mv -f ".deps/spine.Tpo" ".deps/spine.Po"; else rm -f ".deps/spine.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I./config     -I/usr/local/include/net-snmp -I/usr/local/include/net-snmp/.. -I/usr/include/mysql -g -O2 -MT util.o -MD -MP -MF ".deps/util.Tpo" -c -o util.o util.c; \
then mv -f ".deps/util.Tpo" ".deps/util.Po"; else rm -f ".deps/util.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I./config     -I/usr/local/include/net-snmp -I/usr/local/include/net-snmp/.. -I/usr/include/mysql -g -O2 -MT snmp.o -MD -MP -MF ".deps/snmp.Tpo" -c -o snmp.o snmp.c; \
then mv -f ".deps/snmp.Tpo" ".deps/snmp.Po"; else rm -f ".deps/snmp.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I./config     -I/usr/local/include/net-snmp -I/usr/local/include/net-snmp/.. -I/usr/include/mysql -g -O2 -MT locks.o -MD -MP -MF ".deps/locks.Tpo" -c -o locks.o locks.c; \
then mv -f ".deps/locks.Tpo" ".deps/locks.Po"; else rm -f ".deps/locks.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I./config     -I/usr/local/include/net-snmp -I/usr/local/include/net-snmp/.. -I/usr/include/mysql -g -O2 -MT poller.o -MD -MP -MF ".deps/poller.Tpo" -c -o poller.o poller.c; \
then mv -f ".deps/poller.Tpo" ".deps/poller.Po"; else rm -f ".deps/poller.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I./config     -I/usr/local/include/net-snmp -I/usr/local/include/net-snmp/.. -I/usr/include/mysql -g -O2 -MT nft_popen.o -MD -MP -MF ".deps/nft_popen.Tpo" -c -o nft_popen.o nft_popen.c; \
then mv -f ".deps/nft_popen.Tpo" ".deps/nft_popen.Po"; else rm -f ".deps/nft_popen.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I./config     -I/usr/local/include/net-snmp -I/usr/local/include/net-snmp/.. -I/usr/include/mysql -g -O2 -MT php.o -MD -MP -MF ".deps/php.Tpo" -c -o php.o php.c; \
then mv -f ".deps/php.Tpo" ".deps/php.Po"; else rm -f ".deps/php.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I./config     -I/usr/local/include/net-snmp -I/usr/local/include/net-snmp/.. -I/usr/include/mysql -g -O2 -MT ping.o -MD -MP -MF ".deps/ping.Tpo" -c -o ping.o ping.c; \
then mv -f ".deps/ping.Tpo" ".deps/ping.Po"; else rm -f ".deps/ping.Tpo"; exit 1; fi
ping.c: In function 'init_sockaddr':
ping.c:744: error: expected identifier or '(' before 'int'
ping.c:744: error: expected ')' before 'h_errno_which'
ping.c:838: error: invalid type argument of '->'
make: *** [ping.o] Error 1
The contents around line 744 in ping.c are like

Code: Select all

int init_sockaddr(struct sockaddr_in *name, const char *hostname, unsigned short int port) {
        struct hostent *hostinfo;
        extern int h_errno;

        name->sin_family = AF_INET;
        name->sin_port   = htons (port);
Can please anyone help me in this case? Maybe it's only a little thing...

Thanks,

Daniel
dombesz
Posts: 2
Joined: Fri Sep 25, 2009 5:24 am

ping.c compil problem

Post by dombesz »

Hello,

i have the same problem on AIX 5.3, the compile showed the same error like you, but this is not miracle, due to the problem is in the source code.
My colleauges made some modification on the source code and it works.
Maybe this will helpful to you if you did not solve by yourself so far.

You have to edit ping.c and do the following :

This line "extern int h_errno;" needs to change for that :


#if !defined(H_ERRNO_DECLARED) && !defined(_AIX)

extern int h_errno;

#endif

This is some kind of system variable and based on this url, this needs to be do like this :
http://www.clusterresources.com/piperma ... 01201.html

and the second thing you shoul do is the following :

#ifdef HAVE_GETHOSTBYNAME_R_HPUX

struct hostent hostent;

struct hostent_data buf;

int rv;

/*

rv = gethostbyname_r(hostname, &hostent, &buf);

if (!rv) {

name->sin_addr = *(struct in_addr *) hostent->h_addr;

}

*/

#else

As you can see the /* and */ comment out a section which is not needed by AIX and without this section remove the compile stopped with error.

Further info can be find here : http://daniel.haxx.se/projects/portability/

I hope this will help :D

Regards,

Dombesz
User avatar
TheWitness
Developer
Posts: 17059
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Dombesz,

Can you open a bug report here http://bugs.cacti.net and upload a diff. I might have a few questions and request that you test a few builds. We only add OS support as we obtain testers. I would like to add AIX to the list.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
dombesz
Posts: 2
Joined: Fri Sep 25, 2009 5:24 am

Spine compile problem

Post by dombesz »

Hello,

i have reported the bug, the case id is 1551.

Regards,
Dombesz
User avatar
TheWitness
Developer
Posts: 17059
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

thanks
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
dasch
Posts: 7
Joined: Mon Aug 24, 2009 10:47 am

Post by dasch »

Hello,

I succeeded in Compiling Spine on AIX with the modifications in ping.c as reported in bug 1551 http://bugs.cacti.net/view.php?id=1551

Unfortunately, when I try to run spine from the command line, it stops with the following error message
  • -bash-3.00$ ./spine
    SPINE: Version 0.8.7e starting
    11/25/2009 01:07:12 PM - SPINE: Poller[0] FATAL: MySQL Error:'2014', Message:'Commands out of sync; you can't run this command now' (Spine thread)
    -bash-3.00$
Do you have any ideas or suggestions how to fix this?

Thanks and best regards,

Daniel
User avatar
TheWitness
Developer
Posts: 17059
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

I have never seen this error before in my life. Can you please send me your "./configure" output here.

Thanks.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
TheWitness
Developer
Posts: 17059
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Also, what version of MySQL server and what version of the MySQL client are you using to compile. There appear to be bugs associated with this error message.

I suspect a buggy MySQL in any case.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
dasch
Posts: 7
Joined: Mon Aug 24, 2009 10:47 am

Post by dasch »

Thanks, you gave me the deciding hint so that I could find out where the error was. During compile time, it included wrong mysql libraries so I just had to change the "Makefile" to point to the correct ones. Now spine seems to be working fine under AIX 5.3 from command line, I will let you know about it as soon as I have fully tested it and included it into our installation of cacti.

Thanks and best regards,

Daniel
dasch
Posts: 7
Joined: Mon Aug 24, 2009 10:47 am

Post by dasch »

As I promised, I wanted to let you know that we're using spine in our company for about one week on AIX 5.3 and with the patch provided by dombesz it's working fine.

Best regards,

Daniel
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests