feat: add monit

This commit is contained in:
dancingCycle 2023-02-24 21:10:34 +01:00
parent d7afed94da
commit 4f1aed6bdb
3 changed files with 82 additions and 2 deletions

View File

@ -10,6 +10,5 @@ sudo passwd <usr>
```
* add user <usr> to sudo group\
```
su -
usermod -a -G sudo <usr>
sudo usermod -a -G sudo <usr>
```

80
doc/monit.md Normal file
View File

@ -0,0 +1,80 @@
# Update The System
```
sudo apt-get update
sudo apt-get upgrade
```
Once your system is updated, restart your system to make these changes take effect with the following command:
```
exit
login
```
# Installing Monit
```
sudo apt install monit --no-install-recommends
```
Once Monit is installed, start Monit service and enable it to start on boot time by running the following command:
```
sudo systemctl start monit
sudo systemctl enable monit
```
You can check the status of Monit service any time by running the following command:
```
systemctl status monit
```
Backup config and enable integrated http daemon
```
sudo cp /etc/monit/monitrc /etc/monit/monitrc-orgnl
sudo vi /etc/monit/monitrc-orgnl
sudo systemctl restart monit
systemctl status monit
```
You can see the status of Monit with the following command:
```
sudo monit status
```
To check configuration files syntax, use:
```
sudo monit -t
```
Check monitored processes summary:
```
sudo monit summary
```
Configure Monit for Apache Service
By default Monit comes with the pre-defined template for some of process and services. You can find these templates in /etc/monit/conf-available/ directory. By default template for Apache is available in Monit. So you will only need to enable it. You can enable it by running the following command:
```
sudo ln -s /etc/monit/conf-available/apache2 /etc/monit/conf-enabled/
```
Next, restart monit servcie to apply these changes with the following command:
```
sudo systemctl restart monit
systemctl status monit
```
To start running all of the monitored programs.
```
sudo monit start all
```

View File

@ -19,6 +19,7 @@
* [Mastarm](doc/mastarm.md)
* [Maven](doc/maven.md)
* [Mongo](doc/mongo.md)
* [Monit](doc/monit.md)
* [MS Teams](doc/ms-teams.md)
* [NextCloud](doc/nextcloud.md)
* [Node](doc/node.md)