Linux uses SendMail and fetion to send alarm notifications

Source: Internet
Author: User
Tags rar

First, SendMail alarm notification

1, stop the system comes with the SendMail service #/etc/init.d/postfix STOP2, install SendMail and mailx# yum-y install SendMail mailx3, modify sendmail config file # cp/etc /mail.rc/etc/mail.rc.bak# cat >>/etc/mail.rc << eofset [email protected] smtp=smtp.139.com Set [email Protec Ted] smtp-auth-password=yi15093547036 Smtp-auth=logineof4, restarting SendMail Services # service SendMail RESTART5, sending mail notification # echo "I Love Nagios "| Mail-s ' Mail subject 01:today learn Nagios ' [email protected]# cat/etc/passwd | Mail-s ' Mail subject 02:today learn Nagios ' [email protected]# mail-s ' Email subject 03:today learn Nagios ' [email protected] </etc/iss Ue


Email notification as shown

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/4B/16/wKiom1QoCUGSWXhwAAIg2nq2sdI791.jpg "title=" 1.png " alt= "Wkiom1qocugswxhwaaig2nq2sdi791.jpg" width= "height=" border= "0" hspace= "0" vspace= "0" style= "width : 800px;height:190px; "/>


Mobile SMS notification as shown

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/4B/16/wKiom1QoCc_iMLw7AAi8OJsiTDo157.jpg "title=" 2.png " alt= "Wkiom1qocc_imlw7aai8ojsitdo157.jpg" width= "height=" 1045 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width : 700px;height:1045px; "/>




Second, fetion alarm notification

1. Install decompression software for extracting RAR format

[Email protected] ~]# wget http://www.rarsoft.com/rar/rarlinux-4.0.1.tar.gz [[email protected] ~]# Tar XF rarlinux-4.0.1.tar.gz [[Email protected] ~]# CD Rar[[email protected] rar]# makemkdir-p/usr/local/binmkdir-p/usr/local /libcp rar unrar/usr/local/bincp RARFILES.LST/ETCCP default.sfx/usr/local/lib[[email protected] rar]# CD.

2. Download and install the Fetion support Library

[[email protected] ~]# wget http://www.it-adv.net/fetion/linuxso_20101113.rar[[email  protected] ~]# unrar x linuxso_20101113.rar -bash: /usr/local/bin/unrar: / lib/ld-linux.so.2: bad elf interpreter:  does not have that file or directory [[Email protected] ~]# yum  -y install glibc.i686[[email protected] ~]# unrar x linuxso_20101113. rar unrar: error while loading shared libraries: libstdc++.so.6:  Cannot open shared object file: no such file or directory[[email  protected] ~]# yum -y install libstdc++.so.6[[email protected] ~]#  yum -y install libstdc++[[email protected] ~]# yum -y install  libstdc++.so.6[[email protected] ~]# unrar x linuxso_20101113.rar unrar  4.01 freeware      copyright  (c)  1993-2011 Alexander RoshalExtracting  from linuxso_20101113.rarextracting  libcrypto.so.4                                               OK Extracting  libssl.so.4                                                  OK Extracting  libACE_SSL-5.7.2.so                                         ok extracting  libace-5.7.2.so                                              ok all ok[[email protected] ~]# mkdir -p /usr/local /fetion/lib[[email protected] ~]# mv lib*so* /usr/local/fetion/lib/[[email  protected] ~]# echo  "/usr/local/fetion/lib/"  > /etc/ld.so.conf.d/fetion.conf[[ Email protected] ~]# ldconfig

3, download fetion executable program and upload to the server

