Sep 13, 2018

How to get email notification of disk usage of remote linux server

If you don't want to set up monitoring software such as nagois, you can use the following to  get email notification of disk usage of remote linux server:

$ crontab -l
58 10 * * * cp db_df_msg.orig db_df_msg; ssh 192.168.1.88 'df -h' >> db_df_msg; /usr/sbin/sendmail -t < db_df_msg

$ cat db_df_msg.orig
Subject: server disk usage
To: [email protected]
CC: [email protected]

This is a notification message.