Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


Cactid and Mac OS X

 
Post new topic   Reply to topic    Cacti Forum Index -> Help: Unstable Development Versions
Author Message
Edwin



Joined: 31 Oct 2003
Posts: 6
Location: New York

PostPosted: Tue Sep 14, 2004 3:10 pm    Post subject: Cactid and Mac OS X Reply with quote

Hi,

I am trying to compile cactid 0.8.6 on Mac OS X 10.3.5. I had no problems compiling on Solaris or Linux before. I ran into the following problems:

./configure went well...but then when doing make:

# make
source='sql.c' object='sql.o' libtool=no \
depfile='.deps/sql.Po' tmpdepfile='.deps/sql.TPo' \
depmode=gcc3 /bin/sh ./config/depcomp \
gcc -DHAVE_CONFIG_H -I. -I. -I./config -I/usr/local/include/net-snmp -I/usr/local/include/net-snmp/.. -I/usr/local/mysql/include/mysql -g -O2 -c `test -f 'sql.c' || echo './'`sql.c
In file included from sql.c:27:
cactid.h:199: error: conflicting types for `host_t'
/usr/include/mach/mach_types.h:103: error: previous declaration of `host_t'
make: *** [sql.o] Error 1

I fixed this (search on Google) by renaming "host_t" into "Host_t" in all the .c and .h files.

#make