[[email protected] ~]# mv fetion /usr/local/fetion/[[email protected] ~]#  cd /usr/local/fetion/[[email protected] fetion]# chmod 777 fetion [[ Email protected] fetion]# chown nagios.nagios fetion [[email protected]  fetion]# ll Total dosage  628-rwxrwxrwx 1 nagios nagios 503425 9 month   28  23:52 fetiondrwxr-xr-x 2 root   root     4096  9 Month   28 23:48 lib[[email protected] fetion]# ./fetion ./fetion:  error while loading shared libraries: libgssapi_krb5.so.2: cannot  open shared object file: no such file or directory[[email  protected] ~]# yum -y install krb5-libs libgssapi_krb5.so.2[[email  Protected] fetion]# ./fetion&nbsP;. /fetion: error while loading shared libraries: libz.so.1: cannot open  shared object file: no such file or directory[[email protected]  ~]# yum -y install libz.so.1[[email protected] fetion]# ./fetion   ************************ IMPORTANT STATEMENT ************************ **                                                                     ** **   please don ' T  use this software to send junk short messages.   **  **   otherwise please bear your own consequences.                   ** **                                                                     ** **                                  version:[20101205002-linux]      ** ***************  this program is the console  version of chiNa fetion! it ' S free for personal user. this project website:  http://www.it-adv.net/ AUTHOR:KelvinH MSN/EMAIL:[email protected] Usage:     --mobile=[mobile]   #自已的手机号     --sid=[sid]    -- pwd=[pwd]         #自已的飞信密码     --config=[config  file] *format:index mobile password    --index=[index no in  config file,refer to sample.conf]    --debug  *debug  mode on    --hide  *login fetion in hidden state     --to=[mobile/sid]    #指定接收短信者, must be self friend     --command-path=[ Command file path]    --robotmode    --daemon (linux  only) &NBSP;&NBSP;&NBSP;&NBSp;--proxy-ip (HTTP&NBSP;PROXY&NBSP;IP)     --proxy-port (http proxy port)      --msg-gb=[gb2312/gbk message]    --msg-utf8=[utf8 message]      #短信的内容, be careful not to be too long, or split into multiple messages     --msg-type=[0/1/2 sms  longsms smartmsg]    --file-gb=[gb2312/gbk file]    -- file-utf8=[utf8 file]    --query-cmcc-no    --auto-retry     --exit-on-verifycode    --t3key=[http://www.tui3.com/page/smssend/]


4, execute the command test fetion can send text messages normally

Note: The first execution of the command to send a notification will prompt for a verification code, this code will be automatically saved in the current main program directory, and the name of the mobile phone number of a picture, that is, the following surface. Then open this image under Windows and enter the verification code.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/4B/23/wKiom1QoOWzy1kSDAAEVtJnLAVk011.jpg "title=" 5.png " alt= "Wkiom1qoowzy1ksdaaevtjnlavk011.jpg"/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/4B/25/wKioL1QoOTzj_DxyAAEW3hCw0kQ644.jpg "title=" 4.png " Width= "height=" 308 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:800px;height:308px; "alt=" wkiol1qootzj_ Dxyaaew3hcw0kq644.jpg "/>

