Monitoring Tools – TecAdmin https://tecadmin.net How to guide for System Administrator's and Developers Tue, 04 Oct 2022 09:43:49 +0000 en-US hourly 1 https://wordpress.org/?v=6.1.1 How to Install Nagios Client (NRPE) on Ubuntu 20.04 https://tecadmin.net/how-to-install-nrpe-on-ubuntu-20-04/ https://tecadmin.net/how-to-install-nrpe-on-ubuntu-20-04/#comments Fri, 04 Jun 2021 13:06:05 +0000 https://tecadmin.net/?p=25564 NRPE is a client side application for executing Nagios plugins. The Nagios server communicate with remote system using this plugin. NRPE must be installed on all the remote systems needs to monitor by Nagios server. Nagios server sends instruction to the NRPE server using check_nrpe plugin. In our previous tutorial, you have leaned about to [...]

The post How to Install Nagios Client (NRPE) on Ubuntu 20.04 appeared first on TecAdmin.

]]>
NRPE is a client side application for executing Nagios plugins. The Nagios server communicate with remote system using this plugin. NRPE must be installed on all the remote systems needs to monitor by Nagios server. Nagios server sends instruction to the NRPE server using check_nrpe plugin.

In our previous tutorial, you have leaned about to install Nagios server on a Ubuntu 20.04 LTS system.

Installing NRPE on Ubuntu 20.04

Read more:
How to Monitor Remote Linux System with Nagios
How to Monitor Remote Linux System over SSH  

This guide will help you to install NRPE on Ubuntu 20.04 LTS Linux systems.

Step 1 – Install Nagios Client on Ubuntu

NRPE packages are available under the default repositories on Ubuntu systems. Open a terminal and run the following command to install:

sudo apt update 
sudo apt install nagios-nrpe-server nagios-plugins 

Here nagios-nrpe-server package install service on system and nagios-plugins provides monitoring scripts, which is called with NRPE client on request of Nagios server.

Step 2 – Configure Nagios Client

In NRPE configuration, first we need to nrpe to which nagios servers it accepts requests, For example your Nagios server IP is 192.168.1.100, then add this IP to allowed hosts list. Edit NRPE configuration file /etc/nagios/nrpe.cfg and make the necessary changes like below:

sudo nano /etc/nagios/nrpe.cfg 
 allowed_hosts=127.0.0.1, 192.168.1.100

We can allow multiple Nagios servers by a comma-separated list.

Next, restart NRPE service. Now it is ready to listen to requests from Nagios server

sudo systemctl restart nagios-nrpe-server 

Step 3 – Verify Connection from Nagios

Let’s verify the connection between the Nagios server and NRPE client machine. Login to your Nagios server and check the Nagios server can communicate with NRPE service properly.

Use check_nrpe command on the Nagios server under the plugins directory. The command will be like as below here 192.168.1.11 is the IP address of client machine.

check_nrpe -H 192.168.1.11 

NRPE v4.0.0

The output “NRPE v2.15” shows that the Nagios server successfully communicated with NRPE.

Step 4 – Update Command Definitions for NRPE

You must have define all the commands to be used by Nagios server. Some of them are pre-configured with the installation. You may required to change command definitions as per your system’s configuration. Also, you can add more customized commands to monitor your server.

Edit the /etc/nagios/nrpe.cfg configuration file and search for COMMAND DEFINITIONS secitons. Here you can define or update check commands.

sudo nano /etc/nagios/nrpe.cfg 
/etc/nagios/nrpe.cfg
command[check_users]=/usr/lib/nagios/plugins/check_users -w 5 -c 10
command[check_load]=/usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20
command[check_hda1]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hda1
command[check_zombie_procs]=/usr/lib/nagios/plugins/check_procs -w 5 -c 10 -s Z
command[check_total_procs]=/usr/lib/nagios/plugins/check_procs -w 150 -c 200

Save the configuration file and restart NRPE daemon to apply changes:

sudo systemctl restart nagios-nrpe-server 

All done.

Step 5 – Adjust Firewall

The default NRPE service listen on port 5666. Use the following commands to open firewall port for NRPE service.

sudo firewall-cmd --permanent --zone=public --add-port=5666/tcp  
sudo firewall-cmd --reload  

Conclusion

This tutorial describes you the steps to install NRPE client on Ubuntu system. Also provides you instructions to add check command definitions.

The post How to Install Nagios Client (NRPE) on Ubuntu 20.04 appeared first on TecAdmin.

]]>
https://tecadmin.net/how-to-install-nrpe-on-ubuntu-20-04/feed/ 2
How to Install Nagios Server on Ubuntu 20.04 https://tecadmin.net/how-to-install-nagios-server-on-ubuntu-20-04/ https://tecadmin.net/how-to-install-nagios-server-on-ubuntu-20-04/#respond Thu, 03 Jun 2021 01:30:06 +0000 https://tecadmin.net/?p=25404 Nagios Core formally known as Nagios is an open source infrastructure monitoring system. The Nagios application periodically checks on critical parameters of the application, server and network resources. For example, Nagios server can monitor CPU load, disk space, memory usage, the number of currently running processes on a remote server. Also sends warning, critical or [...]

The post How to Install Nagios Server on Ubuntu 20.04 appeared first on TecAdmin.

]]>
Nagios Core formally known as Nagios is an open source infrastructure monitoring system. The Nagios application periodically checks on critical parameters of the application, server and network resources. For example, Nagios server can monitor CPU load, disk space, memory usage, the number of currently running processes on a remote server. Also sends warning, critical or recovery notifications to the responsible persons over email, sms etc.

Nagios core is freely freely available from the official sites to deploy on your servers. In this tutorial, we will describe you the steps to install and configure Nagios server on a Ubuntu 20.04 LTS system.

Step 1 – Installing Apache

