Reposted from Casey Hillman's post Install/Upgrade Zenoss 2.4.1 on FreeBSD 7.x from a Google Cache. Hopefully the page will be back up soon.
Install/Upgrade Zenoss 2.4.1 on FreeBSD 7.x
Ok, so after many hours of troubleshooting and ./configure –help I was able to get Zenoss 2.4.1 to install on FreeBSD 7.2. This article will guide you through the required changes to get everything to compile with no problems. I will say this is the quick and dirty way to do it as I need more time to test a patched installer. Ultimately I will be working with Greg Larkin, Matt Ray, and other members of the Zenoss community to create a FreeBSD port of Zenoss so we will no longer have such issues. Here is a summary of what Zenoss 2.4 brings to the table:
Zenoss 2.4
Zenoss 2.4 includes the following new features:
- Set-Up Wizard – Zenoss Core now includes a guided setup to create users and to easily add devices to be monitored. The easy-to-use setup will prompt Zenoss users for authentication credentials for Windows and Linux/UNIX servers as well as community strings for SNMP devices.
- SSH Monitoring Capabilities – Zenoss users can now securely access Linux and Unix servers via secure shell to pull performance metrics and develop extensions for deep reporting capabilities of server performance.
- Improved Reporting – Zenoss now provides the ability to normalize data into common units. Users can now add aliases to data points and convert performance metrics to measures that are consistent across all devices.
- Extended Monitoring Guide – A new extended monitoring guide provides detailed information on how to gather metrics and outlines best practices for managing IT infrastructure with Zenoss Core.
Now lets go ahead and Install Zenoss 2.4.1 on FreeBSD…
1)Setup procfs and network connection
as root:
we need to add the following line to the /etc/fstab file:
proc /proc procfs rw 0 0
this can be done by simply opening the file with your favorite editor
testBSD# ee /etc/fstab
If you did not configure your network connection when you installed FreeBSD go ahead and use sysinstall or ifconfig to do that now.
2) Reboot
pretty straight forward, as root:
testBSD# reboot
2)Install a few things to help us out
as root go ahead and install the following if you do not already have it:
(you can check if you have one of these packages already installed by running the command pkg_info)
via pkg_add
testBSD# pkg_add -r bash
testBSD# pkg_add -r gmake
testBSD# pkg_add -r autoconf262
testBSD# pkg_add -r sudo
testBSD# pkg_add -r python
testBSD# pkg_add -r mysql50-server
testBSD# pkg_add -r net-snmp
testBSD# pkg_add -r swig
testBSD# pkg_add -r subversion
testBSD# pkg_add -r bazaar-ng
then create a symlink for bash
testBSD# ln -s /usr/local/bin/bash /bin
3)Add the zenoss user
testBSD# adduser
Username: zenoss
Full name: zenoss user
Uid (Leave empty for default):
Login group [zenoss]:
Login group is zenoss. Invite zenoss into other groups? []: wheel
Login class [default]:
Shell (sh csh tcsh bash rbash nologin) [sh]: bash
Home directory [/home/zenoss]:
Home directory permissions (Leave empty for default):
Use password-based authentication? [yes]:
Use an empty password? (yes/no) [no]:
Use a random password? (yes/no) [no]:
Enter password: ******
Enter password again: ******
Lock out the account after creation? [no]: no
Username : zenoss
Password : *****
Full Name : zenoss user
Uid : 1002
Class :
Groups : zenoss wheel
Home : /home/zenoss
Home Mode :
Shell : /usr/local/bin/bash
Locked : no
OK? (yes/no): yes
adduser: INFO: Successfully added (zenoss) to the user database.
Add another user? (yes/no): no
Goodbye!
4) Configure sudo for the zenoss user
testBSD# /usr/local/sbin/visudo
you should now see the sudoers file open in vi, go ahead and uncomment the following line:
#%wheel ALL=(ALL) ALL
5) Create a new file called alloca.h in /usr/include
Go ahead and log in as the zenoss user you created earlier. Then enter these commands:
[zenoss@testBSD ~]$ sudo ee /usr/include/alloca.h
go ahead and add this to the file and save
#ifndef _ALLOCA_H
/* #include <stdlib/alloca.h> */
#undef __alloca
/* Now define the internal interfaces. */
extern void *__alloca (size_t __size);
#ifdef __GNUC__
# define __alloca(size) __builtin_alloca (size)
#endif /* GCC. */
#endif
6) Configure snmpd:
[zenoss@testBSD ~]$ sudo cp /usr/local/share/snmp/snmpd.conf.example /usr/local/etc/snmp/snmpd.conf
[zenoss@testBSD ~]$ sudo ee /usr/local/etc/snmp/snmpd.conf
go ahead and make these lines:
com2sec local localhost COMMUNITY
com2sec mynetwork NETWORK/24 COMMUNITY
look like this:
com2sec local default public
com2sec mynetwork {insert your network here}/24 public
7) Setup the rc.conf file
[zenoss@testBSD ~]$ sudo ee /etc/rc.conf
add these lines to the file:
snmpd_enable="YES"
snmpd_flags="-a -p /var/run/snmpd.pid"
syslog_enable="NO"
mysql_enable="YES"
7) Create the install directory and set permissions
[zenoss@testBSD ~]$ sudo mkdir /usr/local/zenoss
[zenoss@testBSD ~]$ sudo chown -R zenoss /usr/local/zenoss
7) Reboot
[zenoss@testBSD ~]$ sudo reboot
8) Get the source tarball and extract it
[zenoss@testBSD ~]$ fetch http://softlayer.dl.sourceforge.net/sourceforge/zenoss/zenoss-2.4.1.tar.gz
[zenoss@testBSD ~]$ tar xvf zenoss-2.4.1.tar.gz
9) Fixes so all rrd dependencies can be built
Issue 1:
In file included from ./libxml/parser.h:797,
from ./libxml/globals.h:19,
from ./libxml/threads.h:36,
from ./libxml/xmlmemory.h:217,
from ./libxml/tree.h:1205,
from ./libcroco/cr-sel-eng.h:34,
from term-styled-ostream.oo.c:26:
./libxml/encoding.h:29:19: error: iconv.h: No such file or directory
In file included from ./libxml/parser.h:797,
from ./libxml/globals.h:19,
from ./libxml/threads.h:36,
from ./libxml/xmlmemory.h:217,
from ./libxml/tree.h:1205,
from ./libcroco/cr-sel-eng.h:34,
from term-styled-ostream.oo.c:26:
./libxml/encoding.h:137: error: expected specifier-qualifier-list before 'iconv_t'
*** Error code 1
Stop in /usr/home/zenoss/zenoss-2.4.1/build/gettext-0.17/gettext-tools/gnulib-lib.
*** Error code 1
Stop in /usr/home/zenoss/zenoss-2.4.1/build/gettext-0.17/gettext-tools/gnulib-lib.
*** Error code 1
Stop in /usr/home/zenoss/zenoss-2.4.1/build/gettext-0.17/gettext-tools.
*** Error code 1
Stop in /usr/home/zenoss/zenoss-2.4.1/build/gettext-0.17/gettext-tools.
*** Error code 1
Stop in /usr/home/zenoss/zenoss-2.4.1/build/gettext-0.17.
gmake: *** [/home/zenoss/zenoss-2.4.1/build/rrddeps-build] Error 1
unable to build zenoss and prerequisites, see zenbuild.log
Fix:
[zenoss@testBSD ~/zenoss-2.4.1]$ cd rrddeps
[zenoss@testBSD ~/zenoss-2.4.1/rrddeps]$ fetch http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.tar.gz
[zenoss@testBSD ~/zenoss-2.4.1/rrddeps]$ cd ..
[zenoss@testBSD ~/zenoss-2.4.1]$ ee rrddeps.sh
add this at line 65:
dep=libiconv
confopts=''
patch=""
build_dep
Issue 2:
config.status: executing libtool commands
gmake[1]: Nothing to be done for `unix'.
gmake[1]: Leaving directory `/usr/home/zenoss/zenoss-2.4.1/build/freetype-2.3.7'
"./builds/toplevel.mk", line 50: Need an operator
"./builds/toplevel.mk", line 52: Missing dependency operator
"./builds/toplevel.mk", line 54: Need an operator
"./builds/toplevel.mk", line 55: Need an operator
"./builds/toplevel.mk", line 64: Could not find ./objs/modules.cfg
"./builds/toplevel.mk", line 86: Missing dependency operator
"./builds/toplevel.mk", line 88: Need an operator
Error expanding embedded variable.
gmake: *** [/home/zenoss/zenoss-2.4.1/build/rrddeps-build] Error 2
unable to build zenoss and prerequisites, see zenbuild.log
Fix 2:
[zenoss@testBSD ~/zenoss-2.4.1]$ ee rrddeps.sh
edit the build_dep() function to look like this:
build_dep () {
if [ -e $BUILD_DIR/$dep-* ]
then
echo "Skipping $dep..."
else
tar xvzf $RRDDEPS_DIR/$dep-*.tar.gz || exit $?
if [ -n "$patch" ]
then
patch -p0 <$RRDDEPS_DIR/$patch || exit $?
fi
cd $dep-* || exit $?
if [ "$dep" == "freetype" ]
then
GNUMAKE=gmake ./configure --prefix=$ZENHOME $confopts || exit $?
gmake || exit $?
gmake install DESTDIR="" || exit $?
if [ -n "$DESTDIR" ] && [ "$DESTDIR" != "/" ]
then
gmake install DESTDIR="$DESTDIR" || exit $?
fi
else
./configure --prefix=$ZENHOME $confopts || exit $?
make || exit $?
make install DESTDIR="" || exit $?
if [ -n "$DESTDIR" ] && [ "$DESTDIR" != "/" ]
then
make install DESTDIR="$DESTDIR" || exit $?
fi
fi
cd ..
fi
}
Issue 3:
checking for iconv_open in -liconv... no configure: error: *** No iconv() implementation found in C library or libiconv gmake: *** [/home/zenoss/zenoss-2.4.1/build/rrddeps-build] Error 1 unable to build zenoss and prerequisites, see zenbuild.log
Fix 3:
[zenoss@testBSD ~/zenoss-2.4.1]$ ee rrddeps.sh
right above the build_dep function add this:
USE_GETTEXT=yes
CPPFLAGS+=" -I${INSTALL_DIR}/include"
LDFLAGS+=" -L${INSTALL_DIR}/lib"
GNU_CONFIGURE=yes
CONFIGURE_ENV="CPPFLAGS= -I/usr/local/zenoss/include LDFLAGS=-L/usr/local/zenoss/lib"
Issue 4:
configuring: /home/zenoss/zenoss-2.4.1/build/rrdtool-1.3.5/Makefile
gmake: *** [/home/zenoss/zenoss-2.4.1/build/rrdtool-1.3.5/Makefile] Error 1
unable to build zenoss and prerequisites, see zenbuild.log
Fix 4:
[zenoss@testBSD ~/zenoss-2.4.1]$ sudo ln -s /usr/local/zenoss/bin/pkg-config /usr/local/bin/
10) Edit GNUmakefile so nagios compiles
[zenoss@testBSD ~/zenoss-2.4.1]$ ee GNUmakefile
edit line 63 to read
NAGIOSLIBS=-lc
instead of:
NAGIOSLIBS=-ldl
11) Fix so WMI builds
[zenoss@testBSD ~/zenoss-2.4.1]$ ee build/wmi-1.2.4/Samba/source/lib/replace/autoconf-2.60.m4
we need to comment out lines 174-176, when we are done it should look like this
# AC_REQUIRE([AC_GNU_SOURCE])
# AC_REQUIRE([AC_AIX])
# AC_REQUIRE([AC_MINIX])
12) Ok, we are going to start building Zenoss 2.4.1 now
# cd zenoss-2.4.0 //enter the directory were you extracted the zenoss source
# cp -p install.sh install
# chmod a+x install
# ./install
At this point you should be met with the zenoss interactive installer.
This installer actually builds Zenoss.
For a simpler installation try the VMPlayer Appliance image,
or use RPMs for Redhat based systems.
Building...
MySQL server hostname [localhost]:
MySQL server root username [root]:
MySQL server root password []:
MySQL event database name [events]:
MySQL username for Zenoss events database [zenoss]:
MySQL password for zenoss [zenoss]:
MySQL server port [3306]:
Ok once you have entered all the information above it will start compiling everything, which, depending on your setup, can take a while. If you followed everything above you should not run into any issues and when the install is complete you should see this:
Wrote file /usr/local/zenoss/etc/zeo.conf
Wrote file /usr/local/zenoss/bin/zeoctl
Changed mode for /usr/local/zenoss/bin/zeoctl to 755
Wrote file /usr/local/zenoss/bin/runzeo
Changed mode for /usr/local/zenoss/bin/runzeo to 755
Starting Zope Object Database
. daemon process started, pid=30166
Loading initial Zenoss objects into the Zeo database
(this can take a few minutes)
ZentinelPortal loaded at zport
Starting Zope Server
. daemon process started, pid=30203
=========================================================
zensocket must be setuid. As root, execute the following:
chown root:zenoss /usr/local/zenoss/bin/zensocket
chmod 04750 /usr/local/zenoss/bin/zensocket
=========================================================
Successfully installed Zenoss
now there are still a few more things we need to do…
13) set zensocket permissions
as it says above
[zenoss@testBSD ~/zenoss-2.4.1]$ sudo chown root:zenoss /usr/local/zenoss/bin/zensocket
[zenoss@testBSD ~/zenoss-2.4.1]$ sudo chmod 04750 /usr/local/zenoss/bin/zensocket
14) fix zenfunctions to allow libnetsnmp.so to load
[zenoss@testBSD ~/zenoss-2.4.1]$ ee /usr/local/zenoss/bin/zenfunctions
and just add the following line to the top of the file
export LD_PRELOAD=/lib/libcrypto.so.4
and now you have Zenoss 2.4.1 running on FreeBSD 7.x, go ahead and point your browser to http://yourserver:8080 and enjoy…