Social Links
Categories
Tag Cloud
Twitter
Members
Main | Zenoss 2.4.x Install tutorial for FreeBSD Info »
Saturday
Jun132009

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:

[sourcecode lang="plain"]

proc     /proc     procfs     rw     0     0
[/sourcecode]

this can be done by simply opening the file with your favorite editor
[sourcecode lang="plain"]

testBSD# ee /etc/fstab
[/sourcecode]

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:
[sourcecode lang="plain"]
testBSD# reboot
[/sourcecode]

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

[sourcecode lang="plain"]
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
[/sourcecode]

then create a symlink for bash

[sourcecode lang="plain"]
testBSD# ln -s /usr/local/bin/bash /bin
[/sourcecode]

3)Add the zenoss user


[sourcecode lang="plain"]
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!
[/sourcecode]

4) Configure sudo for the zenoss user


[sourcecode lang="plain"]
testBSD# /usr/local/sbin/visudo
[/sourcecode]

you should now see the sudoers file open in vi, go ahead and uncomment the following line:

[sourcecode lang="plain"]
#%wheel ALL=(ALL) ALL
[/sourcecode]

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:

[sourcecode lang="plain"]
[zenoss@testBSD ~]$ sudo ee /usr/include/alloca.h
[/sourcecode]

go ahead and add this to the file and save

[sourcecode lang="bash"]
#ifndef _ALLOCA_H
/* #include */
#undef  __alloca
/* Now define the internal interfaces.  */
extern void *__alloca (size_t __size);
#ifdef  __GNUC__
# define __alloca(size) __builtin_alloca (size)
#endif /* GCC.  */
#endif
[/sourcecode]

6) Configure snmpd:


[sourcecode lang="plain"]

[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
[/sourcecode]

go ahead and make these lines:

[sourcecode lang="plain"]
com2sec local             localhost                 COMMUNITY
com2sec mynetwork NETWORK/24      COMMUNITY
[/sourcecode]

look like this:

[sourcecode lang="plain"]
com2sec local                 default                     public
com2sec mynetwork    {insert your network here}/24       public
[/sourcecode]

7) Setup the rc.conf file


[sourcecode lang="plain"]

[zenoss@testBSD ~]$ sudo ee /etc/rc.conf

[/sourcecode]

add these lines to the file:
[sourcecode lang="plain"]

snmpd_enable="YES"
snmpd_flags="-a -p /var/run/snmpd.pid"
syslog_enable="NO"
mysql_enable="YES"

[/sourcecode]

7) Create the install directory and set permissions


[sourcecode lang="plain"]

[zenoss@testBSD ~]$ sudo mkdir /usr/local/zenoss
[zenoss@testBSD ~]$ sudo chown -R zenoss /usr/local/zenoss
[/sourcecode]

7) Reboot


[sourcecode lang="plain"]

[zenoss@testBSD ~]$ sudo reboot

[/sourcecode]

8) Get the source tarball and extract it


[sourcecode lang="plain"]

[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

[/sourcecode]

9) Fixes so all rrd dependencies can be built


Issue 1:
[sourcecode lang="plain"]

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

[/sourcecode]

Fix:

[sourcecode lang="plain"]

[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
[/sourcecode]

add this at line 65:

[sourcecode lang="plain"]
dep=libiconv
confopts=""
patch=""
build_dep
[/sourcecode]

Issue 2:

[sourcecode lang="plain"]

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

[/sourcecode]

Fix 2:

[sourcecode lang="plain"]

[zenoss@testBSD ~/zenoss-2.4.1]$ ee rrddeps.sh
[/sourcecode]

edit the build_dep() function to look like this:

[sourcecode lang="plain"]

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
}
[/sourcecode]

Issue 3:

[sourcecode lang="plain"]

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

[/sourcecode]

Fix 3:

[sourcecode lang="plain"]
[zenoss@testBSD ~/zenoss-2.4.1]$ ee rrddeps.sh
[/sourcecode]

