An Azure service that is used to provision Windows and Linux virtual machines.
you may try to use SendGrid for that. Here are some details how to use it from Linux running on Azure: How to Send Email Using SendGrid with Azure.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I'm working on one scenario in which I want to send a metrics such as (disk utilization, CPU utilization and memory utilazition) through e-mail from linux machine.
I have used the below shell script:
scpu=$(cat /proc/stat | awk '/cpu/{printf("%.2f%\n"), ($2+$4)*100/($2+$4+$5)}' | awk '{print $0}' | head -1)
smem=$(free | awk '/Mem/{printf("%.2f%"), $3/$2*100}')
sswap=$(free | awk '/Swap/{printf("%.2f%"), $3/$2*100}')
t=$(date)
echo "$(hostname -f), $scpu, $smem, $sswap, $t" >> /tmp/cpu-mem-swap.csv | mail -s "Metrics" yourmailid.domain.com
I've exceuted this script but getting the correct metrics but unable to send an email.
Please anklowedge me with your inputs.
Regards,
Ashima
An Azure service that is used to provision Windows and Linux virtual machines.
you may try to use SendGrid for that. Here are some details how to use it from Linux running on Azure: How to Send Email Using SendGrid with Azure.