Situatie
1.Prerequisites
Make sure your system is updated and install necessary packages:
Create a Nagios user and group:
Install required dependencies:
2. Install Nagios Core
Step 1: Download Nagios Core
Step 2: Compile and Install Nagios
Step 3: Set up Web Interface
Set up Apache user password:
Enable Apache modules and restart Apache:
3. Install Nagios Plugins
Nagios uses plugins to monitor services.
4. Install NRPE (for remote monitoring)
Edit the NRPE config file on remote hosts (/etc/nagios/nrpe.cfg
):
-
Add your Nagios server IP to
allowed_hosts
-
Restart NRPE:
sudo systemctl restart nagios-nrpe-server
On the Nagios server, install NRPE plugin:
5. Configure Nagios
Main configuration directory:/usr/local/nagios/etc/
Verify default config:
Enable additional configs in nagios.cfg
:
Create the directory:
6. Start Nagios and Access Web UI
Enable and start Nagios:
Access via browser:
http://<server_ip>/nagios/
Login with user: nagiosadmin
and the password you set earlier.
7. Add Hosts and Services
(/usr/local/nagios/etc/servers/webserver.cfg
):
Restart Nagios:
8. Optional Enhancements
-
Email alerts: Configure
contacts.cfg
with email details -
SSL for web UI: Use Let’s Encrypt or self-signed certs
-
Mobile UI: Install mobile-friendly frontends like
NagiosMobile
orNagios V-Shell
-
NagiosQL / Centreon: Use GUIs for easier management
-
Performance Graphing: Integrate with PNP4Nagios or NagiosGraph.
Check for errors:
Log file:/usr/local/nagios/var/nagios.log
Web Interface:
Monitor hosts/services and acknowledge problems.
Leave A Comment?