Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
tutorial:adm:server_monitoring [2019/03/25 11:29] fiserp [Implementation] |
tutorial:adm:server_monitoring [2019/09/19 07:45] fiserp [Server preparation - Server monitoring] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
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 9: | Line 9: | ||
This is a typical configuration of a production server for a small company. These parameters may need to be adjusted to complexity of particular deployment. | This is a typical configuration of a production server for a small company. These parameters may need to be adjusted to complexity of particular deployment. | ||
* RHEL7-flavoured system. | * RHEL7-flavoured system. | ||
- | * About 80GB HDD. | + | * About 100GB HDD. |
* At least 8GB RAM. | * At least 8GB RAM. | ||
* At least 2x2GHz CPU. | * At least 2x2GHz CPU. | ||
Line 35: | Line 35: | ||
* NRPE daemon will listen on 5666\tcp (its default port). Open the port in your iptables by adding the rule: '' | * 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 which can be downloaded here: [[https:// | + | * We use one external probe check\_mem which can be downloaded here: [[https:// |
- | <file bash check_mem> | + | |
- | # | + | |
- | + | ||
- | # Original version | + | |
- | # Modified for CentOS7/RHEL7 - Petr Fiser, BCV solutions s.r.o. | + | |
- | if [ " | + | |
- | + | ||
- | memTotal_b=`free -b |grep Mem |awk ' | + | |
- | memFree_b=`free -b |grep Mem |awk ' | + | |
- | memBuffer_b=`free -b |grep Mem |awk ' | + | |
- | + | ||
- | memTotal_m=`free -m |grep Mem |awk ' | + | |
- | memFree_m=`free -m |grep Mem |awk ' | + | |
- | memBuffer_m=`free -m |grep Mem |awk ' | + | |
- | + | ||
- | memUsed_b=$(($memTotal_b-$memFree_b-$memBuffer_b)) | + | |
- | memUsed_m=$(($memTotal_m-$memFree_m-$memBuffer_m)) | + | |
- | + | ||
- | memUsedPrc=$((($memUsed_b*100)/$memTotal_b)) | + | |
- | + | ||
- | + | ||
- | if [ " | + | |
- | echo " | + | |
- | $(exit 2) | + | |
- | elif [ " | + | |
- | echo " | + | |
- | $(exit 1) | + | |
- | else | + | |
- | echo " | + | |
- | $(exit 0) | + | |
- | fi | + | |
- | + | ||
- | else | + | |
- | echo " | + | |
- | echo "" | + | |
- | echo " | + | |
- | echo " | + | |
- | echo "" | + | |
- | echo " | + | |
- | echo "" | + | |
- | echo " | + | |
- | exit | + | |
- | fi | + | |
- | </ | + | |
**Deployment** | **Deployment** |