# Openindiana Monitoring

**URL:** <https://community.icinga.com/t/openindiana-monitoring/248>\
**Category:** Tutorials and Guides\
**Tags:** build, solaris, icinga2\
**Created:** [January 30, 2019, 12:07pm UTC](https://community.icinga.com/t/openindiana-monitoring/248 "2019-01-30T12:07:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![unixe](https://community.icinga.com/user_avatar/community.icinga.com/unixe/32/73_2.png) [@unixe](https://community.icinga.com/u/unixe)\
**Post date:** [January 30, 2019, 12:07pm UTC](https://community.icinga.com/t/openindiana-monitoring/248/1 "2019-01-30T12:07:57Z")

</div>

# Icinga2 core

~~**+++ THIS SECTION IS STILL UNDER CONSTRUCTION +++ I HAVE TO RE-CHECK IT +++ [BUG](https://www.illumos.org/issues/10169) HITS ME +++**~~

**+++ VERIFIED ON A FRESHLY INSTALLED illumos-022bfefbca +++**

In this howto I’ll try to cover the aspects to get Icinga2 client core up and running on an Openindiana host. I did not take care about database integration, so if you’re willing to use Icinga2 as a master on Openindiana you’re on your own – it’s probably not that complicated, but who knows?

Build process is based on [oi-userland](https://github.com/OpenIndiana/oi-userland), but unfortunately Icinga2 still isn’t a verified component there; I have to few testers to confirm the resulting package as valid 😉 My goal would be to get it in the official oi-userland - meanwhile you

- either have to check out oi-userland and do it on your own or
- you have to checkout **my** fork with icinga2 branch - your choice

So let’s start building the icinga2 package on Openindiana. Use this Howto on your own risk. I wrote it based on `illumos-9b40c3052b`. It’s also tested for `illumos-68d7704518`. I’m running it in production since 02/2018 without any issues, so it might be suitable for you, too.

* * *

### Install some dependencies

You should build your packages as `root` as anything else is just annoying.  
First install some dependencies.

```auto
$ pkg install build-essential boost libyajl2

```

### Preparing Git

Now prepare the environment: you are invited to use my fork on GitHub.

```auto
$ mkdir /scratch
$ cd /scratch
$ git clone https://github.com/sysadmama/oi-userland.git

```

### Local package repository

```auto
$ cd /scratch/oi-userland/components
$ gmake setup

```

Creates `/scratch/oi-userland/i368/repo` for later package installation use.

### Branch icinga2-2.10.2

```auto
$ cd /scratch/oi-userland/
$ git branch -a
* oi/hipster
  remotes/origin/HEAD -> origin/oi/hipster
  remotes/origin/feature_icinga2-2.10.2
  remotes/origin/oi/hipster
  remotes/origin/unleashed
  remotes/origin/upstream
$ git checkout -b icinga2 remotes/origin/feature_icinga2-2.10.2
Branch 'icinga2' set up to track remote branch 'feature_icinga2-2.10.2' from 'origin'.
Switched to a new branch 'icinga2'

```

### Building the package

```auto
$ cd /scratch/oi-userland/components/sysutils/icinga2

```

#### Cleaning up everything

```auto
$ gmake clobber

```

#### Installing required packages and preparing the environment

```auto
$ gmake env-prep
$ gmake prep

```

#### Building the software and creating sample manifest

```auto
$ gmake sample-manifest

```

Now you’re able to `vimdiff` and to update the component manifest if needed – usually it isn’t 😉

#### Generate dependencies

```auto
$ gmake REQUIRED_PACKAGES

```

If not provided at the end of the component Makefile, the list of dependencies should be generated; usually not necessary in our context

#### Tests

```auto
$ gmake test

```

#### Pre-publish

Check if the publication of the component can complete without actually publishing the package to the local repository.

```auto
$ gmake pre-publish

```

#### Publish

Everything was fine? Publish it to your `/scratch/oi-userland/i386/repo` – now you can use it!

```auto
$ gmake publish

```

# Using this userland repo and installing the package

What are the currently used publishers?

```auto
$ pkg publisher
PUBLISHER TYPE STATUS P LOCATION
openindiana.org origin online F http://pkg.openindiana.org/hipster/

```

So we have to add our own repo:

```auto
$ pkg set-publisher -p file:///scratch/oi-userland/i386/repo
## Maybe needed: $ pkg set-publisher --non-sticky openindiana.org
$ pkg publisher
PUBLISHER TYPE STATUS P LOCATION
userland origin online F file:///scratch/oi-userland/i386/repo/
openindiana.org origin online F http://pkg.openindiana.org/hipster/

```

And when new builded packages are ready, refresh repo:

```auto
$ pkgrepo refresh -s /scratch/oi-userland/i386/repo/
$ pkgrepo rebuild -s /scratch/oi-userland/i386/repo/

```

And now: install the package!

```auto
$ pkg search icinga2
$ pkg install icinga2
$ pkg info icinga2
          Name: system/monitoring/icinga2
       Summary: Icinga 2 - An open source host and network monitoring system
      Category: Applications/System Utilities
         State: Installed
     Publisher: userland
       Version: 2.10.2
        Branch: 2018.0.0.0
Packaging Date: January 16, 2019 at 08:06:11 AM
          Size: 367.47 MB
          FMRI: pkg://userland/system/monitoring/icinga2@2.10.2-2018.0.0.0:20190116T080611Z
   Project URL: https://github.com/icinga
    Source URL: https://github.com/Icinga/icinga2/archive/v2.10.2.tar.gz

```

With `icinga2.xml` I deliver a basic version for SVC. Let’s check ist.

```auto
$ svcs icinga2
STATE STIME FMRI
disabled 11:44:29 svc:/application/monitoring/icinga2:default

```

Disabled means: this service is not running. So let’s enable it.

```auto
$ svcadm enable icinga2
$ svcs icinga2
STATE STIME FMRI
online Jan_24 svc:/application/monitoring/icinga2:default

```

If you encounter issues when starting your daemon, take a look at the logfiles stored in `/var/svc/log` – try `tail -f application-monitoring-icinga2\:default.log`

* * *

# Building the check plugins

I found no way to get the check plugins into `oi-userland`, and I tried several times… spending enough time and with help from the mailing list it probably would be possible, but I didn’t follow this approach. So what I do it to build the `nagios-plugins` completely by hand. But as you’ll see: this is not hard at all.

### Wait - what? nagios-plugins?

I know the wars of `monitoring-plugins` vs. `nagios-plugins`, but I’m not interested in that. In fact, it’s not possible to compile `monitoring-plugins` on OpenSolaris Hipster without accident. As I am not an developer – I can’t fix the source to get it running and it’s not my job – I decided to use a working alternative. Feel free to do it your way.

### Getting source

Obtain latest source tarball, unpack and prepare it.

```auto
$ cd /usr/src
$ wget https://nagios-plugins.org/download/nagios-plugins-2.2.1.tar.gz
$ tar xvfz nagios-plugins-2.2.1.tar.gz
$ cd nagios-plugins-2.2.1

```

### configure and build

Use a `prefix` you prefer – in fact there’s no need to have `nagios` in that `PATH`, but I usually keep it due to historical reasons.

```auto
$ ./configure \
--with-nagios-user=icinga \
--with-nagios-group=icinga \
--prefix=/usr/lib/nagios/plugins \
--libexecdir=/usr/lib/nagios/plugins \
--enable-perl-modules
$ gmake
$ gmake install && gmake install-root

```

And that’s it! 🙂 The plugins are installed under `/usr/lib/nagios/plugins` as known from other systems, and they’re ready to use.

---

<div class="post-metadata">

**Author:** ![denyka](https://community.icinga.com/user_avatar/community.icinga.com/denyka/32/3386_2.png) [@denyka](https://community.icinga.com/u/denyka)\
**Post date:** [June 8, 2021, 10:34am UTC](https://community.icinga.com/t/openindiana-monitoring/248/2 "2021-06-08T10:34:29Z")

</div>

This doc doesn’t work due to missed /scratch/oi-userland/components/sysutils/icinga2 directory and not exists branch remotes/origin/feature\_icinga2-2.10.2  
GitHub repo was moved to [https://github.com/OpenIndiana/oi-userland.git](https://github.com/OpenIndiana/oi-userland.git) and all branches from the old GitHub repo were removed/merged.

Could you update your HowTo to valid state?
