| 2025 10,31 11:59 | |
| 2025 01,07 21:33 | |
| 古い環境なだけに面倒なことばっかり起きる やたら、httpdが元旦に落ちているという謎な現象 そんなわけで、httpdも監視対象にする vi /etc/monit.d/httpd check process httpd with pidfile /var/run/httpd/httpd.pid   start program = "/bin/systemctl start httpd" with timeout 60 seconds   stop program  = "/bin/systemctl stop httpd"   if failed port 80 for 2 cycles then restart   if failed port 443 for 2 cycles then restart   if 5 restarts within 5 cycles then timeout check processの行でpidファイルの存在確認。pidファイルが存在しないか、実行中のプロセスのPID番号が含まれていない場合startメソッドを呼び出す。 サービスを起動するコマンド。後ろの「with timeout 60 seconds」は起動タイムアウト時間を指定。 サービスを停止するコマンド。 80ポートへ2回連続でアクセスできなければサービスを再起動する。 443ポートへ2回連続でアクセスできなければサービスを再起動する。 5サイクル中5回再起動が行われた場合にそれ以上再起動を行わず、監視を止める。(再起動できない場合いつまでも再起動を繰り返さない処置です。) https://www.conversion.co.jp/tecblog/20210107/ PR | |
| コメント | 
| コメント投稿 | 
|  | 
| 忍者ブログ [PR] | 





