Learn about Icinga2 | Agentless Monitoring Tools

We’ll share about Icinga2 and how to implement Icinga2

Btech Engineering
btech-engineering
4 min readOct 28, 2022

--

https://icinga.com/

Icinga is a monitoring system which checks the availability of your network resources, notifies users of outages, and generates performance data for reporting.​​

https://icinga.com/docs/

Introduction

Using Icinga we can monitoring complex and large multiple location environment or cluster. Icinga is agentless monitoring tools because he directly communicate to monitoring server for show data reporting. If the remote services are not directly accessible through the network, a local agent installation exposing the results to check queries can become handy. Icinga2 support on many various operating system, for more detail you can see on official documentation here. But in this article we tried to use Icinga2 in Ubuntu Server.

Installation icinga2 agent-based monitoring

https://icinga.com/docs/icinga-2/latest/doc/07-agent-based-monitoring/

It’s Simple Explanation about Agentless and Agent-Based

Agent-based solutions require you to install code on the system being monitored in order to capture the desired information; while agentless solutions communicate directly with API’s that provide rich information about the resources being monitored.

https://opscompass.com/resources/blog/agent-based-or-agent-less-which-is-better

Agentless VS Agent-Based

Icinga2 Basic Component

https://icinga.com/docs/icinga-2/latest/doc/02-installation/02-Ubuntu/
  • Icinga 2 with its icingadb feature enabled, responsible for publishing monitoring data to a Redis server, i.e. configuration and its runtime updates, check results, state changes, downtimes, acknowledgements, notifications, and other events such as flapping​
  • The Icinga DB daemon, which synchronizes the data between the Redis server and a database​
  • And Icinga Web with the Icinga DB Web module enabled, which connects to both Redis and the database to display and work with the most up-to-date data

Icinga2 Installation & Preview

For more detail step of installation, you can see on his documentation in here. But in this section we’ll show outline step of installation Icinga2

Installation Steps

  • Setup package repository for icinga​
apt-get update
apt-get -y install apt-transport-https wget gnupg

wget -O - https://packages.icinga.com/icinga.key | apt-key add -

. /etc/os-release; if [ ! -z ${UBUNTU_CODENAME+x} ]; then DIST="${UBUNTU_CODENAME}"; else DIST="$(lsb_release -c| awk '{print $2}')"; fi; \
echo "deb https://packages.icinga.com/ubuntu icinga-${DIST} main" > \
/etc/apt/sources.list.d/${DIST}-icinga.list
echo "deb-src https://packages.icinga.com/ubuntu icinga-${DIST} main" >> \
/etc/apt/sources.list.d/${DIST}-icinga.list

apt-get update
  • Install and setup icinga2
apt-get install icinga2
systemctl status icinga2

apt-get install monitoring-plugins

icinga2 api setup
systemctl restart icinga2

# Check user and password
cat /etc/icinga2/conf.d/api-users.conf
  • Install and setup icingaDB
apt-get install icingadb
apt-get install mysql-server

# Create databases for icingaDB
mysql -u root -p

CREATE DATABASE icingadb;
CREATE USER 'icingadb'@'localhost' IDENTIFIED BY '{password}';
GRANT ALL ON icingadb.* TO 'icingadb'@'localhost';

# Import schema
mysql -u root -p icingadb </usr/share/icingadb/schema/mysql/schema.sql

# Configure icingadb
vi /etc/icingadb/config.yml
...
# Database password.
password: {password}
...

systemctl enable --now icingadb
systemctl restart icingadb
systemctl status icingadb

icinga2 feature enable icingadb

systemctl restart icinga2
  • Setup Redis Server
apt-get install icingadb-redis

systemctl enable --now icingadb-redis-server

# Configure redis server
vi /etc/icingadb-redis/icingadb-redis.conf
...
# Set protected-mode to no, i.e. protected-mode no
# Set bind to the desired binding interface or bind all interfaces, e.g. bind 0.0.0.0
...

systemctl restart icingadb-redis
  • Install IcingaDB web
apt-get install icingadb-web
  • Setup icinga2 web
apt-get install icingaweb2 libapache2-mod-php icingacli php-pgsql
icingacli setup config webserver nginx --document-root /usr/share/icingaweb2/public

icingacli setup token create
icingacli setup token show

# Create database for icingaweb2
mysql -u root -p

CREATE DATABASE icingaweb2;
CREATE USER 'icingaweb2'@'localhost' IDENTIFIED BY '{password}';
GRANT ALL ON icingaweb2.* TO 'icingaweb2'@'localhost';

# Start web setup
http://{IP_ADDRESS}/icingaweb2/setup
  • Initial setup in icingaweb

After installation are done, you can access Icinga2 web on your browser

https://<ip_address>/icingaweb2

Icinga2 web login page
Dashboard on Icinga2

Icinga addition components

  • Icinga Director will manage your monitoring configuration through the web interface and automate it​
  • Icinga Modules will extend Icinga with custom views, reports, business processes and more features​
  • Icinga Plugins will search through thousands of plugins that you can use to monitor your entire infrastructure. ​

What’s Next

You can see example tools about agent-based monitoring in separate article here.

Sources

By Razzaaq Arditian — Research Team

Our Tagline

# Together is Better & Continuous Learning

--

--

Btech Engineering
btech-engineering

Our mission is continuous learning and remember together is better.