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:25] fiserp [Monitoring of server with CzechIdM] |
tutorial:adm:server_monitoring [2019/03/25 11:27] fiserp [Implementation] |
||
---|---|---|---|
Line 33: | 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 bash 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 78: | 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 108: | 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 123: | 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 132: | 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{ |