Show pageBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Monit ====== [[https://mmonit.com/monit/documentation/monit.html|Manual]] ===== Syntax ===== ==== external hosts ==== <code>check host example address example.org if failed port 22 protocol ssh then alert if failed host cloud.example.org port 80 protocol http then alert</code> ===== Templates ===== ==== Samba ==== <file - /etc/monit/conf-available/samba># Monit SMB Server Monitoring check process Samba with pidfile "/var/run/samba/smbd.pid" start program = "/etc/init.d/smbd start" stop program = "/etc/init.d/smbd stop" if failed host 127.0.0.1 port 139 type tcp for 2 cycles then restart if 2 restarts within 3 cycles then unmonitor</file> ==== NFS ==== <file - /etc/monit/conf-available/nfs># Monit NFS Server Monitoring check process NFS with pidfile /var/run/rpc.statd.pid start program = "/etc/init.d/nfs-kernel-server start" stop program = "/etc/init.d/nfs-kernel-server stop" if failed host 127.0.0.1 port 2049 type tcp for 2 cycles then restart if 2 restarts within 3 cycles then unmonitor</file> ==== Btrfs ==== <file bash /opt/scripts/btrfsck_data.sh>#!/bin/bash /bin/btrfs device stats /mnt/data | grep -vE ' 0$'</file> <file - /etc/monit/conf-available/btrfsck>check program btrfsck_data with path /opt/scripts/btrfsck_data.sh if status != 1 then alert</file> Last modified: 2024-07-05 14:31