#!/bin/bash
#VARS: HOST,SSH_PORT,LOGIN,PASSWORD
#for not empty password required sshpass

if [ -z "$PASSWORD" ]
then
    ssh $LOGIN@$HOST -p $SSH_PORT free |head -n2 | tail -n1|awk '{print ($2-$7)"/"$2}'
else
    sshpass -p $PASSWORD ssh $LOGIN@$HOST -p $SSH_PORT free |head -n2 | tail -n1|awk '{print ($2-$7)"/"$2}'
fi



#PERCENTS RESULT VAR TYPE (float/float)