Network and Server Health Monitoring

Network and Server Health Monitoring

#NetDevOps #Observium #Monitoring

Monitoring is definitely part of Dev-ops and there are many tools for this. In this case I'll concentrate on the open source tools I have got to use before.Just to mention them; Nagios, OpenNMS, Zabbix, Observium ,etc. These are the ones I have mostly played around with among many others i tried like icinga and prtg!

With Observium you get telemetry on Devices, Network ports, temperature sensors mainly and keeps a detailed event log for your environment as well.

So, let me share about Observium and how I implement it in my environments. The Server Host OS I use is Ubuntu 20.04lts and the client hosts can either be Debian/Ubuntu or Centos.

Let's begin! So for prerequisites you could begin by setting up the following:

apt install libapache2-mod-php7.4 php7.4-cli php7.4-mysql php7.4-mysqli php7.4-gd php7.4-json \
php-pear snmp fping mysql-server mysql-client python3-mysqldb rrdtool subversion whois mtr-tiny \
ipmitool graphviz imagemagick apache2 python3-pymysql python-is-python3

For your Mysql:

mysql -u root -p
<mysql root password>
mysql> CREATE DATABASE observium DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
mysql> CREATE USER 'observium'@'localhost' identified by '<db password>';
mysql> GRANT ALL ON observium.* TO 'observium'@'localhost';

The run the Automation Script provided from their repo:

wget http://www.observium.org/observium_installscript.sh
chmod +x observium_installscript.sh
./observium_installscript.sh

Once the installation is successful confirm you cronjob in the following file /etc/cron.d/observium tally with what is pre-configured by the script.

# Run a complete discovery of all devices once every 6 hours
33  */6   * * *   root    /opt/observium/discovery.php -h all >> /dev/null 2>&1

# Run automated discovery of newly added devices every 5 minutes
*/5 *     * * *   root    /opt/observium/discovery.php -h new >> /dev/null 2>&1

# Run multithreaded poller wrapper every 5 minutes
*/5 *     * * *   root    /opt/observium/poller-wrapper.py >> /dev/null 2>&1

# Run housekeeping script daily for syslog, eventlog and alert log
13 5 * * * root /opt/observium/housekeeping.php -ysel >> /dev/null 2>&1

# Run housekeeping script daily for rrds, ports, orphaned entries in the database and performance data
47 4 * * * root /opt/observium/housekeeping.php -yrptb >> /dev/null 2>&1

Ensure your firewall rules for:

ufw allow 80/tcp
ufw allow 161/udp
ufw reload

Agents

Now we go to the other hosts we intend to monitor and do the following configurations:

For Debian / Ubuntu:

wget https://github.com/nabangi/NetDevOps/blob/main/Observium/debian_agent_setup.sh
chmod +x debian_agent_setup.sh
./debian_agent_setup.sh

For Centos:

wget https://github.com/nabangi/NetDevOps/blob/main/Observium/centos_agent_setup.sh
chmod +x centos_agent_setup.sh
./centos_agent_setup.sh

For further configurations and troubleshooting check out the following links which might give you good lead.