right above the build_dep function add this

[sourcecode lang="plain"]
export USE_GETTEXT="yes"
export CPPFLAGS+=" -I${INSTALL_DIR}/include"
export LDFLAGS+=" -L${INSTALL_DIR}/lib"

export GNU_CONFIGURE="yes"
export CONFIGURE_ENV="CPPFLAGS= -I/usr/local/zenoss/include  LDFLAGS=-L/usr/local/zenoss/lib"
[/sourcecode]

Issue 4:

[sourcecode lang="plain"]
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
[/sourcecode]

Fix 4:

[sourcecode lang="plain"]
[zenoss@testBSD ~/zenoss-2.4.1]$ sudo ln -s /usr/local/zenoss/bin/pkg-config /usr/local/bin/
[/sourcecode]

10) Edit GNUmakefile so nagios compiles


[sourcecode lang="plain"]
[zenoss@testBSD ~/zenoss-2.4.1]$ ee GNUmakefile

[/sourcecode]

edit line 63 to read

[sourcecode lang="plain"]

NAGIOSLIBS=-lc

[/sourcecode]

instead of:

[sourcecode lang="plain"]

NAGIOSLIBS=-ldl

[/sourcecode]

11) Fix so WMI builds


[sourcecode lang="plain"]
[zenoss@testBSD ~/zenoss-2.4.1]$ ee build/wmi-1.2.4/Samba/source/lib/replace/autoconf-2.60.m4
[/sourcecode]

we need to comment out lines 174-176, when we are done it should look like this

[sourcecode lang="plain"]
# AC_REQUIRE([AC_GNU_SOURCE])
# AC_REQUIRE([AC_AIX])
# AC_REQUIRE([AC_MINIX])
[/sourcecode]

12) Ok, we are going to start building Zenoss 2.4.1 now


[sourcecode lang="plain"]
# cd zenoss-2.4.0 //enter the directory were you extracted the zenoss source
# cp -p install.sh install
# chmod a+x install
# ./install
[/sourcecode]

At this point you should be met with the zenoss interactive installer.

[sourcecode lang="plain"]
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]:
[/sourcecode]

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:

[sourcecode lang="plain"]
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
[/sourcecode]

now there are still a few more things we need to do...

13) set zensocket permissions


as it says above
[sourcecode lang="plain"]
[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
[/sourcecode]

14) fix zenfunctions to allow libnetsnmp.so to load


[sourcecode lang="plain"]

[zenoss@testBSD ~/zenoss-2.4.1]$ ee /usr/local/zenoss/bin/zenfunctions

[/sourcecode]

and just add the following line to the top of the file

[sourcecode lang="plain"]

export LD_PRELOAD=/lib/libcrypt.so.4

[/sourcecode]

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...
[singlepic id=474 w=1024 h=484 mode=watermark float=center]
If you have any issues or have a comment please post it below or send me an email at caseyhillman at gmail dot com
[singlepic id=475 w=640 h=480 mode=watermark float=center]

Reader Comments (15)

Email me directly and I will make sure you can get back into the #zenoss channel. We had some sort of weird IRC hiccup, but you should be able to get into the channel. There was no intention to lock anyone out of the channel.

Thanks,
Matt Ray
Zenoss Community Manager
mray@zenoss.com

May 14, 2009 | Unregistered CommenterMatt Ray

Hey guy, you should holler at me when you get back to IRC #zenoss

Anyhow, I found this link concerning gettext which I am also trying to install zenoss 2.4 on FreeBSD 7.2

http://www.nabble.com/gettext-0.17-build-problem-with-libcroco-td13638771.html

If you beat me to the fix let me know. k?

Cheers.

May 14, 2009 | Unregistered Commenterperr0

Dear Casey

I try to install Zenoss 2.4.1 on FreeBSD 7.1, but I have a error that
you explain in fix 3.

