fachinformatiker-wiki

it's easy when it's here

User Tools

Site Tools


linux:monit

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux:monit [2023/03/23 02:04] adminlinux: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 
 </code> </code>
  
 ==== Monit als Dienst einrichten ==== ==== Monit als Dienst einrichten ====
  
-''/lib/systemd/system/monit.service'' erstellen:+Unit File erstellen: 
 +<code bash> 
 +sudo nano /lib/systemd/system/monit.service 
 +</code> 
 + 
 +''/lib/systemd/system/monit.service''
 <code> <code>
 # 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=/bin/monit -I 
-ExecStop=/usr/local/bin/monit quit +ExecStop=/bin/monit quit 
-ExecReload=/usr/local/bin/monit reload+ExecReload=/bin/monit reload
 Restart = on-abnormal Restart = on-abnormal
 StandardOutput=null StandardOutput=null
Line 57: Line 59:
 ===== Konfiguration ===== ===== Konfiguration =====
  
-''/etc/monit/conf-enabled/monit.conf'' erstellen:+Monit Config File bearbeiten: 
 +<code bash> 
 +sudo nano /etc/monit/monitrc 
 +</code> 
 + 
 +''/etc/monit/monitrc''
 <code> <code>
 +# reporting to mmonit
 +set mmonit http://agent:monit@localhost:8080/collector
 +
 +# webservice
 set httpd port 2812 and set httpd port 2812 and
     use address localhost  # only accept connection from localhost (drop if you use M/Monit)     use address localhost  # only accept connection from localhost (drop if you use M/Monit)
     allow localhost        # allow localhost to connect to the server and     allow localhost        # allow localhost to connect to the server and
     allow admin:monit      # require user 'admin' with password 'monit'     allow admin:monit      # require user 'admin' with password 'monit'
 +</code>
 +
 +give the appropriate permissions
 +<code>
 +sudo chmod 600 /etc/monit/monitrc
 </code> </code>
  
Line 111: Line 127:
  validate              - Check all services and start if not running  validate              - Check all services and start if not running
  procmatch <pattern>   - Test process matching pattern  procmatch <pattern>   - Test process matching pattern
-<code>+</code>
linux/monit.1679533493.txt.gz · Last modified: 2024/02/17 19:03 (external edit)