PDA

View Full Version : Centreon on FreeBSD


Oloremo
06-03-2008, 04:36 PM
Hello all.

Im very interested at instaling Centreon on FreeBSD 6.x or 7.x
Does it possible? Looks like it totaly for linux...

WAtt
06-03-2008, 09:47 PM
Hi,

i don't know if install is compatible with FreeBSD, but if you want to try and feedback your experience.

After that, can you help me to make a good install for DSD like ?

Oloremo
06-04-2008, 11:09 AM
Hello.

All im can say what it a linux only instalation now.
Im not a programmer and im not looking at sourse and im dont know is were a linux only things in a code.

If wereis not - then im think it will be easy make a port for FreeBSD(just chage paths and some scripts). And it will be great. Nagios allready were and instaling easy and fast from ports.

If im may help - im will be glad to do so.

Sorry for my english....

WAtt
06-04-2008, 11:25 AM
Hi

What is your native language ?

for a moment, can you try to install centreon2 on your freebsd with use BASH shell and attach a log result on this post...

I'll try to find what doesn't compatible and fix it

roland.guthauser
06-04-2008, 02:56 PM
Hi

I'm currently installing Centreon 2 and Nagios 3 on FreeBSD 7.0-RELEASE. There're some things you have to pay attention. I've installed all dependencies (PEAR, PHP, Apache ...) from ports tree execpt Pear module DB_DataObject_FormBuilder 1.0.0RC4 - this seems to be a very new modul (BSD ports tree has pear-DB_DataObject_FormBuilder-0.18.1).

I also made a symbolic link from /usr/local/bin/bash to /bin/bash - otherwise the install scripts has some problems detecting some pathes - don't ask me why...

next thing is, that the libinstall/functions doesn't find Apache 2.2 config directory and htpasswd:

So I added manually the following to the functions script:

elif [ -d /usr/local/etc/apache22 ] ; then
DIR_APACHE="/usr/local/etc/apache22"
DIR_APACHE_CONF="/usr/local/etc/apache22/Includes"
HTPASSWD="/usr/local/sbin/htpasswd"

If you install rrd, pear, nagios from ports you can take the following pathes:
RRD_PERL="/usr/local/lib/perl5/site_perl/5.8.8/mach/RRDs.pm"
SUDO_FILE="/usr/local/etc/sudoers"
INIT_D="/usr/local/etc/rc.d"
PHP_BIN="/usr/local/bin/php"
PEAR_PATH="/usr/local/share/pear/PEAR.php"
NAGIOS_PLUGIN="/usr/local/libexec/nagios"
NAGIOS_IMG="/usr/local/www/nagios/images/s"
BIN_RRDTOOL="/usr/local/bin/rrdtool"

that's all for the moment - now I've to test centreon webinterface to see if it works

WAtt
06-04-2008, 03:14 PM
Hi

apache dir add on install script :) http://trac.centreon.com/changeset/5304

If you use only a ports for install... Can you create a template file for FreeBSD ?

see on "src"/tmpl/vardistrib/

Thank for your help :)

roland.guthauser
06-04-2008, 05:14 PM
ok, thanks for apache22

I'm on the way to create a FreeBSD template, now I have two questions:

- what kind of files are stored in CENTREON_VARLIB?
- what kind of files are stored in CENTPLUGINS_TMP?

as /var/lib/ doesn't exists on FreeBSD it doesn't make much sense to create a new directory tree.

WAtt
06-04-2008, 05:51 PM
On freeBSD, where to you store a "variable" file ?

Oloremo
06-05-2008, 12:54 PM
My native lang is russian.

Variable files at FreebSD stored at /var ;-)

% ls -l1 /var/
.snap
account
at
audit
backups
cache
crash
cron
db
empty
games
heimdal
lib
log
mail
msgs
named
preserve
run
rwho
spool
tmp
yp

Most problem in installing at FreeBSD it is a path`s.

Im upload a 3 attachments.

nagios-file-list.txt -- it is all files a dirs what nagios 3.0.2 create then he installed from ports.

cron.txt -- it is all about cron at FreeBSD. Last one thing - startup script locate at /etc/rc.d/cron

install.txt -- it is log of my instalation.

Please read it, question below:
1) Where is installed Nagios ?
default to [/usr/local/nagios]

What nagios? Binaries? cgi scripts? Look at nagios-file-list.txt.

2) Where is your Nagios var directory ?
default to [/usr/local/nagios/var]

What is a "nagios var dir"? Look at nagios-file-list.txt.

3) Where is your cron.d directory ?
default to [/etc/cron.d]

Look at cron.txt. Im really don`t know were to install this.

