linux:monit
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
linux:monit [2023/03/23 01:55] – [Monit als Dienst einrichten] admin | linux:monit [2024/02/17 19:03] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 5: | Line 5: | ||
sudo apt update | sudo apt update | ||
sudo apt install monit | sudo apt install monit | ||
- | sudo systemctl start monit | ||
- | sudo systemctl enable monit | ||
- | sudo systemctl status monit | ||
</ | </ | ||
==== Monit als Dienst einrichten ==== | ==== Monit als Dienst einrichten ==== | ||
- | ''/ | + | Unit File erstellen: |
+ | <code bash> | ||
+ | sudo nano / | ||
+ | </ | ||
+ | |||
+ | ''/ | ||
< | < | ||
# This file is systemd template for monit service. To | # This file is systemd template for monit service. To | ||
Line 39: | Line 41: | ||
Type=simple | Type=simple | ||
KillMode=process | KillMode=process | ||
- | ExecStart=/usr/local/bin/monit -I | + | ExecStart=/ |
- | ExecStop=/usr/local/bin/monit quit | + | ExecStop=/ |
- | ExecReload=/usr/local/bin/monit reload | + | ExecReload=/ |
Restart = on-abnormal | Restart = on-abnormal | ||
StandardOutput=null | StandardOutput=null | ||
Line 57: | Line 59: | ||
===== Konfiguration ===== | ===== Konfiguration ===== | ||
- | '' | + | Monit Config File bearbeiten: |
+ | <code bash> | ||
+ | sudo nano /etc/monit/monitrc | ||
+ | </ | ||
+ | |||
+ | ''/ | ||
< | < | ||
+ | # reporting to mmonit | ||
+ | set mmonit http:// | ||
+ | |||
+ | # webservice | ||
set httpd port 2812 and | set httpd port 2812 and | ||
use address localhost | use address localhost | ||
allow localhost | allow localhost | ||
allow admin: | allow admin: | ||
+ | </ | ||
+ | |||
+ | give the appropriate permissions | ||
+ | < | ||
+ | sudo chmod 600 / | ||
+ | </ | ||
+ | |||
+ | ===== Befehle ===== | ||
+ | |||
+ | < | ||
+ | sudo monit reload | ||
+ | sudo monit status | ||
+ | </ | ||
+ | |||
+ | '' | ||
+ | <code bash> | ||
+ | Usage: monit [options]+ [command] | ||
+ | Options are as follows: | ||
+ | -c file Use this control file | ||
+ | -d n Run as a daemon once per n seconds | ||
+ | -g name Set group name for monit commands | ||
+ | -l logfile | ||
+ | -p pidfile | ||
+ | -s statefile | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | -H [filename] Print SHA1 and MD5 hashes of the file or of stdin if the | ||
+ | | ||
+ | | ||
+ | | ||
+ | Optional commands are as follows: | ||
+ | start all - Start all services | ||
+ | start < | ||
+ | stop all - Stop all services | ||
+ | stop < | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
</ | </ |
linux/monit.1679532910.txt.gz · Last modified: 2024/02/17 19:03 (external edit)