[[email protected] fetion]# ./fetion --mobile=18237179590 --pwd=qinh132619 --to= 18237179590 --msg-utf8= "Qinheng"  --debug[ 00:25:58.021626] [User.cpp] [1484]  Nav.fetion.com.cn=221.130.45.201[ 00:25:58.022126] [user.cpp] [1506] before connect  to nav.fetion.com.cn[ 00:25:58.040545] [user.cpp] [1518] after connected  to nav.fetion.com.cn[ 00:25:58.251901] [systemconfig.cpp] [104] sipc-proxy= 221.176.31.1:8080[ 00:25:58.251944] [systemconfig.cpp] [115] parsesystemconfig  221.176.31.1:8080[ 00:25:58.266999] [user.cpp] [1615] before connect to  uid.fetion.com.cn:443[ 00:25:58.313536] [user.cpp] [1628] after connect to  uid.fetion.com.cn:443[ 00:25:58.417277] [user.cpp] [1431] parsessiresult:18237179590  165618352 20472 1012841212 101[ 00:25:58.433929] [user.cpp] [1924] after connected to   221.176.31.1:8080[ 00:25:58.750377] [User.cpp] [2005] Need picture  authentication! [ 00:25:58.750441] [user.cpp] [756] geting piccode ..... [ 00:25:58.757552] [user.cpp] [841] get-pic-code from nav.fetion.com.cn[  00:25:58.757603] [user.cpp] [849] before connect to nav.fetion.com.cn[  00:25:58.768193] [user.cpp] [862] after connected to pic-code-serverhttp/1.1  200 okconnection: closedate: sun, 28 sep 2014 16:25:59 gmtserver :  microsoft-iis/6.0x-powered-by: asp. netcontent-location: nav.fetion.com.cnx-aspnet-version: 4.0.30319cache-control:  Privatecontent-type: text/html; charset=utf-8content-length: 2361<?xml version= "1.0"  encoding= "UTF-8 "? ><results><pic-certificate id=" 937e4f7d-1ec6-4b51-aeac-4e6d92ac58b1 " pic="/9j/ 4aaqskzjrgabaqeayabgaad/ 2wbdaaggbgcgbqghbwcjcqgkdbqndasldbksew8uhrofhh0ahbwgjc4nicisixwckdcpldaxndq0hyc5ptgypc4zndl/ 2wbdaqkjcqwldbgndrgyirwhmjiymjiymjiymjiymjiymjiymjiymjiymjiymjiymjiymjiymjiymjiymjiymjiymjl/ waarcaakafodasiaahebaxeb/8qahwaaaqubaqebaqeaaaaaaaaaaaecawqfbgcicqol/ 8qatraaagedawieawufbaqaaaf9aqidaaqrbrihmuege1fhbyjxfdkbkaeii0kxwrvs0fakm2jyggkkfhcygroljicokso0nty3odk6q0rfrkdisuptvfvwv1 hzwmnkzwznaglqc3r1dnd4exqdhiwgh4ijipktljwwl5izmqkjpkwmp6ipqrkztlw2t7i5usldxmxgx8jjytlt1nxw19jz2uhi4+ tl5ufo6erx8vp09fb3+pn6/8qahweaawebaqebaqebaqaaaaaaaaecawqfbgcicqol/ 8qatreaagecbaqdbacfbaqaaqj3aaecaxeebsexbhjbuqdhcrmimoeifekrobhbcsmzuvavynlrchyknoel8rcygromjygpkju2nzg5okneruzhselku1rvvl Dywvpjzgvmz2hpann0dxz3ehl6gooehyahiimkkpoulzaxmjmaoqokpaanqkmqsro0tba3ulm6wspexcbhymnk0tpu1dbx2nna4upk5ebn6onq8vp09fb3 +pn6/9oadambaairaxeapwd3pvb99m02a8jslu/ms7jb2iq0rdvtdmoj9s5pye8vw3hz4twni3xsuh6ro91dlertdnUpft3jckahexexbk5b24x1rvrwxtwkgsziy7nhynohdac9wccepevnv4oehfexg7xpafeo1ez80tr9oazr0upjgwvieggvjz36c8pnks5tgabi7bnrxjpu /fwk3gnhq5dikjvbyk0ef3aym6fgsx3liawabono4b5qxj468n6vdfbx/ iwwu79zbbvhafvzxljxgqx7nbzxjbxxj6x4l1rxtqnh7ubhtdhnigt5b8idqkty7fughpkttyzk4gc88jhnp4ifd3v/glvhd2/h/ t9p1i3x5d1bqos4hrwhllnpwcgj6cuo8v8/6/ufaw3b+v0o/wdexiixrnpt7q10punrnztsfy/li/eoqerxiwdckjofo3nomvttfiv4xa+ k0zunxtdo1s3ufabe6lwqjczcvkqbxzwr1hok898b+n/e/i7ulbsl7sbefufd+97g3f0ydlj/q1zgeblqxzwckg8yxwn8vv7b8m/edw/ 41ulowtjswiit7l7hsu7tmom8qxgb6darrndm/waogatpuvz/ aogpedq13r9jjempary2af9ga5uejg7gczyjnhopsmwnilq9qtli7stz065trybp5obphsiyzlmbwvaj5ry2+ 8hx3xrkudzuj9fnthdjzwvwtg48/pwzw8zofbixor94gcgnh/a994g1pw5qxwvjntdcg4ejvnjdxp8zsaezgauxnb/1gqddv1t/x+ yaapp1poq48rahaadbqfzronq2vwcq3ml0ixyhr8re4pq9psrtrd219ax3vpcrxfvkn0cslh0ceoi4ir5z+h+ua2+ lxhw0ftre4mhvikitxbjihdf5ux5bdasjkssd+9gae3uq1fxbemsefmfhh+j38td/amf2cvts3wwtb2z0ffunmv7m/wq3oj3unfcabdpc2/ 6exi/t3x1q/sgfudy0m013r7vs7+pzlw6jmci5wchud2i6g+oq9rsatvmno2p5z8kphvc/d6hvhe3nvctxcy+w8jb/afs525ybhsscgz+pr0vywrigbbhajwcfrs0vtbykrhkfr4e8t+gfehilx1a3vgl9cjninigge6szsa+ 3eted5zeyn8c4qjdvtvjr4dsrftfu7jyl8sxkznmofuhkpjgb2dwxjhy8k9f3eyuulzjlorw+qpq+rirw2gsrsg1tokit4ueccadarqmaaemk5 +w8c6np3je/ 8ww6zdub2ly5flaxr93lkmzbo0z59fwuloo636h0sc7yecdh03xnqhim3suahfrcouejyvtjuyycdozya6kiijpyotwooooakkkkaciiigaooooakkkkaciii gaooooa/9k= " /></results>[ 00:25:58.780389] [user.cpp] [932] write to  picture file:18237179590.jpg Graphics Verification Code has been generated, the file name is: 18237179590.jpg Please enter the Graphics verification code: VYYW The identification code you entered is:vyyw[  00:26:25.955548] [user.cpp] [1464] getpublicip:10.0.0.1[ 00:26:25.955585] [user.cpp]  [2083] Register renew time:600[ 00:26:25.955642] [User.cpp] [1270]  sending to:18237179590[ 00:26:25.955657] [user.cpp] [1276] run,using cmcc  mobile:18237179590[ 00:26:25.956545] [user.cpp] [2228] wait send result[  00:26:25.961531] [user.cpp] [2228] wait send result[ 00:26:25.967620] [user.cpp] [2228]  Wait send resultsip-c/4.0 280 send sms okt: sip:[email protected];p = 20472i: 2q: 1 mrq: 75003170806l: 112xi: 330a2e0248f142f5a3c15a0602524436