4) Where is your init.d directory ?
default to [/etc/init.d]

FreeBSD dont have a /etc/init.d.
All startup scripts of base system locate at /etc/rc.d/

5) Where is your Apache conf.d directory
> /usr/local/etc/rc.d

No apache conf.d at FreeBSD...
Apache startup scripts instelled at /usr/local/etc/rc.d

----
*FreeBSD make a difference of base system and installed pakages - all base locate at / , all installed after locate at /usr/local*
----

6) Where is your Apache htpasswd file
> /usr/local/www/nagios/cgi-bin/htpasswd.users

If im dont have it?... Im have it at nagios cgi-bin for auth only.

7) Do you want to use NDO ?
[y/n], default to [n]:

What is this?...


Wooh... im think it is all.
Feel free to ask me if im write somethink not clear.
And very very sorry for my english. :-(

Im like nagios very much but if we cant install centerion on it, we think we will migrate to zenoss or zabbix... :-(

Thank you for you answers and help.

roland.guthauser
06-05-2008, 02:39 PM
Hi

see freebsd.tmpl.txt, this is my actual *testing* template for installing on FreeBSD 7.0-Release

During istallation I get the following error:
------------------------------------------------------------------------
Start CentPlugins Installation
------------------------------------------------------------------------
Finding Nagios user : nagios
Finding Nagios group : nagios
Preparing Centreon temporary files)
/data/tmp exists, it will be moved...
ls: /data/tmp/src/plugins/src/check*centreon*: No such file or directory
ls: /data/tmp/src/plugins/src/check_snmp*: No such file or directory
sed: /data/tmp/src/plugins/src/centreon.pm: No such file or directory
sed: /data/tmp/src/plugins/src/centreon.conf: No such file or directory
sed: /data/tmp/src/plugins/src/check_meta_service: No such file or directory
sed: /data/tmp/src/plugins/src/process-service-perfdata: No such file or directory
sed: /data/tmp/src/plugins/src/submit_host_check_result: No such file or directory
sed: /data/tmp/src/plugins/src/submit_service_check_result: No such file or directory
CentPlugins is installed

after Installation I have 5 temp directories?!
nagios01# ll -d /data/tmp*
drwxr-xr-x 5 root wheel 512 Jun 5 13:27 /data/tmp
drwxr-xr-x 5 root wheel 512 Jun 5 13:26 /data/tmp.20080605-130604
drwxr-xr-x 5 root wheel 512 Jun 5 13:25 /data/tmp.20080605-130610
drwxr-xr-x 5 root wheel 512 Jun 5 13:26 /data/tmp.20080605-130633
drwxr-xr-x 5 root wheel 512 Jun 5 13:26 /data/tmp.20080605-130647
nagios01#

all seem to be more or less the same

Oloremo
06-06-2008, 05:46 PM
Hello WAtt.

Do you need some more info?
Can we help?

WAtt
06-06-2008, 05:53 PM
I'll implement a FreeBSD differences this weekend.

For plugins problem, use a makePackages.sh in tools on SVN

http://svn.centreon.com/trunk/tools/

Oloremo
06-07-2008, 02:13 PM
It is a great!
Thank you very much.

Im will help test it.
If all will work fine, it is a good idea to make a port of it.

roland.guthauser
06-09-2008, 05:58 PM
Just found another thing that doesn't work on FreeBSD

The install script installs two files (centreon and censtorage) in cron.d directory. On FreeBSD this files in /var/cron/tabs are named like account. This means if you've an account called nagios the file has to be /var/cron/tabs/nagios. There is no more need to give the user in the crontab file - for me it would be enough to have one file:

#!/bin/sh
#
# Cron Configuration for Centreon
#
# rewrite file with new cron line

# Cron for log analyser - for reporting
0 1 1-31 * * /usr/local/bin/php -q /usr/local/centreon/cron/reporting/ArchiveLogInDB.php >> /var/log/centreon/archiveLogInDB.log >/dev/null 2>&1

# Cron for CentACL
*/2 * * * * /usr/local/bin/php -q /usr/local/centreon/cron/centAcl.php >> /var/log/centreon/centAcl.log >/dev/null 2>&1

# Cron for log parsor
* * * * * /usr/local/bin/logAnalyser >> /var/log/centreon/logAnalyser.log >/dev/null 2>&1

# Cron for tracing Nagios Poller Performances
*/5 * * * * /usr/local/bin/nagiosPerfTrace >> /var/log/centreon/nagiosPerfTrace.log >/dev/null 2>&1

WAtt
06-09-2008, 10:05 PM
have you a other solution about a crontab ???

Howto found a freeBSD system ?

Can you look howto change this function to find a freeBSD system.
http://api.centreon.com/Centreon/2.0-beta4/libinstall.functions.html#find_OS

If I can found that, I can change a sudo installation process.

Thx in advance.

roland.guthauser
06-10-2008, 08:43 AM
what about uname -s for OS or if you want OS version uname -sr

nagios01# uname -s
FreeBSD
nagios01# uname -sr
FreeBSD 7.0-RELEASE-p1
nagios01#

this should also works on linux

roland.guthauser
06-10-2008, 03:15 PM
have you a other solution about a crontab ???

Well we have just to generate one file and name this like the user we want to run as.


Howto found a freeBSD system ?

Can you look howto change this function to find a freeBSD system.
http://api.centreon.com/Centreon/2.0-beta4/libinstall.functions.html#find_OS

If I can found that, I can change a sudo installation process.

Thx in advance.

I've attached you a diff for /libinstall/functions to find FreeBSD through find_OS. I've no NetBSD, OpenBSD here to check "uname -s", but I think it would be like on FreeBSD. On Solaris it is "SunOS"

On FreeBSD every script that's in /usr/local/etc/rc.d/ will be started at boot time as last task before you get the logging prompt with the argument "start" - at shutdown time all the scripts will be called first with argument "stop". But the init script has to be adapted for FreeBSD, some calls like "nice" has to be called differently, I will have a closer look to make the init script BSD like.

WAtt
06-10-2008, 03:32 PM
Thx for your patch, but I allready write it (it's a same idea :p)

Could you valid a change before I commit ?

roland.guthauser
06-10-2008, 03:51 PM
Patch should be ok.

Did you also have a look for FreeBSD init script? If no, I will have a closer look at this.

WAtt
06-10-2008, 03:59 PM
for a moment I just have a online doc for freebsd ^^

roland.guthauser
06-10-2008, 05:15 PM
ok I have enough FreeBSD servers here to test... I will start with centcore startup script. If you or others have any inputs, just drop a message

Oloremo
06-11-2008, 02:30 PM
Im going to vacations till monday.
As im come back im will join testing.

roland.guthauser
06-11-2008, 05:27 PM
There are two problems with startup scripts

centcore:
in the original code startup is as following:
su - nagios -c "nice -n $NICE $Bin &"

the problem is with "&" in the startup code, without the "&" the script stays in foreground and that's not very good and I haven't found a way to add a "&" function in FreeBSD init scripting.

centstorage:
starting is ok, but I get the following error:
Parameter to use lib must be directory, not file at /usr/local/bin/centstorage line 31


if I delete the line use lib "/usr/local/lib/perl5/site_perl/5.8.8/mach/RRDs.pm";
in /usr/local/bin/centstorage everything seems to be ok.

I've attached the 2 startup scripts I use at the moment - If you use them don't forget to set centcore_enable="YES" and centstorage="YES" int /etc/rc.conf

Oloremo
06-16-2008, 02:36 PM
Hello, im back.

Could you tell me what a status of FreeBSD version of Centreon?
What is need to test? If were a new builds, patches, etc?

Oloremo
06-25-2008, 03:14 PM
Hello Watt.

Im look at beta 4 of Centerion and were is no FreeBSD improvement.
We must wait more?.. :-(

Any way if you need testing I all yours.

roland.guthauser
07-07-2008, 06:10 PM
Hi Watt

Just tried to install centreon 5477 from svn which doesn't work anymore on FreeBSD.

In install.sh you search for the binary lsb_release, which doesn't exist on BSD:

## Test all binaries
BINARIES="rm cp mv chmod chown echo cat more mkdir find sed lsb_release"

echo "$line"
echo -e "\t$(gettext "Checking all needed binaries")"
echo "$line"

binary_fail="0"
# For the moment, I check if all binary exists in path.
# After, I must look a solution to use complet path by binary
for binary in $BINARIES; do
pathfind "$binary"
if [ "$?" -eq 0 ] ; then
echo_success "${binary}" "$ok"
else
echo_failure "${binary}" "$fail"
log "ERR" "$(gettext "\$binary not found in \$PATH")"
binary_fail=1

fi
done


installation failes on the very beginning... I think we have to run in a first step function find_OS() from libinstall/functions to see what kind of OS we're running on, before we call Unix/Linux specific commands

WAtt
07-12-2008, 10:39 PM
Hi

bug fixed in http://trac.centreon.com/changeset/5549 :)