Apache is the popular web server required to serve Nagios web pages. The following commands will help you to install or upgrade Apache web server on your Ubuntu system.

sudo apt update 
sudo apt install apache2 

Nagios configuration required two Apache modules od_authz_groupfile and mod_auth_digest, which is not enabled by default. Execute the following command to enable reqiored modules.

sudo a2enmod authz_groupfile auth_digest 

Here mod_authz_groupfile extends the authorization types with group and group-file. And auth_digest is used for user authentication using MD5 Digest Authentication.

Step 2 – Installing Nagios on Ubuntu 20.04

Nagios 4 stable version is available in the default Ubuntu software repositories. At the time of writing, Nagios version 4.3.4 available for Ubuntu 20.04 systems.

Run the following commands as sudo privileged account to install Nagios on Ubuntu system.

sudo apt update 
sudo apt install nagios4 nagios-nrpe-plugin nagios-plugins-contrib 

The command above will install a bunch of packages, including Nagios Core, Nagios Plugins, and Apache.

Step 3 – Configure Nagios Authentication

Next follow the below instructions to configure Apache and Nagios authorization.

Create nagiosadmin User – Create a Nagios user with name “nagiosadmin” to grant administrative privileges. Make sure to keep username as it is. Use htdigest command to create a new user:

sudo htdigest -c /etc/nagios4/htdigest.users Nagios4 nagiosadmin 

Enter password and confirm password:

Adding password for nagiosadmin in realm Nagios4.
New password:
Re-type new password:

Configure Apache – Edit Nagios4 Apache configuration file and comment / un-comment few lines describes below. This will allow Nagios server to access from public network.

sudo nano /etc/apache2/conf-enabled/nagios4-cgi.conf 
  1. Comment Require IP line
  2. Files start and closing tag only
  3. Comment “Required all granted”
  4. Uncomment “Require valid-user”

Nagios4 Enable Remote Access

Configure Nagios4 CGI Authentication – Next edit the /etc/nagios4/cgi.cfg configuration file and set use_authentication to 1. This option controls whether or not the CGIs will use any authentication when displaying host and service information, as well as committing commands to Nagios for processing.

sudo nano /etc/nagios4/cgi.cfg 
use_authentication=1

Once you make all necessary changes, apply them by restarting the Apache and Nagios4 services.

sudo systemctl restart apache2 
sudo systemctl restart nagios4 

That’s it. You have completed all the required settings.

Step 4 – Access Nagios Web Interface

You can access nagios web interface using the server IP address or domain pointed to that server. The installer creates a Apache configuration file for nagios. You can access Nagios at a sub url as “/nagios4”.

http://server_domain_or_ip/nagios4

You will be prompted to inter username and password. Enter the “nagiosadmin” user credentials to access Nagios web page.

Installing nagios on Ubuntu 20.04

Conclusion

This tutorial helped you to install Nagios server on Ubuntu systems. Follow our next tutorial to add host to monitor through Nagios server.

The post How to Install Nagios Server on Ubuntu 20.04 appeared first on TecAdmin.

]]>
https://tecadmin.net/how-to-install-nagios-server-on-ubuntu-20-04/feed/ 0
How to Install Netdata Monitoring Tool on Ubuntu 20.04 https://tecadmin.net/how-to-install-netdata-on-ubuntu-20-04/ https://tecadmin.net/how-to-install-netdata-on-ubuntu-20-04/#respond Fri, 25 Dec 2020 04:39:34 +0000 https://tecadmin.net/?p=24252 Netdata is an open source tool designed for the real-time system performance monitoring solution. It collects real-time metrics for system activities like CPU uses, memory uses, bandwidth uses and disk activities etc. And displays the information on web interface with graphical charts. Netdata official team recommend to install netdata monitoring tool using the kickstart script. [...]

The post How to Install Netdata Monitoring Tool on Ubuntu 20.04 appeared first on TecAdmin.

]]>
Netdata is an open source tool designed for the real-time system performance monitoring solution. It collects real-time metrics for system activities like CPU uses, memory uses, bandwidth uses and disk activities etc. And displays the information on web interface with graphical charts.

Netdata official team recommend to install netdata monitoring tool using the kickstart script. But this tutorial will help you to install Netdata on Ubuntu using default repositories.

This tutorial describe you to how to install Netdata on Ubuntu 20.04 LTS Linux system.

Prerequisites

Login to your Ubuntu 20.04 LTS Linux system with sudo privileged account.

Install Netdata on Ubuntu

Ubuntu 20.04 default apt repositories contains Netdata Debian packages. You can install netdata on Ubuntu by running the following commands.

sudo apt update 
sudo apt install netdata 

Press ‘y’ if confirmation prompted by the installer.

Next, edit netdata configuration file in your favorite text editor.

sudo vim /etc/netdata/netdata.conf 

The default “bind socket to IP” is set to 17.0.0.1. This is fine for access netdata on local system. To enable access from remote system update this with your systems IP address.

[global]
    run as user = netdata
    web files owner = root
    web files group = root
    bind socket to IP = 172.30.2.38

Save your file and restart netdata service.

sudo systemctl restart netdata 

All done, you have successfully installed Netdata on a Ubuntu system.

Access Netdata Web Interface

The default netdata works on port 19999. Open web browser on your system and connect on port 19999 to systems ip address.

http://172.30.2.38:19999

You will see the Netdata dashboard with detailed statics about the system.

View the various graphical statics by clicking on links in right side bar.

Conclusion

This tutorial helped you to install Netdata monitoring solutions on a Ubuntu system. Read another guide Linux system and performance monitoring tool.

