# IcingaDB supported on FreeBSD (Ports, Packages)?

**URL:** <https://community.icinga.com/t/icingadb-supported-on-freebsd-ports-packages/10351>\
**Category:** Icinga DB\
**Tags:** freebsd, icingadb\
**Created:** [August 10, 2022, 11:33am UTC](https://community.icinga.com/t/icingadb-supported-on-freebsd-ports-packages/10351 "2022-08-10T11:33:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrdsam](https://community.icinga.com/user_avatar/community.icinga.com/mrdsam/32/7459_2.png) [@mrdsam](https://community.icinga.com/u/mrdsam)\
**Post date:** [August 10, 2022, 11:33am UTC](https://community.icinga.com/t/icingadb-supported-on-freebsd-ports-packages/10351/1 "2022-08-10T11:33:53Z")

</div>

Hi,

I’m running a huge Monitoring-Environment (\>20 Nodes) completly on FreeBSD 13.x. Currently, I’m using IDO-DB, but I see that support will be removed in the future.

Are there plans to support FreeBSD, e.g. in form of maintaining a “port”? Has anyone tried to build _icingadb_ on FreeBSD? It is written in _go_, so in theory it might work.

–  
SaM

---

<div class="post-metadata">

**Author:** ![theFeu](https://community.icinga.com/user_avatar/community.icinga.com/thefeu/32/7277_2.png) [@theFeu](https://community.icinga.com/u/theFeu)\
**Post date:** [August 11, 2022, 8:18am UTC](https://community.icinga.com/t/icingadb-supported-on-freebsd-ports-packages/10351/2 "2022-08-11T08:18:52Z")

</div>

Hey there,  
there most likely won’t be any official support for FreeBSD from Icinga, I’m afraid.  
Icinga on FreeBSD was always a community project, so I’m positive that IcingaDB for FreeBSD is something that will come up sooner or later.

Fingers crossed 🤞

---

<div class="post-metadata">

**Author:** ![mrdsam](https://community.icinga.com/user_avatar/community.icinga.com/mrdsam/32/7459_2.png) [@mrdsam](https://community.icinga.com/u/mrdsam)\
**Post date:** [August 11, 2022, 8:38am UTC](https://community.icinga.com/t/icingadb-supported-on-freebsd-ports-packages/10351/3 "2022-08-11T08:38:28Z")

</div>

Thank you for the information, Feu.

---

<div class="post-metadata">

**Author:** ![Matlib](https://community.icinga.com/user_avatar/community.icinga.com/matlib/32/4164_2.png) [@Matlib](https://community.icinga.com/u/Matlib)\
**Post date:** [January 23, 2023, 9:45pm UTC](https://community.icinga.com/t/icingadb-supported-on-freebsd-ports-packages/10351/4 "2023-01-23T21:45:37Z")

</div>

**Installing IcingaWeb/DB on FreeBSD**

Prereq:

- installed and running Icinga server
- remove the _icingaweb2_ package as it is totally outdated

# 1. Redis

```shell
pkg install redis

```

Create file **/usr/local/etc/icinga2/redis.conf** with the following content:

```plaintext
bind 127.0.0.1
protected-mode yes
port 6380
tcp-backlog 5
unixsocket /var/run/icinga2/redis.sock
unixsocketperm 660
timeout 0
tcp-keepalive 300
daemonize yes
supervised no
pidfile /var/run/icinga2/redis.pid
loglevel notice
logfile /var/log/icinga2/redis.log
databases 16
always-show-logo no
set-proc-title no
save ""
tracking-table-max-keys 1000
user default on allcommands allkeys allchannels >redis-password
maxclients 100
maxmemory 128MB
maxmemory-policy noeviction
shutdown-timeout 1

```

Launch redis:

```shell
daemon -u icinga redis-server /usr/local/icinga2/redis.conf

```

Check the log file **/var/log/icinga2/redis.log** if we’re happy.

Edit file **/usr/local/etc/icinga2/features-available/icingadb.conf** and enter these values:

```plaintext
object IcingaDB "icingadb" {
  host = "127.0.0.1"
  port = 6380
  password = "redis-password"
}

```

Enable Redis module in Icinga server:

```shell
ln -s /usr/local/etc/icinga2/features-available/icingadb.conf /usr/local/etc/icinga2/features-enabled/
pkill -HUP icinga2

```

Verify if all gears turn.

# 2. IcingaDB daemon

Compilation has to be done on machine/credentials connected to the Internet, as the build process downloads a lot of files.

```shell
pkg install go

```

Download a fresh version of [IcingaDB](https://github.com/Icinga/icingadb/releases). The following steps are done with an unpriviledged user:

```auto
tar -xf v*.tar.gz
cd icingadb-*/cmd/icingadb
go build

```

This should produce the binary called **icingadb** that needs be copied to the production machine (_/usr/local/bin_ being the usual location).

Set up the [database](https://github.com/Icinga/icingadb/blob/master/doc/02-Installation.md#setting-up-the-database). Then create the configuration file **/usr/local/etc/icinga2/icingadb.yml** :

```plaintext
database:
  type: pgsql
  host: 127.0.0.1
  port: 5432
  database: icingadb
  user: icinga
  password: postgres-password

redis:
  host: 127.0.0.1
  port: 6380
  password: redis-password

logging:
  level: info
  output: console
  interval: 20s

```

Launch icingadb daemon:

```shell
daemon -f -o /var/log/icinga2/icingadb.log -p /var/run/icinga2/icingadb.pid -u icinga icingadb -c /usr/local/etc/icinga2/icingadb.yml

```

Check the log **/var/log/icinga2/icingadb.log** if we’re rolling.

# 3. Deploying PHP app

The following instructions assume the location of shared components is _/usr/local/share/icinga-php_, so you need to change the default path by setting the ICINGAWEB\_LIBDIR environment variable. For Apache that’s `SetEnv ICINGAWEB_LIBDIR "/usr/local/share/icinga-php"`.

Install PHP 8.1:

```shell
pkg install php81 php81-bcmath php81-ctype php81-curl php81-dom \
  php81-filter php81-gd php81-gettext php81-iconv php81-intl php81-ldap \
  php81-mbstring php81-mysqli php81-opcache php81-pdo \
  php81-pdo_mysql php81-pdo_pgsql php81-pdo_sqlite php81-pecl-bitset \
  php81-pecl-mcrypt php81-pecl-memcache php81-pecl-memcached \
  php81-pgsql php81-phar php81-posix php81-session php81-simplexml \
  php81-soap php81-sockets php81-sqlite3 php81-xml php81-zlib \
  php81-pear-Services_JSON
mkdir -p /usr/local/share/icinga-php/ipl /usr/local/share/icinga-php/vendor

```

Get the lastest versions of the [IPL](https://github.com/Icinga/icinga-php-library/releases), [thirdparty modules](https://github.com/Icinga/icinga-php-thirdparty/releases), [IcingaWeb](https://github.com/Icinga/icingaweb2/releases), and [icingadb-web](https://github.com/Icinga/icingadb-web/releases), and copy their content:

```shell
cp -r icinga-php-library-x.xx.x/* /usr/local/share/icinga-php/ipl/
cp -r icinga-php-thirdparty-x.xx.x/* /usr/local/share/icinga-php/vendor/
cp -r icingaweb2-x.xx.x/* /usr/local/www/icingaweb2/
mkdir /usr/local/www/icingaweb2/modules/icingadb
cp -r icingadb-web-x.x.x/* /usr/local/www/icingaweb2/modules/icingadb/

```

And now the module can be enabled and configured from IcingaWeb GUI.

---

<div class="post-metadata">

**Author:** ![dlangille](https://community.icinga.com/user_avatar/community.icinga.com/dlangille/32/7113_2.png) [@dlangille](https://community.icinga.com/u/dlangille)\
**Post date:** [September 12, 2023, 1:15pm UTC](https://community.icinga.com/t/icingadb-supported-on-freebsd-ports-packages/10351/5 "2023-09-12T13:15:53Z")

</div>

I have created a FreeBSD port for icingadb and icingadb-web - I am still testing. The works-in-progress are available at [https://github.com/dlangille/ports-wip/tree/main/net-mgmt](https://github.com/dlangille/ports-wip/tree/main/net-mgmt)

They will be added to the FreeBSD ports tree within the next week or two.

---

<div class="post-metadata">

**Author:** ![mrdsam](https://community.icinga.com/user_avatar/community.icinga.com/mrdsam/32/7459_2.png) [@mrdsam](https://community.icinga.com/u/mrdsam)\
**Post date:** [September 19, 2023, 9:35am UTC](https://community.icinga.com/t/icingadb-supported-on-freebsd-ports-packages/10351/6 "2023-09-19T09:35:36Z")

</div>

Hi Matlib,

sorry for not answering for so long.

Thank you for the great valuable input. I managed to get IcingaWeb running on all the systems without using FreeBSD packages. Although there are up-to-date packages now, I’ll stick to this method because things work better with ‘your’ method, e.g. language support. And - I already built an ansible-playbook to roll out IcingaWeb this way.

I didn’t have time to try icingadb yet, but your reply will be a valuable reference of how things actually work.

---

<div class="post-metadata">

**Author:** ![Matlib](https://community.icinga.com/user_avatar/community.icinga.com/matlib/32/4164_2.png) [@Matlib](https://community.icinga.com/u/Matlib)\
**Post date:** [September 22, 2023, 10:25pm UTC](https://community.icinga.com/t/icingadb-supported-on-freebsd-ports-packages/10351/7 "2023-09-22T22:25:43Z")

</div>

Yes, I also prefer to deploy PHP scripts directly from upstream builds, and manually.

Anyway, somebody must have updated these packages because their version is [2.11.4](https://cgit.freebsd.org/ports/tree/net-mgmt/icingaweb2/distinfo) now.