checking for iconv_open in -liconv... no configure: error: *** No
iconv() implementation found in C library or libiconv gmake: *** [/
home/zenoss

I add the code:

right above the build_dep function add this

[sourcecode lang="plain"]
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"

But get error:

Soucercode: command not found…..
Y
Y
Y
Y
Y

And infinite number of character Y.

Please help me with this error.

June 17, 2009 | Unregistered CommenterJuan Aguirre

@Juan Aguirre
Did you put "[sourcecode lang="plain"]" in rrddeps.sh? That is part of my website, not what you should put in the file. Try taking that out and it should work. Let me know if you have any other issues.

June 17, 2009 | Unregistered CommenterCasey

And what about this:

if [ -n "$DESTDIR" ] &amp;amp;amp;amp;amp;amp;amp;&amp;amp;amp;amp;amp;amp;amp; [ "$DESTDIR" != "/" ]

also typo? Can you correct synatx for examples ? Please ...

June 17, 2009 | Unregistered Commentervvg

I have this error too with yyyyyyy :)
When brake it, this message apear:
gmake: *** [/home/zenoss/zenoss-2.4.1/build/rrddeps-build] Interrupt: 2

So any possibility to have soon some clear working install for BSD 7.x ?

June 17, 2009 | Unregistered Commentervvg

vvg.

I replace &amp;amp;amp;amp;amp;amp;&amp;amp;amp;amp;amp;amp; by && and run without error.

Dear Casey.
I deleted the [sourcecode lang="plain"], but now the line USE_GETTEXT= yes generate a infinite number of character Y.
Please any idea for this error??

Greetings
Juan Aguirre

June 18, 2009 | Unregistered CommenterJuan Aguirre

@vvg

@Juan Aguirre
I apologize, apparently the formatting my blog uses on sourcecode is not copy and paste friendly =( I will post a downloadable rrddeps.sh with all the fixes already in it within the next few days. From testing the infinite number of character Y comes from a Syntax, if you email me your rrddeps.sh I can take a look at it. caseyhillman at gmail dot com

June 18, 2009 | Unregistered CommenterCasey

@Juan
I replace it too :) Still got YYYYY errors. I notice comment about && .
I made all step by step and still not getting closer, YYY again :)
I`ll sent my rrddeps. Thank you in advance for help, Casey. This kind of help is very usefull when my day is about 25 hour.
Anyway sounds great work for Zenoss port for BSD. I`m not so familiar with python, but i like performance against solution with Nagios :)

June 18, 2009 | Unregistered Commentervvg

Sorry to posting again, i find another thing,
Issue 4, fix 4. Don`t get it ...i have already installed pkg-config in /usr/local/bin/.
Did you mean ln -s /usr/local/bin/pkg-config /usr/local/zenoss/bin/pkg-config ???

June 18, 2009 | Unregistered Commentervvg

Dear Casey.
I send you my rrddeps.sh to your email caseyhillman@gmail.com, thaks a lot.

Another question is with step 11, not exists the wmi-1.2.4 directory.

Regards
Juan

June 18, 2009 | Unregistered CommenterJuan Aguirre

Please send me rrddeps.sh on my E-mail admin@isphost.com.ua

June 18, 2009 | Unregistered CommenterHOSTER

Dear Hoster.

I send you my rrddeps.sh. Please help me review it.

Regards
Juan

June 19, 2009 | Unregistered CommenterJuan Aguirre

Dear Casey.

Please, help us review the rrddeps.sh, the fix 3 not working.

Thanks in advance.

June 19, 2009 | Unregistered CommenterJuan Aguirre

Casey:
Step 7 should be syslogd_enable="NO"; you have syslog_enable="NO"

With what you have, the built-in FreeBSD syslogd will still be running, and you cannot start Zenoss' zensyslog unless you edit zensyslog.conf to listen on a port other than 514.

July 5, 2009 | Unregistered CommenterKris Jacobs

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>