The post How to Install Netdata Monitoring Tool on Ubuntu 20.04 appeared first on TecAdmin.

]]>
https://tecadmin.net/how-to-install-netdata-on-ubuntu-20-04/feed/ 0
How to Install and Configure Sysstat on Ubuntu 20.04 https://tecadmin.net/how-to-install-sysstat-on-ubuntu-20-04/ https://tecadmin.net/how-to-install-sysstat-on-ubuntu-20-04/#respond Tue, 28 Jul 2020 09:37:33 +0000 https://tecadmin.net/?p=22199 Sysstat is a powerful system performance monitoring tool written in C language. This is the best tool I found for the debugging of performance issues on my Linux systems. You can view the system performance data in real time or analyze data from the saved archives. Sysstat is an opensource and freely available tool. This [...]

The post How to Install and Configure Sysstat on Ubuntu 20.04 appeared first on TecAdmin.

]]>
Sysstat is a powerful system performance monitoring tool written in C language. This is the best tool I found for the debugging of performance issues on my Linux systems. You can view the system performance data in real time or analyze data from the saved archives. Sysstat is an opensource and freely available tool. This tutorial will help you to install Sysstat package on your system and monitor Linux system performance.

Sysstat Utilities

The sysstat package provides a number of utilities for collecting the system use activities and system performance.

  • iostat – Used for CPU statistics and input/output statistics for the block devices and partitions and generate report.
  • mpstat – Used for processor related statistics and reports.
  • pidstat – Used for I/O, CPU, memory statistics for Linux processes and generate report.
  • tapestat – Used for the statistics for tape drives attached to Linux system.
  • cifsiostat – Used for generating reports CIFS statistics.
  • sar – Used for collects and saves all the system activities and report.

Step 1 – Install Sysstat on Ubuntu

Sysstat package is available in default package repositories, You can install using the following commands. But the default repositories have older version of packages. So we recommend to use installation with source in next step. If you still want to use package manager just run below commands.

sudo apt install sysstat -y

Step 2 – Configure Sysstat

By default Sysstat monitoring is disabled. To enable the sysstat monitoring, edit the configuration file in text editor:

You need to Let’s enable the sysstat monitoring. Edit the following file and save it.

sudo vim /etc/default/sysstat

Set ENABLED to true as below:

ENABLED="true"

Save file and close it.

After enabling the monitoring, enable the sysstat service and start it by executing:

sudo systemctl enable sysstat
sudo systemctl start sysstat

Step 3 – Realtime Monitoring with Sysstat

You can get real time system static with sar command line tool. Below is some about various static to view on command line.

  • Current CPU Usage – Use -u with the sar command to view realtime cpu statics
    sar -u
    

    You can also view the real-time CPU uses by specifying the time interval and number of times to show data. For example, to view real-time CPU uses for 5 times with the difference of 1 second.

    sar -u 1 5
    

    You can view the CPU utilization data in more depth. Nowadays most of the CPU’s are multi-core. To view utilization details of each core individually use -P ALL command.

    sar -P ALL 1 3
    
  • View Device Usage – Use the iostat command to find disk statics. It shows the current data transfer per second, the total number of blocks read and write to disk and an average block per seconds.
    iostat -d 1 5 
    

    Details:

    • tps – Transfers per second.
    • Blk_read/s – Total amount of data read in blocks per second.
    • Blk_wrtn/s – Total amount of data written in blocks per second.
    • Blk_read – Total blocks read.
    • Blk_wrtn – Total blocks written.

    You can view more extended I/O statics of disk using the following command.

    iostat -x 1 5 
    
  • View Running Process Resource Utilization – Using pidstat command with switch -d provides you details of currently running processes on systems.
    pidstat -d
    

    Also try pidstat with -r to show resource utilization by processes on every 1 second for the 5 times.

    pidstat -r 1 5
    
  • Memory Utilization Data – Use sar command with -r to view the current memory utilization details for the 5 times on every 1 second.
    sar -r 1 5
    

Step 4 – View Historical Data with Sysstat

Sysstat also store monitoring data in files. You can also see the historical data with the sar command. By default it keeps 7 days of data bu you can change the number of days in /etc/sysstat/sysstat file.

HISTORY=28

All the log files are stored under /var/log/sysstat directory. The filenames will be as sa1, sa2 and so on, here 1 and 2 is the date of current month.

For example to view memory utilization report of date 15’th of current month, type:

sar -r -f /var/log/sysstat/sa15

Here we provide the file of reqired date with -f option to view historic sar data.

View historic data with sar command

You can also specified time range with the above command to view static between given time only. To view static between 7:00AM and 8:00AM, type:

sar -r  -f /var/log/sysstat/sa15 -s 07:00:00 -e 08:00:00

Similarly, you can use following command to view CPU utilization data of any date with sar command.

sar -u  -f /var/log/sysstat/sa28

Conclusion

In this tutorial, you have learned to install and configure sysstat performance monitoring utility on your Ubuntu 20.04 system.

The post How to Install and Configure Sysstat on Ubuntu 20.04 appeared first on TecAdmin.

]]>
https://tecadmin.net/how-to-install-sysstat-on-ubuntu-20-04/feed/ 0
How To Install Zabbix Server 5.0 on Ubuntu 20.04 https://tecadmin.net/how-to-install-zabbix-server-on-ubuntu-20-04/ https://tecadmin.net/how-to-install-zabbix-server-on-ubuntu-20-04/#comments Thu, 23 Jul 2020 03:36:41 +0000 https://tecadmin.net/?p=21975 Zabbix is a free and open-source monitoring solution designed for real-time monitoring of servers, virtual machines, networks, and cloud services. It was developed by Alexei Vladishev and actively supported by Zabbix SIA. It is based on the client-server model and capable of monitoring millions of metrics, such as CPU load, network utilization and disk space [...]

The post How To Install Zabbix Server 5.0 on Ubuntu 20.04 appeared first on TecAdmin.

]]>
Zabbix is a free and open-source monitoring solution designed for real-time monitoring of servers, virtual machines, networks, and cloud services. It was developed by Alexei Vladishev and actively supported by Zabbix SIA. It is based on the client-server model and capable of monitoring millions of metrics, such as CPU load, network utilization and disk space consumption from tens of thousands of servers.

