WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Server monitoring with email alerts  (Read 4320 times)

Offline remus

  • Sr. Member
  • ****
  • Posts: 371
Re: Server monitoring with email alerts
« Reply #15 on: March 06, 2012, 03:48:37 AM »
monit.tcz has been added to the repo.

I'm going through the monit documentation and it says

Code: [Select]
Using init to start Monit is probably the best way to run Monit if you want to be certain that you always have a running Monit daemon on your system.

To setup Monit to run from init, you can either use the set init statement in Monit's control file or use the -I option from the command line. Here is what you must add to /etc/inittab:

  # Run Monit in standard run-levels
  mo:2345:respawn:/usr/local/bin/monit -Ic /etc/monitrc
After you have modified init's configuration file, you can run the following command to re-examine /etc/inittab and start Monit:

  telinit q
For systems without telinit:

  kill -1 1

I was just adding "sudo monit" to the /opt/bootlocal.sh file and that seems to work just fine.

I found this about init
Definition: Init: The first process to run immediately after the operating system loads. It starts the system in single-user mode or spawns a shell to read the startup files, and opens ports designated as login ports.


Any comments about this would be appreciated.
Live long and prosper.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11213
Re: Server monitoring with email alerts
« Reply #16 on: March 06, 2012, 07:39:43 AM »
Hi remus
That sounds like the right way to go, though you don't need to use sudo.
The calling sequence goes:
Code: [Select]
/init->/etc/inittab->/etc/rcS->/etc/init.d/tc-config->/opt/bootsync.sh->/opt/bootlocal.shIf the sequence fails before reaching  bootsync.sh  or  bootlocal.sh  you won't have network support.
Without the network, monit can not send an email, so placing it in  inittab  won't really buy you anything.
Even if you wanted to modify inittab and add it to your backup, I don't know if the restore function
occurs early enough in the boot process for that to work.