gcc -DHAVE_CONFIG_H -I. -I. -I./config -I/usr/local/include/net-snmp -I/usr/local/include/net-snmp/.. -I/usr/local/mysql/include/mysql -g -O2 -c `test -f 'util.c' || echo './'`util.c
source='snmp.c' object='snmp.o' libtool=no \
depfile='.deps/snmp.Po' tmpdepfile='.deps/snmp.TPo' \
depmode=gcc3 /bin/sh ./config/depcomp \
gcc -DHAVE_CONFIG_H -I. -I. -I./config -I/usr/local/include/net-snmp -I/usr/local/include/net-snmp/.. -I/usr/local/mysql/include/mysql -g -O2 -c `test -f 'snmp.c' || echo './'`snmp.c
In file included from /usr/local/include/net-snmp/library/snmpUnixDomain.h:7,
from /usr/local/include/net-snmp/session_api.h:29,
from /usr/local/include/net-snmp/net-snmp-includes.h:65,
from snmp.c:36:
/usr/include/sys/socket.h:79: error: conflicting types for `u_int'
/usr/include/sys/types.h:80: error: previous declaration of `u_int'
snmp.c: In function `snmp_init':
snmp.c:57: error: `NETSNMP_DS_LIBRARY_ID' undeclared (first use in this function)
snmp.c:57: error: (Each undeclared identifier is reported only once
snmp.c:57: error: for each function it appears in.)
snmp.c:57: error: `NETSNMP_DS_LIB_PRINT_BARE_VALUE' undeclared (first use in this function)
snmp.c:58: error: `NETSNMP_DS_LIB_QUICK_PRINT' undeclared (first use in this function)
snmp.c:59: error: `NETSNMP_DS_LIB_NUMERIC_TIMETICKS' undeclared (first use in this function)
make: *** [snmp.o] Error 1

Has anyone be succesful with Mac OS X or knows how to fix this?

Thanks,
Edwin

P.S. I am not a programmer
Back to top
TheWitness
Developer


Joined: 14 May 2002
Posts: 9671
Location: MI, USA

PostPosted: Tue Sep 14, 2004 3:16 pm    Post subject: Reply with quote

Have you done the following:

1) Downloaded and Made Net-SNMP (www.net-snmp.org)
2) Downloaded and Made MySQL Client Libraries (www.mysql.com)
3) Upgraded GCC to a version on or about 3.2+

There is a readme in the CACTID distribution that should help (a start anyway) with the building of this product. Keep me posted on your progress.

TheWitness
Back to top
Edwin



Joined: 31 Oct 2003
Posts: 6
Location: New York

PostPosted: Tue Sep 14, 2004 9:20 pm    Post subject: Reply with quote

I installed Net-SNMP and MySQL using binary packages. So I followed your suggestions.

After installing net-snmp and mysql from the soucre (/usr/local) it was compiling without any problems. The only thing that I still had to change is host_t into Host_t in all the .c and .h files. Maybe an idea to make a separate source package for Mac OS X? If you want I can post the source and binary for Mac OS X with install instructions.

When running cactid manually it gives me the following error:

# ./cactid
CACTID: Using cactid config file [cactid.conf]
WARNING: Unrecongized directive: LogFile=/var/log/cactid.log in cactid.conf

But /usr/log/cactid.log exists. Any idea?


Thanks,
Edwin

BTW: Cacti is getting better and better. Well done!!!
Back to top
TheWitness
Developer


Joined: 14 May 2002
Posts: 9671
Location: MI, USA

PostPosted: Tue Sep 14, 2004 9:26 pm    Post subject: Reply with quote

Obsolete directive. Cactid will use the logfile in your Settings->Paths location.

TheWitness
Back to top
TheWitness
Developer


Joined: 14 May 2002
Posts: 9671
Location: MI, USA

PostPosted: Tue Sep 14, 2004 9:27 pm    Post subject: Reply with quote

And yes, post the installation instructions and send a note to iberry@raxnet.net with the binary attached and he can post for you on the web site.

TheWitness
Back to top
Edwin



Joined: 31 Oct 2003
Posts: 6
Location: New York

PostPosted: Tue Sep 14, 2004 11:34 pm    Post subject: Reply with quote

Cactid on Mac OS X Client and Server 10.3.5


Prerequirements:

- XCode 1.1 or 1.2 (http://developer.apple.com)
- Unix source of Net-SNMP (http://www.net-snmp.org)
- Unix source of MySQL (http://www.mysql.com)

Make sure that you are using gcc3.3.

On the commandline type:

# gcc -v
Reading specs from /usr/libexec/gcc/darwin/ppc/3.3/specs
Thread model: posix
gcc version 3.3 20030304 (Apple Computer, Inc. build 1495)

If this is not the case type:

# gcc_select -force 3.3
Default compiler has been set to:
gcc version 3.3 20030304 (Apple Computer, Inc. build 1495)


Change in all .h and .c files "host_t" to "Host_t"


Build instructions:

MySQL

Only the client libraries are needed for cactid so MySQL can be configured with the following option:

./configure --without-server

make
make install

MySQL will be installed in /usr/local


Net-SNMP

nothing special required

./configure

make
make install

Net-SNMP will be installed in /usr/local

Cactid

./configure

make
make install

cactid will be installed in /usr/local


To see how libaries are linked to cactid:

# otool -L /usr/local/cactid/bin/cactid
/usr/local/cactid/bin/cactid:
/usr/local/lib/libnetsnmp.5.dylib (compatibility version 6.0.0, current version 6.9.0)
/usr/lib/libcrypto.0.9.7.dylib (compatibility version 0.9.7, current version 0.9.7)
/usr/local/lib/mysql/libmysqlclient.12.dylib (compatibility version 13.0.0, current version 13.0.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 71.1.1)



Installation on Mac OS X Server:

Mac OS X Server comes with Net-SNMP and MySQL Server. It does not have the MySQL client libraries and there is no need to install XCode on the server.

Create on the server the following directory:

# mkdir -p /usr/local/lib/mysql
# mkdir -p /usr/local/cactid/bin

Copy libmysqlclient.12.dylib in /usr/local/lib/mysql on the client to /usr/local/lib/mysql on the server.
Copy cactid and cactid.conf on the client to /usr/local/cactid/bin


Hope this will help to run cactid on Mac OS X

Edwin
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Help: Unstable Development Versions All times are GMT - 5 Hours
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group