In this tutorial, we will explain how to install Zabbix server on Ubuntu 20.04 LTS system.

Pre-Requsities

We assume you have a running Ubuntu 20.04 system with sudo privileged account access. Follow the below steps to install Zabbix server on your Ubuntu system.

Step 1 – Setup LAMP

Zabbix required PHP programming language to run, MySQL as database server and a Web server like Apache or Nginx. We use Apache web server for this tutorial. Let’s have the installation of all the required packages on your system by running the following commands.

sudo apt update
sudo apt install apache2 libapache2-mod-php
sudo apt install mysql-server
sudo apt install php php-mbstring php-gd php-xml php-bcmath php-ldap php-mysql

Next, you need to set a strong password for the MySQL root user. Execute the below command and follow the instructions. After completing below command, you will have a password for the root account of MySQL database server.

sudo mysql_secure_installation

You update the PHP configuration variables. Edit the PHP configuration file /etc/php/7.4/apache2/php.ini for Apache and update timezone as per your requirements.

vim /etc/php/7.4/apache2/php.ini
memory_limit 256M
upload_max_filesize 16M
post_max_size 16M
max_execution_time 300
max_input_time 300
max_input_vars 10000
date.timezone = 'Asia/Kolkata'

Step 2 – Configure Zabbix Repository

Zabbix offical team provides Apt package repositories for the Debian based system. Use the following commands to add the repository on your Ubuntu system.

wget https://repo.zabbix.com/zabbix/5.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_5.0-1+focal_all.deb
sudo dpkg -i zabbix-release_5.0-1+focal_all.deb

Step 3 – Installing Zabbix Server

Once you added the Apt repository, use the following commands to install Zabbix server packages. Here zabbix-server-mysql package includes Zabbix server with MySQL support. The zabbix-frontend-php package provides the web interface for Zabbix server.

sudo apt update
sudo apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent zabbix-apache-conf

Step 4 – Create Zabbix Database and User

Next, create a database schema for the Zabbix server. Login to the MySQL server with the root account and create MySQL database and user with the following commands.

mysql -u root -p

CREATE DATABASE zabbixdb character set utf8 collate utf8_bin;
CREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON zabbixdb.* TO 'zabbix'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;

After creating the database, load the default schema of Zabbix of database.

cd /usr/share/doc/zabbix-server-mysql
zcat create.sql.gz | mysql -u zabbix -p zabbixdb

Step 5 – Update Zabbix Configuration

Edit Zabbix server configuration file /etc/zabbix/zabbix_server.conf in your favorite text editor and update the following database configurations. This will be used by Zabbix server to connect to the database.

sudo vi /etc/zabbix/zabbix_server.conf
  DBHost=localhost
  DBName=zabbixdb
  DBUser=zabbix
  DBPassword=password

Now, enable the Zabbix serivce to start on system boot and restart service to reload new settings.

sudo systemctl enable zabbix-server
sudo systemctl restart zabbix-server

The Zabbix packages also creates its own Apache configuration file ie /etc/zabbix/apache.conf and make a link to Apache configuration directory. Let’s use the following command to restart Apache service.

sudo systemctl restart apache2

Now your system is ready for the Zabbix installation. Just go to the Zabbix web installer and finish the installation.

Step 6 – Adjust Firewall for Zabbix

Next, you will need to allow the Zabbix ports 10050 and 10051. and HTTP service through firewalld. You can allow them with the following command:

sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-port=10050/tcp
sudo firewall-cmd --permanent --add-port=10051/tcp

Now, reload the firewalld service to implement the changes:

sudo firewall-cmd --reload

Step 7 – Running Zabbix Web Installer

Zabbix web installer can be accessed on /zabbix subdirectory URL on your servers IP or domain. For example, host.tecadmin.net is pointed to my Zabbix server. Now access the Zabbix using the following URL. You must change FQDN as per your setup.

https://server.tecadmin.net/zabbix/

And follow the steps as per given screenshots below.

Now, open your favorite web browser and type the URL http://your-server-ip/zabbix. You will be redirected to the Zabbix web installation wizard in the following screen:

Zabbix Installer welcome Ubuntu 20.04

Click on the Next step button. You should see the following page:

Make sure all the requirements are fulfulls by the server. Then click on the Next step button. You should see the following page:

Provide your database credentials created in above steps and click on the Next step button. You should see the following page:

Provide your Zabbix server details and click on the Next step button. You should see the following page:

Make sure all the configuration parameters are correct then click on the Next step button. Once the installation has been completed successfully, you should see the following page:

Click on the Finish button. You will be redirected to the Zabbix login page as shown below:

Use below credentials to login:

Username: Admin
Password: zabbix

After successful loign, you will see the Zabbix dashbaord as below screenshot.

Conclusion

Congratulations! you have successfully installed the Zabbix server on Ubuntu 20.04 LTS system. You can now start exploring the Zabbix dashboard for more details and add the client for monitoring.

The post How To Install Zabbix Server 5.0 on Ubuntu 20.04 appeared first on TecAdmin.

]]>
https://tecadmin.net/how-to-install-zabbix-server-on-ubuntu-20-04/feed/ 6
How To Install Zabbix Agent on Ubuntu 20.04 https://tecadmin.net/how-to-install-zabbix-agent-on-ubuntu-20-04/ https://tecadmin.net/how-to-install-zabbix-agent-on-ubuntu-20-04/#comments Sun, 12 Jul 2020 16:14:14 +0000 https://tecadmin.net/?p=21973 Zabbix is an monitoring solutions for your IT infrastructure. You can monitor most of the devices in your network and most of the services on your servers. To monitor applications, You must have a Zabbix server installed in your network. Zabbix Agent is required on the systems, you need to monitor through the Zabbix server. [...]

