Direktori Artikel
Perangkat lunak pemantauan Monit gagal memulai pemantauan.

Monit memulai proses pemantauan dan menghilang, meminta monit.service faiLED.
Setelah menginstal perangkat lunak pemantauan Monit di panel kontrol CWP (CWP7) , proses pemantauan Monit menghilang, dan pesan "monit.service failed" muncul.
Perlu dicatat bahwa upaya telah dilakukan untuk mengaktifkansystemctl enable monit
[root@stage-web-1 vagrant]# systemctl status monit
monit.service - Pro-active monitoring utility for unix systems
Loaded: loaded (/usr/lib/systemd/system/monit.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2017-06-01 16:37:00 UTC; 6min ago
Process: 1131 ExecStop=/usr/bin/monit quit (code=exited, status=1/FAILURE)
Process: 1079 ExecStart=/usr/bin/monit -I (code=exited, status=1/FAILURE)
Main PID: 1079 (code=exited, status=1/FAILURE)
Jun 01 16:37:00 stage-web-1 systemd[1]: Started Pro-active monitoring utility for unix systems.
Jun 01 16:37:00 stage-web-1 systemd[1]: Starting Pro-active monitoring utility for unix systems...
Jun 01 16:37:00 stage-web-1 monit[1079]: Error opening the log file '/var/www/html/nfs/monit/stage-web-1.log' for writing -- No such file or directory
Jun 01 16:37:00 stage-web-1 systemd[1]: monit.service: main process exited, code=exited, status=1/FAILURE
Jun 01 16:37:00 stage-web-1 monit[1131]: Error opening the log file '/var/www/html/nfs/monit/stage-web-1.log' for writing -- No such file or directory
Jun 01 16:37:00 stage-web-1 systemd[1]: monit.service: control process exited, code=exited status=1
Jun 01 16:37:00 stage-web-1 systemd[1]: Unit monit.service entered failed state.
Jun 01 16:37:00 stage-web-1 systemd[1]: monit.service failed.Fakta menunjukkan bahwa/var/www/html/nfsadalah folder yang dipasang ke drive jaringan melalui NFS.
Monit dimulai sebelum NFS, jadi foldernya belum ada, menyebabkan kesalahan monitError opening the log file '/var/www/html/nfs/monit/stage-web-1.log' for writing -- No such file or directory.
Bagaimana mengatasi hilangnya monit startup monitoring proses monit.service gagal.?
Solusinya adalah mengedit/lib/systemd/system/monit.service:
[Unit] Description=Pro-active monitoring utility for unix systems After=network.target [Service] Type=simple ExecStart=/usr/bin/monit -I ExecStop=/usr/bin/monit quit ExecReload=/usr/bin/monit reload [Install] WantedBy=multi-user.target
dan tambahkannfs.serviceUntuk ituAfterDi belakang.Hasil akhirnya terlihat seperti ini:
[Unit]
Description=Pro-active monitoring utility for unix systems
After=network.target nfs.service
[Service]
Type=simple
ExecStart=/usr/bin/monit -I
ExecStop=/usr/bin/monit quit
ExecReload=/usr/bin/monit reload
[Install]
WantedBy=multi-user.target
Monitor Monit sekarang dapat memulai dengan sukses saat boot.
Semoga artikel "Memecahkan masalah proses pemantauan Monit yang hilang saat memulai: monit.service gagal." yang dibagikan di blog Chen Weiliang ( https://www.chenweiliang.com/ ) bermanfaat bagi Anda.
Silakan bagikan tautan artikel ini: https://www.chenweiliang.com/cwl-1422.html
