I have written a scripts that checks the load average of server and if it is more than 5 it send a mail describing Current Load Average and High CPU/RAM processes .
The problem is I want to send these information in html form .I have done necessary coding to do the same but whenever i try to include the output of following It doesnt seems to be properly formatted.
Output is as below.
Its so difficult to understand when i mail the information in plain text i can see the output properly formatted.
Is there any way i can send some part of script output in html while other in plain text ?
I hope i m not confusing ...
The problem is I want to send these information in html form .I have done necessary coding to do the same but whenever i try to include the output of following It doesnt seems to be properly formatted.
Code:
echo "Top 10 CPU Utilized Processes" >> /tmp/Load_Average_Check.html
ssh -Tqn $1 ps auxf | sort -nr -k 3 | head -10 >> /tmp/Load_Average_Check.html
echo "-------------------------------------" >> /tmp/Load_Average_Check.html
echo "Top 10 Memory Utilized Processes" >> /tmp/Load_Average_Check.html
ssh -Tqn $1 ps auxf | sort -nr -k 4 | head -10 >> /tmp/Load_Average_Check.html
Code:
******************************************************* Top 10 CPU Utilized Processes root 28679 2.5 0.0 34916 6688 ? Sl 00:05 20:59 \_ /usr/lib/xen/bin/qemu-dm -d 387 -domain-name XXXXXX -videoram 4 -k en-us -vnc 0.0.0.0:0,password -vncunused -vcpus 1 -boot c -localtime -serial pty -acpi -usbdevice tablet -net nic,vlan=1,macaddr=00:16:3E:67:92:4F,model=rtl8139 -net tap,vlan=1,ifname=tap387.0,bridge=XXXX -M xenfv root 32002 2.3 0.0 34712 4784 ? Sl Apr06 283:01 \_ /usr/lib/xen/bin/qemu-dm -d 372 -domain-name XXXXXXXX -videoram 4 -k en-us -vnc 0.0.0.0:0 -vncunused -vcpus 2 -boot c -localtime -serial pty -acpi -usbdevice tablet -net nic,vlan=1,macaddr=00:16:3E:19:32:09,model=rtl8139 -net tap,vlan=1,ifname=tap372.0,bridge=XXXX -M xenfv root 26933 1.9 0.0 0 0 ? Z 13:36 0:00 \_ [python] root 1815 1.9 0.0 35020 6852 ? Sl Feb17 1553:59 \_ /usr/lib/xen/bin/qemu-dm -d 261 -domain-name XXXXXX -videoram 4 -k en-us -vnc 0.0.0.0:0,password -vncunused -vcpus 2 -boot c -localtime -serial pty -acpi -usbdevice tablet -net nic,vlan=1,macaddr=XXXXXX,model=rtl8139 -net
Is there any way i can send some part of script output in html while other in plain text ?
I hope i m not confusing ...