The post How To Install Zabbix Agent on Ubuntu 20.04 appeared first on TecAdmin.

]]>
Zabbix is an monitoring solutions for your IT infrastructure. You can monitor most of the devices in your network and most of the services on your servers. To monitor applications, You must have a Zabbix server installed in your network.

Zabbix Agent is required on the systems, you need to monitor through the Zabbix server. This tutorial will help you to install Zabbix Agent on Ubuntu 20.04 LTS Linux system.

Requirements

You must have shell access with sudo privileged account access to your Ubuntu 20.04 LTS system.

Step 1 – Configure Zabbix Repository

The Zabbix team provides apt repositories for the installation of Zabbix packages. Then add the repository to your system, which is required packages for Zabbix agent. Run the following commands to enable Zabbix repositories.

wget https://repo.zabbix.com/zabbix/5.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_5.0-1+focal_all.deb
sudo dpkg -i zabbix-release_5.0-1+focal_all.deb

Step 2 – Install Zabbix Agent on Ubuntu

As you have successfully added Zabbix apt repositories in your system let’s use the following command to install Zabbix agent using the following command.

sudo apt update
sudo apt install zabbix-agent

The Zabbix Agent is installed on your system.

Next, you need to configure Zabbix agent to allow connection from your Zabbix server. For example, your Zabbix server is running with 192.168.10.254 IP address. To update this, edit Zabbix agent configuration file /etc/zabbix/zabbix_agentd.conf:

sudo nano /etc/zabbix/zabbix_agentd.conf

And update below settings:

#Server=[zabbix server ip]
#Hostname=[Hostname of client system ]

Server=192.168.10.254
Hostname=Server2

Save your file and close it.

Step 3 – Manage Zabbix Service

Now, restart Zabbix service to apply changes. Also enable service to auto start on system boot. Run the following commands to restart and enable Zabbix agent service.

sudo systemctl restart zabbix-agent
sudo systemctl enable zabbix-agent 

The following commands are used to stop and status of Zabbix-agent service:

sudo systemctl stop zabbix-agent 
sudo systemctl status zabbix-agent

Conclusion

In this tutorial, you have learned to install Zabbix Agent service on Ubuntu 20.04 system.

The post How To Install Zabbix Agent on Ubuntu 20.04 appeared first on TecAdmin.

]]>
https://tecadmin.net/how-to-install-zabbix-agent-on-ubuntu-20-04/feed/ 4
How To Install Zabbix Server on CentOS/RHEL 8 https://tecadmin.net/install-zabbix-server-centos-8/ https://tecadmin.net/install-zabbix-server-centos-8/#comments Sun, 02 Feb 2020 08:25:14 +0000 https://tecadmin.net/?p=20184 Zabbix is a free and open-source monitoring solution designed for real-time monitoring of servers, virtual machines, networks, and cloud services. It was developed by Alexei Vladishev and actively supported by Zabbix SIA. It is based on the client-server model and capable of monitoring millions of metrics, such as CPU load, network utilization and disk space [...]

The post How To Install Zabbix Server on CentOS/RHEL 8 appeared first on TecAdmin.

]]>
Zabbix is a free and open-source monitoring solution designed for real-time monitoring of servers, virtual machines, networks, and cloud services. It was developed by Alexei Vladishev and actively supported by Zabbix SIA. It is based on the client-server model and capable of monitoring millions of metrics, such as CPU load, network utilization and disk space consumption from tens of thousands of servers.

Features

  • Supports MySQL, SQLite, PostgreSQL and IBM DB2.
  • Monitor different system matrics including, Memory, CPU, Disk, Process.
  • Monitor network devices, hardware, virtual machines, VMware hypervisor and VMware vCenter.
  • Supports multiple authentication methods like, LDAP and Active Directory.
  • Provide Notification through Email.
  • Auto-discovery and automated metric collections.
  • Distributed monitoring.

In this tutorial, we will explain how to install and configure the Zabbix monitoring server on CentOS 8 and RHEL 8.

Step 1 – Disable SELinux

By default, SELinux is enabled in CentOS 8. It is a good idea to disable the SELinux to work Zabbix properly.

You can disable the SELinux by editing /etc/selinux/config file:

nano /etc/selinux/config

Change the following line:

SELINUX=disabled

Save and close the file when you are finished then restart your system to reflect the changes.

Step 2 – Install LAMP Server

First, you will need to install the Apache webserver, MariaDB database server, PHP and other required PHP extension to your system.

Run the following command to install all the packages:

dnf install -y httpd mariadb-server php php-cli php-common php-mbstring php-mysqlnd php-xml php-bcmath php-devel php-pear php-gd

Once the installation is completed, open php.ini file and tweak some settings:

nano /etc/php.ini

Change the following values as per your requirements:

memory_limit 256M
upload_max_filesize 16M
post_max_size 16M
max_execution_time 300
max_input_time 300
max_input_vars 10000
date.timezone = Asia/Kolkata

Save and close the file then start the Apache and MariaDB service and enable them to start after system reboot with the following command:

systemctl start httpd
systemctl start mariadb
systemctl enable httpd
systemctl enable mariadb

Step 3 – Configure MariaDB Database

By default, the MariaDB server is not secured in the CentOS 8. Run the following command to secure the MariaDB:

mysql_secure_installation 

This script will set the MariaDB root password, remove anonymous users, disallow root login remotely and remove test database as shown below:

Enter current password for root (enter for none): Press Enter
Set root password? [Y/n] Y
New password: 
Re-enter new password: 
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y

Once the MariaDB is secured, log in to MariaDB shell with the following command:

mysql -u root -p

After login, create a database and user for Zabbix with the following command:

MariaDB [(none)]> CREATE DATABASE zabbix CHARACTER SET utf8 collate utf8_bin;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@localhost IDENTIFIED BY 'zabbixpassword';

