mailx-Nagios手動測試警示郵件

來源:互聯網
上載者:User

標籤:contact   寄件者   simple   資訊   收件者   mailx   

最近Naigos 修改contact ,需要手動發送測試郵件 Centos(其他版本可參照 man mail ,man mailx 獲得更多資訊)

建立郵件內容檔案mail.txt

[[email protected] ~]# touch mail.txt

[[email protected] ~]# vi mail.txt

編輯好以後內容後發送郵件

 mailx -s ‘test a simple mail‘ [email protected]  < mail.txt

[email protected]為接受郵件地址

如果是多個用 逗號分開地址即可

指定寄件者地址:

mailx -r $fromaddr -s......

 

mailx -s ‘test‘  -c ‘[email protected],[email protected]‘ [email protected] < mail.txt

-c為抄送郵件發送地址

 mailx -s ‘ttttt‘ -b ‘[email protected]‘  [email protected],[email protected] < mail.txt

-b指定的郵件地址為密送的地址 收件者是看不到的

 

發送附件的郵件在以上命令的前面加上

uuencode xxx.txt  xxx.txt |   

即可發送郵件附件xxx.txt   

如果找提示沒有 uuencode

可從一下地址選擇下載

http://rpmfind.net/linux/rpm2html/search.php?query=uuencode&submit=Search+...&system=&arch

下載後安裝即可


本文出自 “實用筆記” 部落格,請務必保留此出處http://qiuyt.blog.51cto.com/1229789/1529626

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.