Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
tutorial:adm:server_monitoring [2019/03/25 10:24] fiserp [Monitored parameters] |
tutorial:adm:server_monitoring [2019/03/25 11:26] fiserp [Implementation] |
||
---|---|---|---|
Line 2: | Line 2: | ||
Automatic monitoring of production system is crucial for bussiness continuity. Monitoring is recommended also for the testing environment, | Automatic monitoring of production system is crucial for bussiness continuity. Monitoring is recommended also for the testing environment, | ||
This page will show you how to set up basic monitoring of server with CzechIdM using Nagios NRPE. It is very useful to store monitored values for trend overview (e.g. with Munin). Some monitoring systems (like Zabbix) can store trends and monitor services at once. It is also practical to install '' | This page will show you how to set up basic monitoring of server with CzechIdM using Nagios NRPE. It is very useful to store monitored values for trend overview (e.g. with Munin). Some monitoring systems (like Zabbix) can store trends and monitor services at once. It is also practical to install '' | ||
+ | |||
+ | < | ||
**Typical CzechIdM server** | **Typical CzechIdM server** | ||
Line 31: | Line 33: | ||
===== Implementation ===== | ===== Implementation ===== | ||
We will use nrpe and probes from the standard system packages. We have epel repository enabled. | We will use nrpe and probes from the standard system packages. We have epel repository enabled. | ||
- | * NRPE daemon will listen on 5666\tcp (its default port). Open the port in your iptables by adding the rule: //-A INPUT -m state --state ESTABLISHED, | + | * NRPE daemon will listen on 5666\tcp (its default port). Open the port in your iptables by adding the rule: '' |
- | * All probes are located in their default installation location | + | * All probes are located in their default installation location |
- | * We use one external probe check_mem | + | * We use one external probe check\_mem |
- | <code bash> | + | <file shell check_mem> |
#!/bin/bash | #!/bin/bash | ||
- | # Modified for CentOS7 - Petr Fiser, BCV solutions s.r.o. | + | # Original version https:// |
+ | # Modified for CentOS7/ | ||
if [ " | if [ " | ||
Line 76: | Line 79: | ||
exit | exit | ||
fi | fi | ||
- | </code> | + | </file> |
**Deployment** | **Deployment** | ||
- | First, install | + | First, install necessary packages: |
< | < | ||
yum install nrpe nagios-plugins-nrpe nagios-plugins-swap nagios-plugins-disk nagios-plugins-load nagios-plugins-procs nagios-plugins-ntp nagios-plugins-http nagios-plugins-pgsql | yum install nrpe nagios-plugins-nrpe nagios-plugins-swap nagios-plugins-disk nagios-plugins-load nagios-plugins-procs nagios-plugins-ntp nagios-plugins-http nagios-plugins-pgsql | ||
</ | </ | ||
- | If you use SELinux, we need to permit the check_disk plugin access to the /// | + | If you use SELinux, we need to permit the check_disk plugin access to the '' |
< | < | ||
yum install policycoreutils-python | yum install policycoreutils-python | ||
semanage permissive -a nagios_checkdisk_plugin_t | semanage permissive -a nagios_checkdisk_plugin_t | ||
</ | </ | ||
- | Edit the /// | + | Edit the '' |
< | < | ||
allowed_hosts=127.0.0.1, | allowed_hosts=127.0.0.1, | ||
</ | </ | ||
- | Create a configuration of system checks in the file /// | + | Create a configuration of system checks in the file '' |
- | <code> | + | <file txt checks.cfg> |
command[check_swap]=/ | command[check_swap]=/ | ||
command[check_disk]=/ | command[check_disk]=/ | ||
Line 106: | Line 109: | ||
command[check_httpd_cert]=/ | command[check_httpd_cert]=/ | ||
command[check_postgres]=/ | command[check_postgres]=/ | ||
- | </code> | + | </file> |
- | Add the //check_mem// script to the /// | + | Add the '' |
< | < | ||
cp check_mem / | cp check_mem / | ||
chmod 755 / | chmod 755 / | ||
</ | </ | ||
- | Create the MONITORING_USER in the PostgreSQL. | + | Create the '' |
< | < | ||
create user monitoring password ' | create user monitoring password ' | ||
Line 121: | Line 124: | ||
systemctl enable nrpe | systemctl enable nrpe | ||
</ | </ | ||
- | To test the probes, you can use //check_nrpe// plugin: | + | To test the probes, you can use '' |
< | < | ||
/ | / | ||
Line 130: | Line 133: | ||
This is a sample configuration for the Nagios server. It is meant more as an inspiration, | This is a sample configuration for the Nagios server. It is meant more as an inspiration, | ||
- | Configure the check_nrpe command (you probably already have this in your Nagios configuration): | + | Configure the '' |
< | < | ||
define command{ | define command{ |