linux:monit
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| linux:monit [2023/03/22 23:56] – created 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 ==== | ||
| + | |||
| + | Unit File erstellen: | ||
| + | <code bash> | ||
| + | sudo nano / | ||
| + | </ | ||
| + | |||
| + | ''/ | ||
| + | < | ||
| + | # This file is systemd template for monit service. To | ||
| + | # register monit with systemd, place the monit.service file | ||
| + | # to the / | ||
| + | # using systemctl (see below). | ||
| + | # | ||
| + | # Enable monit to start on boot: | ||
| + | # | ||
| + | # | ||
| + | # Start monit immediately: | ||
| + | # | ||
| + | # | ||
| + | # Stop monit: | ||
| + | # | ||
| + | # | ||
| + | # Status: | ||
| + | # | ||
| + | |||
| + | [Unit] | ||
| + | Description=Pro-active monitoring utility for unix systems | ||
| + | After=network-online.target | ||
| + | Documentation=man: | ||
| + | |||
| + | [Service] | ||
| + | Type=simple | ||
| + | KillMode=process | ||
| + | ExecStart=/ | ||
| + | ExecStop=/ | ||
| + | ExecReload=/ | ||
| + | Restart = on-abnormal | ||
| + | StandardOutput=null | ||
| + | |||
| + | [Install] | ||
| + | WantedBy=multi-user.target | ||
| + | </ | ||
| + | |||
| + | Monit aktivieren und starten: | ||
| + | < | ||
| + | sudo systemctl enable monit.service | ||
| + | sudo systemctl start monit.service | ||
| + | sudo systemctl status monit.service | ||
| + | </ | ||
| ===== Konfiguration ===== | ===== Konfiguration ===== | ||
| + | |||
| + | Monit Config File bearbeiten: | ||
| + | <code bash> | ||
| + | sudo nano / | ||
| + | </ | ||
| + | |||
| ''/ | ''/ | ||
| + | < | ||
| + | # reporting to mmonit | ||
| + | set mmonit http:// | ||
| + | |||
| + | # webservice | ||
| + | set httpd port 2812 and | ||
| + | use address localhost | ||
| + | allow localhost | ||
| + | allow admin: | ||
| + | </ | ||
| + | |||
| + | give the appropriate permissions | ||
| + | < | ||
| + | sudo chmod 600 / | ||
| + | </ | ||
| + | |||
| + | ===== Befehle ===== | ||
| + | |||
| + | < | ||
| + | sudo monit reload | ||
| + | sudo monit status | ||
| + | </ | ||
| + | |||
| + | '' | ||
| <code bash> | <code bash> | ||
| - | sudo cp /etc/monit/monitrc /etc/monit/conf-enabled/monit.conf | + | Usage: |
| + | 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.1679525778.txt.gz · Last modified: (external edit)