Difference between revisions of "Package:Monit"

(initial commit)
 
 
Line 9: Line 9:
 
=== Emerge ===
 
=== Emerge ===
 
To install {{Package|app-admin/monit}}:
 
To install {{Package|app-admin/monit}}:
<console>###i##emerge monit</console>
+
<console>###i## emerge monit</console>
  
 
== Configuration ==
 
== Configuration ==
Line 25: Line 25:
 
Users added to the monit or users group will be able to manipulate monit through the web interface.
 
Users added to the monit or users group will be able to manipulate monit through the web interface.
  
<console>###i##gpasswd -a $USER monit</console>
+
<console>###i## gpasswd -a $USER monit</console>
<console>###i##gpasswd -a $USER users</console>
+
<console>###i## gpasswd -a $USER users</console>
  
 
{{fancywarning|passwords can be streamed to monits web interface, disable it all together after it is setup}}
 
{{fancywarning|passwords can be streamed to monits web interface, disable it all together after it is setup}}
Line 49: Line 49:
 
to start monit immediately after changing inittab
 
to start monit immediately after changing inittab
  
<console>###i##telinit q</console>
+
<console>###i## telinit q</console>
  
 
=== OpenRC ===
 
=== OpenRC ===
 
{{fancynote|prefer inittab method over rc services}}
 
{{fancynote|prefer inittab method over rc services}}
 
To start the service at boot.
 
To start the service at boot.
<console>###i##rc-update add monit default</console>
+
<console>###i## rc-update add monit default</console>
 
To start the service immediately.
 
To start the service immediately.
<console>###i##/etc/init.d/monit start</console>
+
<console>###i## /etc/init.d/monit start</console>
  
 
==== Monitoring Monit ====
 
==== Monitoring Monit ====

Latest revision as of 06:36, June 27, 2014

app-admin/monit


Source Repository:Gentoo Portage Tree

Summary: a utility for monitoring and managing daemons or similar programs running on a Unix system.


News

Drobbins

How We're Keeping You At the Center of the Funtoo Universe

Read about recent developments that keep you, our users, at the forefront of our focus as Funtoo moves forward.
10 April 2015 by Drobbins
Mgorny

New OpenGL management in Funtoo

Funtoo is switching to an improved system for managing multiple OpenGL providers (Mesa/Xorg, AMD and NVIDIA). The update may involve blockers and file collisions.
30 March 2015 by Mgorny
Drobbins

Subarch Profiles are coming...

Subarch profiles are on their way! Learn more here.
29 March 2015 by Drobbins
View More News...

Monit

Tip

This is a wiki page. To edit it, Create a Funtoo account. Then log in and then click here to edit this page. See our editing guidelines to becoming a wiki-editing pro.

Monit is a utility for managing and monitoring processes, programs, files, directories and filesystems on a UNIX system.

Installation

Emerge

To install Monit:

# emerge monit

Configuration

Config file of monit resides in /etc/monitrc. And there is a item to specify a config directory. Uncomment if needed.

/etc/monitrc - config dir
## It is possible to include additional configuration parts from other files or
## directories.
#
#  include /etc/monit.d/*
#

Users

Users added to the monit or users group will be able to manipulate monit through the web interface.

# gpasswd -a $USER monit
# gpasswd -a $USER users
Warning

passwords can be streamed to monits web interface, disable it all together after it is setup

Important

for security purposes change this entry

/etc/monitrc
allow admin:monit

Boot Services

inittab

Note

this is the preferred method to run monit

/etc/inittab - auto restart monit in case of failure
ca:12345:ctrlaltdel:/sbin/shutdown -r now

 # Run monit in standard runlevels
 mo:2345:respawn:/usr/bin/monit -Ic /etc/monitrc

# Used by /etc/init.d/xdm to control DM startup.

to start monit immediately after changing inittab

# telinit q

OpenRC

Note

prefer inittab method over rc services

To start the service at boot.

# rc-update add monit default

To start the service immediately.

# /etc/init.d/monit start

Monitoring Monit

This hourly cron script will check to make sure monit has not crashed. As this uses pgrep, make sure to not name it monit.

/etc/cron.hourly/moncheck
#!/bin/bash
if ! pgrep monit >/dev/null;then
rc-service monit restart
fi

Pidfile Check

Monit relies upon pid files. For daemons that do not create a pidfile: a work around is needed.

Examples

Auto Restart Mysql

/etc/monitrc - auto restart mysql
check process mysql with pidfile /var/run/mysqld/mysqld.pid
    start program = "/bin/bash -c 'rc-service mysql start'"
    stop program  = "/bin/bash -c 'rc-service mysql stop'"

Web Interface

Navigate to http://localhost:2812/ & login using your edited configuration line or admin / monit if you have not changed it yet.