Next, flush the privileges and exit from the MariaDB shell with the following command:

MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;

Step 4 – Install Zabbix Server

Before installing Zabbix, you will need to install the libssh2 library required by Zabbix to your system. You can install it with the following command:

dnf install -y http://mirror.centos.org/centos/8.0.1905/AppStream/x86_64/os/Packages/libssh2-1.8.0-8.module_el8.0.0+189+f9babebb.1.x86_64.rpm

By default, Zabbix is not available in the CentOS 8 repository. So you will need to install the Zabbix repository in your system.

At the time of writing this tutorial, the latest version of Zabbix is Zabbix 4.4. You can install the Zabbix 4.4 repository package by running the following command:

dnf install -y https://repo.zabbix.com/zabbix/4.4/rhel/8/x86_64/zabbix-release-4.4-1.el8.noarch.rpm

Once the repository is created, run the following command to install the Zabbix server with other required packages:

dnf install -y zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-apache-conf

Once the installation is completed, start the Zabbix server, Zabbix agent and PHP-FPM services, and enable them to start after system reboot with the following command:

systemctl start zabbix-server
systemctl start zabbix-agent
systemctl start php-fpm
systemctl enable zabbix-server
systemctl enable zabbix-agent
systemctl enable php-fpm

Zabbix server and agent is now started and listening on ports 10050 and 10051. You can check them using the following command:

netstat -ant | grep LISTEN

You should get the following output:

tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:10050           0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:10051           0.0.0.0:*               LISTEN     
tcp6       0      0 :::22                   :::*                    LISTEN     
tcp6       0      0 :::10050                :::*                    LISTEN     
tcp6       0      0 :::10051                :::*                    LISTEN     
tcp6       0      0 :::3306                 :::*                    LISTEN     
tcp6       0      0 :::80                   :::*                    LISTEN  

Step 5 – Configure Zabbix

First, you will need to import the database schema to the Zabbix database. You can import it with the following command:

cd /usr/share/doc/zabbix-server-mysql
zcat create.sql.gz | mysql -u zabbix -p zabbix

Next, edit the zabbix_server.conf file and define your Zabbix database credentials:

nano /etc/zabbix/zabbix_server.conf

Change the following lines:

DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbixpassword

Save and close the file.

Next, configure PHP for Zabbix frontend by editing the following file:

nano /etc/php-fpm.d/zabbix.conf

Change the timezone value with your desired value as shown below:

php_value[date.timezone] = Asia/Kolkata

Save and close the file when you are finished. Next, restart all the services to apply the changes:

systemctl restart zabbix-server
systemctl restart zabbix-agent
systemctl restart php-fpm
systemctl restart httpd
systemctl restart mariadb

Step 6 – Configure Firewall for Zabbix

Next, you will need to allow the Zabbix ports 10050 and 10051. and HTTP service through firewalld. You can allow them with the following command:

firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-port=10050/tcp
firewall-cmd --permanent --add-port=10051/tcp

Now, reload the firewalld service to implement the changes:

firewall-cmd --reload

Step 7 – Access Zabbix Web Interface

Now, open your favorite web browser and type the URL http://your-server-ip/zabbix. You will be redirected to the Zabbix web installation wizard in the following screen:

Step 1 - Install Zabbix CentOS 8

Click on the Next step button. You should see the following page:

Step 2 - Install Zabbix CentOS 8

Make sure all the required dependencies are installed then click on the Next step button. You should see the following page:

Step 3 - Install Zabbix CentOS 8

Provide your database credentials and click on the Next step button. You should see the following page:

Step 4 - Install Zabbix CentOS 8

Provide your Zabbix server details and click on the Next step button. You should see the following page:

Step 5 - Install Zabbix CentOS 8

Make sure all the configuration parameters are correct then click on the Next step button. Once the installation has been completed successfully, you should see the following page:

Step 6 - Install Zabbix CentOS 8

Click on the Finish button. You will be redirected to the Zabbix login page as shown below:

Step 7 - Install Zabbix CentOS 8

Provide the Zabbix default username and password as Admin / zabbix and click on the Sign-in button. You should see the Zabbix dashboard in the following screen:

Step 8 - Install Zabbix CentOS 8

Conclusion

Congratulations! you have successfully installed the Zabbix server on CentOS 8 server. You can now start exploring the Zabbix dashboard for more details and add the client for monitoring. Next, Add a remote host for monitoring to your Zabbix server.

The post How To Install Zabbix Server on CentOS/RHEL 8 appeared first on TecAdmin.

]]>
https://tecadmin.net/install-zabbix-server-centos-8/feed/ 1
How To Install NRPE on LinuxMint 19/18 https://tecadmin.net/install-nrpe-on-linuxmint/ https://tecadmin.net/install-nrpe-on-linuxmint/#respond Fri, 30 Nov 2018 06:11:11 +0000 https://tecadmin.net/?p=17601 NRPE stands for Nagios Remote Plugin Executor, is used for executing Nagios plugins on remote client systems. In previous article we had described about installation of Nagios Server on Ubuntu operating system. This article will help you to install NRPE on LinuxMint 19 and Linux mint 18 systems. Step 1 – Installing NRPE NRPE is [...]

The post How To Install NRPE on LinuxMint 19/18 appeared first on TecAdmin.

]]>
NRPE stands for Nagios Remote Plugin Executor, is used for executing Nagios plugins on remote client systems. In previous article we had described about installation of Nagios Server on Ubuntu operating system. This article will help you to install NRPE on LinuxMint 19 and Linux mint 18 systems.

Install NRPE

Step 1 – Installing NRPE

NRPE is available under default apt repositories of Ubuntu systems. Execute the following command to install it

sudo apt-get update
sudo apt-get install nagios-nrpe-server nagios-plugins

Step 2 – Configure NRPE

