Editing Talk:Monitoring /proc/user beancounters with nagios
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 3: | Line 3: | ||
== Introduction == | == Introduction == | ||
− | This script gives a warning if any parameter in a virtual environment (VZ) | + | This script gives a warning if any parameter in a virtual environment (VZ) exceed 80% of resources. |
== packages basic installation == | == packages basic installation == | ||
Line 20: | Line 20: | ||
== configuration == | == configuration == | ||
− | Copy the script and configure | + | Copy the script and configure <code> /etc/crontab </code> |
== Script resource == | == Script resource == | ||
Line 27: | Line 27: | ||
#!/bin/bash resource.sh | #!/bin/bash resource.sh | ||
# Copyright (C) 2008 Mgual | # Copyright (C) 2008 Mgual | ||
− | # Distributed under to GNU General Public License | + | # Distributed under to GNU General Public License v3 |
# v0.1 2008-08-13 | # v0.1 2008-08-13 | ||
# Ajuntament de Benicarló | # Ajuntament de Benicarló | ||
Line 35: | Line 35: | ||
#!/bin/bash | #!/bin/bash | ||
+ | echo "" | gawk -vVZ='ID' -vRESOURCE='Parametre' -vPBARRIER='%bar' -vPLIMIT='%lim' ' | ||
+ | { | ||
+ | printf "%3s %-20s %3s %3s \n", VZ, RESOURCE , PBARRIER, PLIMIT > "/tmp/beancounters" | ||
+ | } | ||
+ | ' | ||
− | + | gawk ' | |
− | gawk ' | ||
− | |||
− | |||
− | |||
/dummy/||/Version/||/uid/ { next } | /dummy/||/Version/||/uid/ { next } | ||
! /:/ { | ! /:/ { | ||
Line 70: | Line 71: | ||
printf "%-20s %3d %3d ", RESOURCE , PBARRIER, PLIMIT | printf "%-20s %3d %3d ", RESOURCE , PBARRIER, PLIMIT | ||
if (PBARRIER>=80) { | if (PBARRIER>=80) { | ||
− | printf " | + | printf " Perill " |
printf "%3d %-20s %3d %3d Perill\n", VZ, RESOURCE , PBARRIER, PLIMIT >> "/tmp/beancounters" | printf "%3d %-20s %3d %3d Perill\n", VZ, RESOURCE , PBARRIER, PLIMIT >> "/tmp/beancounters" | ||
} | } | ||
Line 78: | Line 79: | ||
echo "---------------------------------------------------" >> /tmp/beancounters | echo "---------------------------------------------------" >> /tmp/beancounters | ||
− | echo "" | gawk -vVZ='ID' -vRESOURCE='Use | + | echo "" | gawk -vVZ='ID' -vRESOURCE='Use%' ' |
{ | { | ||
printf "%3s %-20s \n", VZ, RESOURCE >> "/tmp/beancounters" | printf "%3s %-20s \n", VZ, RESOURCE >> "/tmp/beancounters" | ||
Line 94: | Line 95: | ||
echo "---------------------------------------------------" >> /tmp/beancounters | echo "---------------------------------------------------" >> /tmp/beancounters | ||
− | echo "" | gawk -vVZ='ID' -vRESOURCE='IUse | + | echo "" | gawk -vVZ='ID' -vRESOURCE='IUse%' ' |
{ | { | ||
printf "%3s %-20s \n", VZ, RESOURCE >> "/tmp/beancounters" | printf "%3s %-20s \n", VZ, RESOURCE >> "/tmp/beancounters" | ||
Line 107: | Line 108: | ||
if [[ "$(cat /tmp/beancounters | wc -l)" != "5" ]] ; then | if [[ "$(cat /tmp/beancounters | wc -l)" != "5" ]] ; then | ||
− | cat /tmp/beancounters | nail -s | + | cat /tmp/beancounters | nail -s Server:resource.sh perill@smtp-server.org |
fi | fi |