When the second or later execution of the command is saved in the cache file, so you do not have to enter a verification code here

[[email protected] fetion]# ./fetion --mobile=18237179590 --pwd=qinh132619 --to= 18237179590 --msg-utf8= "Qinheng to allentuns"  --debug[ 00:41:24.719329] [ USER.CPP]&NBSP;[1924]&NBSP;AFTER&NBSP;CONNECTED&NBSP;TO&NBSP;&NBSP;221.176.31.1:8080[&NBSP;00:41:25.128726] &NBSP;[USER.CPP]&NBSP;[1464]&NBSP;GETPUBLICIP:10.0.0.1[&NBSP;00:41:25.128765]&NBSP;[USER.CPP]&NBSP;[2083]  Register renew time:600[ 00:41:25.128807] [User.cpp] [1270] sending  To:18237179590[ 00:41:25.128821] [user.cpp] [1276] run,using cmcc mobile :18237179590[ 00:41:25.133096] [user.cpp] [2228] wait send result[  00:41:25.133885] [user.cpp] [2228] wait send result[ 00:41:25.137441] [ USER.CPP]&NBSP;[2228]&NBSP;WAIT&NBSP;SEND&NBSP;RESULTSIP-C/4.0&NBSP;280&NBSP;SEND&NBSP;SMS&NBSP;OKT:&NBSP;SIP: [email protected];p =20472i: 2q:  1 mrq: 75003437798l: 112xi: c97076e9c01345eaaca6b5894e3b79df 


Check your SMS Notifications

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/4B/25/wKioL1QoOzjiNtlAAAGEqwwkZJU860.jpg "title=" 6.png " alt= "Wkiol1qoozjintlaaageqwwkzju860.jpg"/>


Error Resolution:

1, as shown

Fetion is for mobile phone side, if the Fetion client with Unicom will appear the following error, please friends remember

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/4B/19/wKioL1QoDCHys0FzAALyUTAzSxc267.jpg "title=" 3.png " alt= "Wkiol1qodchys0fzaalyutazsxc267.jpg"/>



Fetion Alarm Please refer to:

http://www.it-adv.net/fetion Robot Website:

http://dl528888.blog.51cto.com/2382721/770684 Study Blog

http://school.21tx.com/2013/10/18/10247.shtml resolving dependencies for installation Fetino

http://bbs.it-adv.net/viewthread.php?action=printable&tid=156 Fetion Official website To resolve the method of sending failure

Because I sent a notification when the error, the following errors, the original has not been resolved. And I hope the great God helps

Http://www.linuxidc.com/Linux/2012-08/69346.htm Verification Code Help


This article is from the "Zheng" blog, make sure to keep this source http://467754239.blog.51cto.com/4878013/1559168

Linux uses SendMail and fetion to send alarm notifications

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.