In NRPE configuration, first we need to nrpe to which nagios servers it accepts requests, For example your nagios server ip is 192.168.1.100, then add this ip to allowed hosts list. Edit NRPE configuration file /etc/nagios/nrpe.cfg and make changes like

/etc/nagios/nrpe.cfg
 allowed_hosts=127.0.0.1, 192.168.1.100

we can add more Nagios servers in allowed hosts by comma separated list.

Now restart NRPE service. Now its ready to listen to requests from Nagios server

sudo /etc/init.d/nagios-nrpe-server restart

Step 3 – Verify Connection

Let’s verify the connection between the Nagios server and NRPE client machine. Login to your Nagios server and check the Nagios server can communicate with NRPE service properly.

Use check_nrpe command on Nagios server under plugins directory. The command will be like as below here 192.168.1.110 is the IP address of client machine.

check_nrpe -H 192.168.1.110

NRPE v2.15

The output “NRPE v2.15” shows that the Nagios server successfully communicated with NRPE.

Step 4 – Add Check Commands in NRPE

All the services check commands with the nagios plugins packages, which is by default installed in /usr/lib/nagios/plugins/ for 32 bit systems. Default installation adds few commands in configuration file. Add more commands as per your requirements like below

vim /etc/nagios/nrpe.cfg
/etc/nagios/nrpe.cfg
command[check_load]=/usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20
command[check_sda1]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/sda1
command[check_sda2]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/sda2
command[check_total_procs]=/usr/lib/nagios/plugins/check_procs -w 150 -c 200

Step 5 – Start/Stop NRPE Service

Use following commands to start, stop or restart NRPE service. Each time we make any changes in configuration file required to restart service

sudo /etc/init.d/nagios-nrpe-server stop
sudo /etc/init.d/nagios-nrpe-server start
sudo /etc/init.d/nagios-nrpe-server restart

The post How To Install NRPE on LinuxMint 19/18 appeared first on TecAdmin.

]]>
https://tecadmin.net/install-nrpe-on-linuxmint/feed/ 0
How to Install Zabbix Server on Debian 10/9/8 https://tecadmin.net/install-zabbix-on-debian/ https://tecadmin.net/install-zabbix-on-debian/#comments Sat, 28 Jul 2018 07:35:23 +0000 https://tecadmin.net/?p=16805 Zabbix is an open source software for networks and application monitoring. Zabbix provides agents to monitor remote hosts as well as Zabbix includes support for monitoring via SNMP, TCP and ICMP checks. Click here to know more about zabbix. This article will help you to step by step install Zabbix on Debian 9 and Debian [...]

The post How to Install Zabbix Server on Debian 10/9/8 appeared first on TecAdmin.

]]>
Zabbix is an open source software for networks and application monitoring. Zabbix provides agents to monitor remote hosts as well as Zabbix includes support for monitoring via SNMP, TCP and ICMP checks. Click here to know more about zabbix.

Zabbix-Monitoring

This article will help you to step by step install Zabbix on Debian 9 and Debian 8 Systems. If you are using CentOS, RHEL or Fedora then Click here to install Zabbix on CentOS, RHEL or Fedora

Step 1 – Setup LAMP Stack

You must have a LAMP environment on your server to use Zabbix server. If you already have LAMP configured, just skip this step, else install Apache, MySQL, and PHP using the following commands.

sudo apt-get update
sudo apt-get install apache2
sudo apt-get install mysql-server
sudo apt-get install php php-mbstring php-gd php-xml php-bcmath php-ldap php-mysql

Update timezone in php configuration file /etc/php/PHP_VERSION/apache2/php.ini. Like below:

[Date]
; http://php.net/date.timezone
date.timezone = 'Asia/Kolkata'

Step 2 – Configure Apt Repository

Before installing Zabbix first configure Zabbix package repository in your system using following commands. Use commands as per your operating system.

## For Debian 10:

wget https://repo.zabbix.com/zabbix/4.0/debian/pool/main/z/zabbix-release/zabbix-release_4.0-3+buster_all.deb
sudo dpkg -i zabbix-release_4.0-3+buster_all.deb

## For Debian 9:

wget https://repo.zabbix.com/zabbix/4.0/debian/pool/main/z/zabbix-release/zabbix-release_4.0-3+stretch_all.deb
sudo dpkg -i zabbix-release_4.0-3+stretch_all.deb

## For Debian 8:

wget https://repo.zabbix.com/zabbix/4.0/debian/pool/main/z/zabbix-release/zabbix-release_4.0-3+jessie_all.deb
sudo dpkg -i zabbix-release_4.0-3+jessie_all.deb

Step 3 – Install Zabbix Server

After adding the Zabbix repository in your system use following command to install Zabbix server. Here zabbix-server-mysql package includes Zabbix server with MySQL support. The zabbix-frontend-php package provides and web interface is written in PHP for the Zabbix server management

sudo apt-get update
sudo apt-get install zabbix-server-mysql zabbix-frontend-php zabbix-agent

Step 4 – Create Database Schema

Now create a database schema for your Zabbix server. Login to your MySQL server using administrative privileges and use the following queries to create MySQL database and user for the Zabbix server.

mysql -u root -p

mysql> CREATE DATABASE zabbixdb character set utf8 collate utf8_bin;
mysql> CREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'password';
mysql> GRANT ALL PRIVILEGES ON zabbixdb.* TO 'zabbix'@'localhost' WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;

Also, load the Zabbix database schema to the database created above.

cd /usr/share/doc/zabbix-server-mysql
zcat create.sql.gz | mysql -u zabbix -p zabbixdb

Step 5 – Edit Zabbix Configuration File

Edit Zabbix server configuration file /etc/zabbix/zabbix_server.conf in your favorite text editor and update the following database configurations. This will be used by Zabbix server to connect to the database.

  DBHost=localhost
  DBName=zabbixdb
  DBUser=zabbix
  DBPassword=password

