隨筆 - 0, 文章 - 264, 評論 - 170, 引用 - 0
          數據加載中……

          監控系統服務和端口,異常時實現自動重啟

          詳見:http://www.51testing.com/html/86/n-214186.html

          示例,監聽ssh服務,如果停止則自動重啟服務,步驟如下:
          1、vi /etc/monit.d/sshd.monit。
          2、撰寫內容,如下:
          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
          3、如果要設置monit的相關參數,比如多長時間檢測一次,請修改/etc/monit.conf,示例文件如下:
          set daemon 300

          set logfile /var/log/monit.log
          set idfile /var/monit/id
          set statefile /var/monit/state

          set httpd port 2812 and use address 127.0.0.1
              allow 127.0.0.1
              allow surfront:surfront

          check system 127.0.0.1

          include /etc/monit.d/*.monit
          4、重啟monit服務,/etc/init.d/monit restart。
          5、完畢,monit的相關日志位于/var/log/monit.log。

          posted on 2013-03-01 17:08 小一敗涂地 閱讀(3030) 評論(0)  編輯  收藏 所屬分類: linux相關性能調優相關surfront問題清單

          主站蜘蛛池模板: 南阳市| 杭州市| 蓬安县| 深水埗区| 苏尼特左旗| 梧州市| 兰西县| 靖边县| 邢台县| 大理市| 汾阳市| 竹山县| 潼南县| 宣汉县| 昌江| 漳平市| 益阳市| 龙里县| 金阳县| 黑水县| 开平市| 吉林省| 溧水县| 若羌县| 瓮安县| 阜宁县| 精河县| 邹城市| 盐城市| 兰坪| 安阳县| 宁晋县| 响水县| 永川市| 莎车县| 巴彦县| 三明市| 砚山县| 黄陵县| 高阳县| 黔南|