亚洲精品日韩欧美_欧美二区乱c少妇_中文字幕日韩在线播放_日韩不卡中文字幕

English |
  • 美國VPS主機(jī)推薦
  • |
  • 代購服務(wù)
  • |
  • 10美元以下VPS
  • |
  • VPS新手指南/教程
  • |
  • 留言板
  • |
  • 關(guān)于
  • | 登錄 |

    Monit - Linux系統(tǒng)進(jìn)程、文件、目錄和設(shè)備的監(jiān)測(cè)軟件

    2011年07月21日 上午 | 作者:VPS偵探

    Monit是一款功能非常豐富的進(jìn)程、文件、目錄和設(shè)備的監(jiān)測(cè)軟件,適用于Linux/Unix平臺(tái)。 它可以自動(dòng)修復(fù)那些已經(jīng)停止運(yùn)作的程序,特使適合處理那些由于多種原因?qū)е碌能浖e(cuò)誤,同時(shí)Monit 包含一個(gè)內(nèi)嵌的 HTTP(S) Web 界面,你可以使用瀏覽器方便地查看 Monit 所監(jiān)視的服務(wù)器。

    Monit官網(wǎng):http://mmonit.com/monit/

    1、安裝Monit

    CentOS可以到:http://pkgs.repoforge.org/monit/?下載對(duì)應(yīng)位數(shù)rpm包安裝。

    32位:wget -c?http://pkgs.repoforge.org/monit/monit-5.2.5-1.el5.rf.i386.rpm;rpm -ivh?monit-5.2.5-1.el5.rf.i386.rpm
    64位:wget -c?http://pkgs.repoforge.org/monit/monit-5.2.5-1.el5.rf.x86_64.rpm;rpm -ivh?monit-5.2.5-1.el5.rf.x86_64.rpm

    Debian可以直接:apt-get install monit 安裝。

    2、修改配置文件

    CentOS用RPM包安裝的話配置文件在: /etc/monit.conf;Debian apt-get安裝的話配置文件在:/etc/monit/monitrc;

    下面是一個(gè)簡(jiǎn)單的例子,配置文件中已經(jīng)包含了大量的例子,可以看配置文件參考。

    set daemon  120        #設(shè)置檢測(cè)時(shí)間
    set logfile /var/log/monit.log        #monit日志
    set alert www@vpser.net with reminder on 1 cycle  #出現(xiàn)1次錯(cuò)誤的時(shí)候發(fā)報(bào)警郵件到指定的郵箱
    set mailserver mail.vpser.net     #設(shè)置郵件服務(wù)器
    set httpd port 2812 and            # 設(shè)置http監(jiān)控頁面的端口
         use address 74.207.246.99   # http監(jiān)控頁面的IP
         allow localhost               # 允許本地訪問
         allow 123.23.45.0/24           # 允許此IP段訪問
         #allow 0.0.0.0/0.0.0.0       # 允許所有IP訪問
         allow username:password     #設(shè)置訪問用戶名密碼
    
    #檢測(cè)sshd服務(wù)
    check process sshd with pidfile /var/run/sshd.pid
       start program  "/etc/init.d/sshd start"
       stop program  "/etc/init.d/sshd stop"
       if failed port 22 protocol ssh then restart
       if 5 restarts within 5 cycles then timeout
    
    #檢測(cè)mysql服務(wù)
    check process mysql with pidfile /usr/local/mysql/var/vpser.pid
       group database
       start program = "/etc/init.d/mysql start"
       stop program = "/etc/init.d/mysql stop"
       if failed host 127.0.0.1 port 3306 then restart
       if 5 restarts within 5 cycles then timeout
    
    #檢測(cè)nginx服務(wù)
     check process nginx with pidfile /usr/local/nginx/logs/nginx.pid
        start program = "/etc/init.d/nginx start"
        stop program  = "/etc/init.d/nginx stop"
        if failed host m.0794baidu.com port 80 protocol http
           then restart

    配置中的pid及啟動(dòng)、關(guān)閉腳本的路徑一定要是全路徑,且參數(shù)一定要正確否則會(huì)造成無法正常檢測(cè)或正常啟動(dòng)。

    看了一下php-fpm貌似用Monit還不是很好監(jiān)控。

    如果添加了http可以直接使用http://ip:2812 進(jìn)行管理。

    3、啟動(dòng)/停止Monit

    CentOS:

    chkconfig monit on //加入開機(jī)啟動(dòng)
    /etc/init.d/monit {start|stop|restart|force-reload|syntax}

    Debian:

    編輯:/etc/default/monit 文件,查找 startup=0 ,將0改為1,保存。
    update-rc.d -f monit defaults
    /etc/init.d/monit {start|stop|restart|force-reload|syntax}

    當(dāng)然如果使用監(jiān)控寶服務(wù)也不錯(cuò),只不過免費(fèi)版的檢測(cè)間隔長(zhǎng)些、對(duì)檢測(cè)的數(shù)量有限制。

    如有問題歡迎反饋,歡迎到VPS論壇交流。

    原創(chuàng)文章,謝絕轉(zhuǎn)載!

    >>轉(zhuǎn)載請(qǐng)注明出處:VPS偵探 本文鏈接地址:http://m.0794baidu.com/manage/monit.html
    VPS偵探推薦:
    遨游主機(jī)、VultrLinode搬瓦工、LOCVPS、KVMLA、HOSTKVM、HostXen80VPS美國VPS主機(jī),國內(nèi)推薦騰訊云、阿里云。

    發(fā)表評(píng)論

    *必填

    *必填 (不會(huì)被公開)

    評(píng)論(13條評(píng)論)

    1. ???????????說道:

      Thank you for information I translated to English. I need to know about VPS. and I see you page.

    2. VPSer說道:

      @Mr.Cong, 這個(gè)好像不行,看配置文件的例子只能檢查gid、uid 權(quán)限、時(shí)間戳

    3. Mr.Cong說道:

      如何監(jiān)控目錄,并生成日志(包括目錄里面什么文件被修改了)?
      比如我需要監(jiān)控 /home/wwwroot 目錄

    4. VPSer說道:

      @max, 如果你啟用了include 就需要把那幾個(gè)目錄手動(dòng)創(chuàng)建上。

    5. max說道:

      我是按照你上面的方法安裝的,如果目錄不存在是應(yīng)該手動(dòng)創(chuàng)建目錄嗎?請(qǐng)指教

    6. VPSer說道:

      @max, include 的目錄文件不存在
      /var/monit/id 目錄或文件不存在

    7. max說道:

      monit無法啟動(dòng)

      Starting monit: /etc/monit.conf:246: Warning: include files not found '/etc/monit.d/*'
      monit: Error opening the idfile '/var/monit/id' -- No such file or directory

      請(qǐng)問是什么意思?

    8. 小七說道:

      占用1M 這個(gè)給力 試試

    9. 黃頁大全說道:

      貌似不錯(cuò)
      多多學(xué)習(xí)啊

    10. VPSer說道:

      @centos, 占的很少,測(cè)試的一臺(tái)vps占了1MB左右

    11. VPSer說道:

      @小陳, rpm -qa | grep monit
      rpm -e 上面返回的名字
      debian:apt-get remove monit

    12. centos說道:

      這個(gè)占多內(nèi)存不

    13. 小陳說道:

      不會(huì)用 , 球卸載教程

    主站蜘蛛池模板: 亚洲综合日韩在线| 日本亚洲欧美三级| 久久中文字幕视频| 国产在线拍揄自揄视频不卡99| 国产高清自拍99| 日韩在线播放一区| 精品国产综合久久| 欧美亚洲另类激情另类| 亚洲综合一区二区不卡| 国产精品91一区| 国产精品久久久久久久久久久久| 欧美成人中文字幕在线| 日韩视频免费中文字幕| 亚洲综合激情五月| 91九色精品视频| 国产精品一区二区免费看| 精品国偷自产在线视频| 欧美乱人伦中文字幕在线| 日韩国产精品一区二区三区| 中文字幕一区综合| zzijzzij亚洲日本成熟少妇| 国产日韩欧美91| 国产视频不卡| 国产精品久久久久久久久久久久午夜片| 激情六月天婷婷| 国产精品免费视频xxxx| 久久综合婷婷综合| 久久久久亚洲精品国产| 两个人的视频www国产精品| 欧美激情精品久久久久久| 欧美亚洲国产精品| 美女av一区二区三区| 日本黄网免费一区二区精品| 日韩一区二区高清视频| 日本在线播放一区| 欧美精品日韩三级| 久久精品小视频| 国产在线精品日韩| 国产精品视频在线播放| 国产精品美女午夜av| 国产成人精品自拍|