vortistart.blogg.se

Monit file
Monit file







monit file
  1. MONIT FILE INSTALL
  2. MONIT FILE SOFTWARE
  3. MONIT FILE CODE
  4. MONIT FILE PASSWORD
  5. MONIT FILE DOWNLOAD

Private nameserver checks (only necessary if you are running private nameservers from your DV server):Ĭheck process named with pidfile /var/named/chroot/var/run/named/named.pid.Cron check (to ensure cron jobs are running):Ĭheck process crond with pidfile "/var/run/crond.pid".Stop program "/etc/init.d/psa-spamassassin stop" Start program "/etc/init.d/psa-spamassassin start" SpamAssassin checks (to ensure SpamAssassin restarts after periods of high CPU use):Ĭheck process spamd with pidfile /var/run/spamd/spamd_full.pid.If failed port 995 type tcpssl sslauto protocol pop then restart If failed port 110 type tcp protocol pop then restartĬheck process pop3d-ssl with pidfile "/var/run/pop3d-ssl.pid" If failed port 993 type tcpssl sslauto protocol imap then restartĬheck process pop3d with pidfile "/var/run/pop3d.pid" If failed port 143 type tcp protocol imap then restartĬheck process imapd-ssl with pidfile "/var/run/imapd-ssl.pid" Stop program = "/etc/init.d/courier-imap stop" Start program = "/etc/init.d/courier-imap start" Mail server check for incoming mail responsiveness (IMAP, IMAP-SSL, POP3,and POP3-SSL):Ĭheck process imapd with pidfile "/var/run/imapd.pid".If failed port 25 protocol smtp then restart Stop program = "/bin/bash -c '/etc/init.d/qmail stop & /etc/init.d/xinetd stop'" Start program = "/bin/bash -c '/etc/init.d/qmail start & /etc/init.d/xinetd start'" SMTP and qmail server check (for overall outgoing mail health and sending functionality):Ĭheck process qmail with pidfile "/var/run/xinetd.pid".If failed port 3306 protocol mysql then restart Start program = "/etc/init.d/mysqld start" Database checks (to ensure databases are responding):Ĭheck process mysqld with pidfile "/var/run/mysqld/mysqld.pid".If 5 restarts within 5 cycles then timeout PassCheck="$(md5sum /etc/psa/.psa.shadow | awk '' /proc/vz/veinfo) port 80 protocol http then restart

MONIT FILE PASSWORD

  • Skip the following commands if you do not want Monit's password to match Plesk's admin password:Ĭat /usr/local/psa/admin/sbin/monit_password_change.sh.
  • NewEmail=\$(echo $1 | perl -pe -p -i -e 's/(set\ alert)+/\1 '\$newEmail'/' /etc/monitrcĬhmod 755 /usr/local/psa/admin/sbin/monit_email_change.sh mysql -u'admin' -p$(cat /etc/psa/.psa.shadow) psa -e"insert into event_handlers values(default,(select id from actions where descr='Update Administrator Information'),0,'root','/usr/local/psa/admin/sbin/monit_email_change ') "
  • Skip the following commands if you do not want Monit's email address to match Plesk's administrator email:Ĭat /usr/local/psa/admin/sbin/monit_email_change.sh.
  • If you manually edited the command above to include different information, skip the corresponding step(s) below. This way, if you change either your Plesk password or your email address, Monit will also be updated.
  • To help things keep manageable, we can now create a few scripts to ensure that this information stays up-to-date.
  • For example, replace /usr/local/psa/bin/admin -show-password with the password of your choice. If you would prefer that either the username or password to be independent of your Plesk login credentials, you'll need to edit the command below accordingly with your own information. Set alert $(mysql -sN -u'admin' -p`cat /etc/psa/.psa.shadow` psa -e'select email from clients where id=1 ')Īllow admin:$(/usr/local/psa/bin/admin -show-password) The command below will pull the username, password, and email address alerts are to be sent to, using information already stored in Plesk:
  • The first thing that Monit needs is a configuration file.
  • MONIT FILE INSTALL

    configure -prefix=/usr -without-pam make make install mkdir /etc/monit.d/

    monit file

    This will also configure Monit without the PAM option.

    MONIT FILE SOFTWARE

    This is primarily to keep an extra degree of separation between Plesk, which lives in /usr/local/psa, and other software on the system. We'll use a fairly vanilla configuration, The following command will change the prefix so it is set to /usr rather than /usr/local (which is what Monit will default to). From here, Monit needs to be built from source.

    MONIT FILE DOWNLOAD

    Then, download and unpack Monit: wget tar zxf monit-5.6.tar.gz rm -f monit-5.6.tar.gz cd monit-5.6

    MONIT FILE CODE

    That way, you always know where to find the temperamental data/source code you use for new installations.įirst, step into the /usr/local/src directory: cd /usr/local/src For organizational purposes, it is good practice to use /usr/local/src.

  • Next, you will want to download and unpack Monit.
  • This can be done with the following command:
  • As a prerequisite to installing Monit, you'll want to make sure you have "development tools" installed.
  • Monit is designed to make babysitting any resulting up-time issues during your troubleshooting much less painful, but it will not automatically fix an ongoing issue. Installing Monit will not fix the core problems that cause system services to go unresponsive.









    Monit file