#!/bin/bash # Put this file to /var/prtg/scriptsxml/freemem.sh to target machine # chmod +x /var/prtg/scriptsxml/freemem.sh # Add line: Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,blowfish-cbc,aes128-cbc,3des-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc # to end of /etc/ssh/sshd_conf and restart ssh # Add advanced SSH sensor meminfo="/usr/bin/free" xmlresult=`cat < EOF ` if [ -f $meminfo ]; then result=`free -b | grep 'Mem\|Swap'` while read line; do if [[ $line == Mem* ]]; then total=`echo $line | awk '{print $2}'` used=`echo $line | awk '{print $3}'` free=`echo $line | awk '{print $4}'` shared=`echo $line | awk '{print $5}'` buffers=`echo $line | awk '{print $6}'` cache=`echo $line | awk '{print $7}'` else swtotal=`echo $line | awk '{print $2}'` swused=`echo $line | awk '{print $3}'` swfree=`echo $line | awk '{print $4}'` fi done <<< "$result" physicalusedperc=`echo $used $buffers $cache $total | \ awk '{printf("%.3f", 100-(($1)*100/$4))}'` xmlresult+=`cat < Physical Free Percent 1 Percent $physicalusedperc 1 1 1 15 8 EOF ` physicalfreebytes=`echo $used $buffers $cache $total | \ awk '{printf("%i", $4-$1)}'` xmlresult+=`cat < Physical Free 0 BytesMemory $physicalfreebytes EOF ` xmlresult+=`cat <OK EOF ` else xmlresult+=`cat <1 This sensor is not supported by your system, missing $proc EOF ` fi echo "$xmlresult" exit 0