This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| info=$(w -hs) | |
| user=$(who | wc -l) | |
| if [ $user -ge 3 ]; then | |
| echo CRITICAL: $user usuarios conectados | |
| echo Info: $info | |
| $(exit 2) | |
| elif [ $user -ge 2 ]; then | |
| echo WARNING: $user usuario conectado |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| Ts=$(swapon -s |grep dev |awk '{print $3}') | |
| Us=$(swapon -s |grep dev |awk '{print $4}') | |
| St=$(($Ts/1024)) | |
| Su=$(($Us/1024)) | |
| Swap=$((($Su*100)/$St)) | |
| T=$(free -m |grep Mem |awk '{print $2}') | |
| U=$(free -m |grep Mem |awk '{print $3}') | |
| F=$(free -m |grep Mem |awk '{print $4}') | |
| mem=$((($U*100)/$T)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| case "$1" in | |
| -p) | |
| shift | |
| DISKLABEL=$1;; | |
| esac | |
| T=$(df -h /dev/$DISKLABEL |grep $DISKLABEL |awk '{print $2}') | |
| U=$(df -h /dev/$DISKLABEL |grep $DISKLABEL |awk '{print $3}') | |
| F=$(df -h /dev/$DISKLABEL |grep $DISKLABEL |awk '{print $4}') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| load1=$(uptime | awk -F : '{ print $5 }' | sed 's/,//g'| awk '{print $1}') | |
| load2=$(uptime | awk -F : '{ print $5 }' | sed 's/,//g'| awk '{print $2}') | |
| load3=$(uptime | awk -F : '{ print $5 }' | sed 's/,//g'| awk '{print $3}') | |
| LOAD1=$(/usr/bin/printf "%d\n" $load1 2>/dev/null) | |
| LOAD2=$(/usr/bin/printf "%d\n" $load2 2>/dev/null) | |
| LOAD3=$(/usr/bin/printf "%d\n" $load3 2>/dev/null) | |
| pid=$(cat /proc/loadavg| awk '{print $5}') | |
| if [ $LOAD1 -gt 5 ]; then | |
| echo "CRITICAL: $load1/1min encolados... $load2/5min encolados... $load3/15min encolados... ultimo PID creado: $pid" |