I want to check the disk usage of my servers and send a mail if the usage is above 90%.
I have to do it in perl script. I thought to login into every server using ssh (with password as i cannot set up public & private keys for ssh session) and run the following command which would return me the disk usage in root partition :- df -h | awk '{ print $5}' | sed 's/capacity//g' | sed 's/%//g' | awk '/./' | awk -F. '{print $1}'| head -1 But i can't seem to find anyway to login into servers through ssh without having to install any perl modules like Net::OpenSSH or to use /usr/bin/expect.
Is there any plain and simple way to login through ssh and automate the password prompt without using any external perl modules? Also after loging in, i want to run that command on all the server and store the output into a variable for comparision. Please advice
Many regards :)