Nagios 2 to 4 - How to monitor a Ubuntu Linux host and its services
Вставка
- Опубліковано 27 лип 2024
- This video shows how to monitor a Linux Machine from nagios. How to monitor the cpu usage, memory usage and disk space, etc...
If you want to know how to install Nagios in Ubuntu server 22.04 and add a host to monitor.
• Nagios 1 to 4 - How to...
00:00 Intro
01:43 Install a nagios agent on hosts we want to monitor
02:27 Informations about the plugins folder
02:48 Modify the nagios agent config file
10:38 I explain what is command arguments and the dont_blame_nrpe option
13:45 Restart the nrpe service
14:38 Plugins to install on the Nagios server
15:56 Configuration to do on the Nagios server
21:07 Restart nagios service
21:34 Go to the nagios web interface to show our hosts services
23:24 Somes corrections to do on our host
34:48 The other package we have to install on our Ubuntu host we want to monitor.
26:23 Everything is ok now
##### Here all commands I used in this video on the monitored host
sudo apt install nagios-nrpe-server
If you want to monitor CPU, memory and uptime, you must also install:
sudo apt install monitoring-plugins-contrib
ll -l /usr/lib/nagios/plugins
sudo vi /etc/nagios/nrpe.cfg
modify the line: allowed_hosts
An excerpt from my nrpe.cfg
command[check_users]=/usr/lib/nagios/plugins/check_users -w 5 -c 10
command[check_load]=/usr/lib/nagios/plugins/check_load -r -w .15,.10,.05 -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
command[check_disk_root]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /
command[check_swap]=/usr/lib/nagios/plugins/check_swap -w 50 -c 20
command[check_uptime]=/usr/lib/nagios/plugins/check_uptime
command[check_cpu]=/usr/lib/nagios/plugins/check_cpu -w 85% -c 95%
command[check_memory]=/usr/lib/nagios/plugins/check_memory check_memory --vmstats -w 80% -c 90%
sudo systemctl restart nagios-nrpe-server
sudo systemctl status nagios-nrpe-server
##### Here all commands I used in this video on the nagios server
sudo apt install nagios-nrpe-plugin
/usr/lib/nagios/plugins/check_nrpe -H 10.0.0.34
sudo vi /etc/nagios4/objects/commands.cfg
An excerpt from my commands.cfg (Google doc shared because youtube description refuse a character)
docs.google.com/document/d/1d...
sudo vi /etc/nagios4/objects/linuxservices.cfg
An excerpt from my linuxservices.cfg
define service {
use generic-service
hostgroup_name ubuntu-hosts
service_description Root Partition
check_command check_nrpe_linux!check_disk_root
}
define service {
use generic-service
hostgroup_name ubuntu-hosts
service_description Load
check_command check_nrpe_linux!check_load
}
define service {
use generic-service
hostgroup_name ubuntu-hosts
service_description CPU
check_command check_nrpe_linux!check_cpu
}
define service {
use generic-service
hostgroup_name ubuntu-hosts
service_description Memory
check_command check_nrpe_linux!check_memory
}
define service {
use generic-service
hostgroup_name ubuntu-hosts
service_description Swap
check_command check_nrpe_linux!check_swap
}
define service {
use generic-service
hostgroup_name ubuntu-hosts
service_description Uptime
check_command check_nrpe_linux!check_uptime
}
define service {
use generic-service
hostgroup_name ubuntu-hosts
service_description Users
check_command check_nrpe_linux!check_users
}
define service {
use generic-service
hostgroup_name ubuntu-hosts
service_description Procs
check_command check_nrpe_linux!check_total_procs
}
define service {
use generic-service
hostgroup_name ubuntu-hosts
service_description Zombie Procs
check_command check_nrpe_linux!check_zombie_procs
}
sudo nagios4 -v /etc/nagios4/nagios.cfg
sudo systemctl reload nagios4 - Наука та технологія
Thanks Man, it's really usefull for me