Step 6 – Restart Apache and Zabbix

Zabbix creates its own apache configuration file /etc/zabbix/apache.conf and make a link to Apache configuration directory. Let’s use the following command to restart Apache service.

sudo systemctl restart apache2.service

Zabbix server configuration file are located at /etc/zabbix/zabbix_server.conf. Restart Zabbix server.

sudo systemctl restart zabbix-server
sudo systemctl restart zabbix-agent

After starting the Zabbix service, let’s go to the Zabbix web installer and finish the installation.

Step 7 – Run Zabbix Web Installer

Zabbix web installer can be accessed on /zabbix subdirectory URL on your servers IP or domain. For example, host.tecadmin.net is pointed to my Zabbix server. Now access the Zabbix using the following URL. You must change FQDN as per your setup.

http://host.tecadmin.net/zabbix/

and follow the steps as per given screenshots below.

Zabbix Setup Welcome Screen

This is the welcome screen of Zabbix web installer. Go forward by click on next button.

Check for pre-requisities

Check if your system has all required packages, if everything is ok click next.

Configure DB Connection

Enter database details created in Step #4 and click next to continue.

Zabbix Server Details

This is the host and port of running Zabbix server. As your Zabbix server is running on the same host, so keep the values unchanged. You can give a name for your instance.

Pre-Installation Summary

In this step will show the summary you have entered the previous steps, so simply click next.

Install Zabbix

If everything goes correctly, you will see a successful installation message on this page. This will also show you a message for the created configuration file.

Zabbix Login Screen

Login to Zabbix using default credentials.

 Username:  Admin
 Password:  zabbix

After successful login, You will get Zabbix dashboard like below.

Zabbix Server Installation

Congratulation! Your Zabbix setup has been completed. Read our next article to Install Zabbix Agent and Add Host in Zabbix Server.

The post How to Install Zabbix Server on Debian 10/9/8 appeared first on TecAdmin.

]]>
https://tecadmin.net/install-zabbix-on-debian/feed/ 3
How to Monitor Memory, CPU and Disk on Linux using NRPE and Nagios https://tecadmin.net/nagios-monitor-memory-cpu-disk-on-linux/ https://tecadmin.net/nagios-monitor-memory-cpu-disk-on-linux/#comments Wed, 03 Jan 2018 17:59:18 +0000 https://tecadmin.net/?p=12922 Nagios is the most popular monitoring server for infrastructure monitoring. In the series of Nagios monitoring tutorials, this tutorial will help you to monitor Memory, CPU, and Disk on a remote Linux system using Nagios and NRPE. I assume you have a running Nagios server on your network. Prerequisites You have installed the NRPE client [...]

The post How to Monitor Memory, CPU and Disk on Linux using NRPE and Nagios appeared first on TecAdmin.

]]>
Nagios is the most popular monitoring server for infrastructure monitoring. In the series of Nagios monitoring tutorials, this tutorial will help you to monitor Memory, CPU, and Disk on a remote Linux system using Nagios and NRPE. I assume you have a running Nagios server on your network.

Prerequisites

You have installed the NRPE client on your Linux system. Use the following commands to install NRPE on your system or visit our tutorials for the NRPE installation on Debian based systems and Redhat based systems.

  • Ubuntu and Debian based systems:
    sudo apt install nagios-nrpe-server 
    
  • Redhat, CentOS systems:
    sudo dnf install nrpe nagios-plugins
    

NRPE default configuration file is /etc/nagios/nrpe.cfg. You need to edit this file for making changes as per the next instructions.

Monitor CPU Load

A Nagios plugin check_load is available to check current CPU load on the system. Edit the NRPE configuration file and check for the following entry. This should be default available there. You don’t need to make any changes.

command[check_load]=/usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20

Let’s verify the configuration by running the check_nrpe command from the Nagios server

As per the above screenshot, the Nagios server sent NRPE requests to the defined host (192.168.1.15) to execute command check_load and send results back. The requests go to the remote host and the NRPE server checks for the command defined as check_load and execute it.

Monitor Memory Uses

A Nagios plugin is available to monitor memory uses on Linux systems. You can download the check_mem.pl and configure with NRPE daemon. Download check_mem.pl using the following command and copy it to the Nagios plugins directory. On CentOS/RHEL 64-bit systems this local will be /usr/lib64/nagios/plugins.

cd /usr/lib/nagios/plugins/
wget https://raw.githubusercontent.com/justintime/nagios-plugins/master/check_mem/check_mem.pl
chmod +x check_mem.pl

Edit NRPE configuration file and add a command to check memory uses like below. This will not calculate the swap memory in results.

command[check_mem]=/usr/lib/nagios/plugins/check_mem.pl -f -w 20 -c 10

  • -w 20 – Send a warning message if free memory is less 20% of the total memory.
  • -c 10 – Send a critical message if free memory is less 10% of the total memory.

Now verify the configuration by running the check_nrpe command from the Nagios server

Monitor Disk Uses

A Nagios plugin check_disk is available to check disk status. Edit the NRPE configuration file and add the following entry to check disk /dev/sda1.

command[check_sda1]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/sda1

  • -w 20% – Sent a warning message if the free disk is less than 20% of the total disk.
  • -c 10% – Sent a critical message if the free disk is less than 10% of the total disk.
  • -p /dev/sda1 – Defines disk to be checked.

You can also define the mount point instead of the disk name to monitor. For example, monitoring the root (/) disk or other mounts like (/mnt)

command[check_root_disk]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /
command[check_mnt_disk]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /mnt

Let’s verify the configuration by running the check_nrpe command from the Nagios server

The post How to Monitor Memory, CPU and Disk on Linux using NRPE and Nagios appeared first on TecAdmin.

]]>
https://tecadmin.net/nagios-monitor-memory-cpu-disk-on-linux/feed/ 13