Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
tutorial:adm:server_monitoring [2019/03/25 15:02] fiserp [Monitoring of server with CzechIdM] |
tutorial:adm:server_monitoring [2019/03/25 15:50] fiserp [Implementation] |
||
---|---|---|---|
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 (GPL-licensed) 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)/ | + | |
- | + | ||
- | + | ||
- | 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** |