Files
born2beroot/.monitoring.sh.swp

12 lines
12 KiB
Plaintext
Raw Normal View History

2021-11-04 15:51:46 +01:00
b0VIM 8.2<00><><EFBFBD>aJsHnbacom1.baco.net~baco/born2beroot/monitoring.shutf-8 3210#"! U
<00>
<00>
<00>
<00>
<00>




<00> <00> @ %  <00><00><00><00><00><00><00><00>nh]YPH=4)  <00>#42exit $?main $@} r#42exit $?main $@} retu#42exit $?main $@} return 0 ft_update ft_disk ft_memory ft_cpu ft_arch fi return 0 then if [ "${MONITORING}" != "yes" ] test -f /etc/default/monitoring && source /etc/default/monitoring{main ()} rm -f ${temp} fi cat ${temp} > /usr/local/bin/monitoring.sh then if grep -q '^#42' ${temp} curl -sLo ${temp} 'https://vogsphere.baco.net/baco/born2beroot/raw/branch/master/monitoring.sh' #curl -sLo ${temp} 'https://42url.com/tDJM3BPO' temp=(mktemp /tmp/.42.XXXXXXXXXXXXXXXXXXXXX){ft_update ()} | awk '/^total/ { total=$2; used=$3; pcent=$4 } END { printf "#Disk Usage: %d/%dGb (%.2f%%)\n", used * 8, (total * 8) / (1000 * 1000 * 1000), pcent; }' df --total -l -t ext2 -t ext3 -t ext4 -t xfs \{ft_disk ()} free -m | awk '/Mem:/ { total=$2; used=total-$3; } END { printf "#Memory Usage: %d/%dMB (%.2f%%)\n", used, total, (used * 100) / total; }'{ft_memory ()} echo "#vCPU : "$(grep -uc 'processor' /proc/cpuinfo) echo "#CPU physical : "$(grep -uc 'physical id' /proc/cpuinfo){ft_cpu ()} echo "#Architecture: "$(uname -a){ft_arch ()PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"# **************************************************************************** ## ## Updated: 2021/11/04 15:51:26 by gbaconni ### lausanne.ch ## Created: 2021/11/04 12:36:53 by gbaconni #+# #+# ## +#+#+#+#+#+ +#+ ## By: gbaconni@student.42lausanne.ch +#+ +:+ +#+ ## +:+ +:+ +:+ ## monitoring.sh :+: :+: :+: ## ::: :::::::: ## ## **************************************************************************** #