Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| services:monit [2024/02/22 13:31] – willy | services:monit [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ===== Monit ===== | ||
| - | |||
| - | [[https:// | ||
| - | |||
| - | It can also monitor your filesystems for overload and free space. | ||
| - | |||
| - | Check: [[https:// | ||
| - | |||
| - | ==== Installation ==== | ||
| - | |||
| - | First of all, installing //MonIt// is pretty easy: | ||
| - | <code bash> | ||
| - | emerge -v monit | ||
| - | </ | ||
| - | |||
| - | It is recommended to start monit through the **/ | ||
| - | |||
| - | To start Monit via init, add the following line at the end of your **/ | ||
| - | < | ||
| - | # Run monit in standard runlevels | ||
| - | mo: | ||
| - | </ | ||
| - | |||
| - | ==== Configuration ==== | ||
| - | |||
| - | Monit is configured from it's main config file **/ | ||
| - | < | ||
| - | ... omissis ... | ||
| - | set httpd port 2812 and | ||
| - | use address localhost | ||
| - | allow localhost | ||
| - | #    allow admin: | ||
| - | allow @users | ||
| - | ... omissis ... | ||
| - | ## It is possible to include additional configuration parts from other files or | ||
| - | ## directories. | ||
| - | include / | ||
| - | ... omissis ... | ||
| - | </ | ||
| - | |||
| - | You will place all your custom monitors under **/ | ||
| - | <file - filesystems> | ||
| - | check filesystem Data with path /data | ||
| - | if space usage > 90% then alert | ||
| - | |||
| - | check filesystem Deposito with path /deposito | ||
| - | if space usage > 90% then alert | ||
| - | |||
| - | check filesystem Root with path / | ||
| - | if space usage > 90% then alert | ||
| - | </ | ||
| - | |||
| - | And to monitor some services: | ||
| - | |||
| - | <file - services> | ||
| - | check process sonarr with pidfile / | ||
| - | start program = "/ | ||
| - | stop program | ||
| - | |||
| - | check process radarr with pidfile / | ||
| - | start program = "/ | ||
| - | stop program | ||
| - | |||
| - | check process readarr with pidfile / | ||
| - | start program = "/ | ||
| - | stop program | ||
| - | |||
| - | check process readarr-audiobooks with pidfile / | ||
| - | start program = "/ | ||
| - | stop program | ||
| - | |||
| - | check process lidarr with pidfile / | ||
| - | start program = "/ | ||
| - | stop program | ||
| - | |||
| - | check process prowlarr with pidfile / | ||
| - | start program = "/ | ||
| - | stop program | ||
| - | </ | ||
| - | |||
| - | And to monitor some network links: | ||
| - | |||
| - | <file - networks> | ||
| - | check network ISP1 with interface enp0s20f0u4u4c2 | ||
| - | if link down then alert | ||
| - | if changed link then alert | ||
| - | |||
| - | check network ISP2 with interface enp59s0u2u4c2 | ||
| - | if link down then alert | ||
| - | if changed link then alert | ||
| - | |||
| - | check network internal with interface enp0s31f6 | ||
| - | if link down then alert | ||
| - | if changed link then alert | ||
| - | </ | ||
| - | |||
| - | Feel free to add/edit as needed. | ||
| - | |||
| - | To have monit read the changes, issue the command: | ||
| - | <code bash> | ||
| - | monit reload | ||
| - | </ | ||
| - | |||
| - | |||
| - | ==== Reverse Proxy ==== | ||
| - | |||
| - | Create the following NGINX configuration file: | ||
| - | <file - monit.conf> | ||
| - | location /monit/ { | ||
| - | rewrite ^/ | ||
| - | proxy_ignore_client_abort on; | ||
| - | proxy_pass | ||
| - | proxy_redirect | ||
| - | proxy_cookie_path / /monit/; | ||
| - | } | ||
| - | </ | ||
| - | place it accordingly to [[selfhost: | ||
| - | |||
| - | |||
| - | ==== Start & Test ==== | ||
| - | |||
| - | Now start it manually, no need to reboot the server for this: | ||
| - | <code bash> | ||
| - | telinit q | ||
| - | </ | ||
| - | |||
| - | Open your browser and head to **https:// | ||
| - | |||
| - | |||
| - | |||
| - | |||