Monit » History » Version 5

Anonymous, 08/20/2008 01:37 PM
Installation Guide: Update Monit

1 1 Anonymous
2 5 Anonymous
h1. Monit: Monitoring of Services
3 1 Anonymous
4 5 Anonymous
This installation guide will describe how to set up _independent_ instances of "Monit":http://www.tildeslash.com/monit/ on the master node and each slave.[[br]]
5 5 Anonymous
In the future, "M|Monit":http://www.tildeslash.com/mmonit/ should be considered, which allows easy single point administration and monitoring (from the master node).
6 5 Anonymous
7 5 Anonymous
8 5 Anonymous
9 5 Anonymous
h2. Installation
10 5 Anonymous
11 5 Anonymous
* Add the DAG repository on the _master node_ and _slave nodes_. Enter at the command line as _root_:
12 5 Anonymous
<pre>
13 1 Anonymous
 wget http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
14 1 Anonymous
 rpm -Uvh rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
15 5 Anonymous
</pre>
16 1 Anonymous
17 5 Anonymous
* Install Monit on the _master node_ and _slave nodes_. Enter at the command line as _root_:
18 5 Anonymous
<pre>
19 1 Anonymous
 yum install monit
20 5 Anonymous
</pre>
21 1 Anonymous
22 5 Anonymous
23 5 Anonymous
h2. Configuration
24 5 Anonymous
25 1 Anonymous
 
26 5 Anonymous
27 5 Anonymous
h3. Master node
28 5 Anonymous
29 1 Anonymous
On the master node, the following services will be monitore:[[br]]
30 5 Anonymous
_apache_, _cron_, _devices_ (/ & /home), _mysql_, _nfs_ (/home_nfs), _ntp_, _pbs_mom_, _pbs_sched_, _pbs_server_, _postfix_, _ssh_, _system_, _ypbind_, _yppasswd_, _ypserv_, [[br]]
31 5 Anonymous
and if all _slaves_ are reachable (_ping_)[[br]]
32 5 Anonymous
Currently, the monitoring of _pbs_maui_ is switched off in favour of _pbs_sched_.[[br]]
33 1 Anonymous
34 1 Anonymous
35 5 Anonymous
* Download the [source:Externals/Cluster/procksi_monit.tgz configuration files] from the repository and extract the files. Enter at the command line:
36 5 Anonymous
<pre>
37 1 Anonymous
tar -xvzf procksi_monit.tgz
38 5 Anonymous
</pre>
39 1 Anonymous
40 5 Anonymous
* Copy the files in _./monit/master_ to the appropriate directories (_/etc/_, _/etc/monit.d/_, _/home/procksi/monit/_).
41 1 Anonymous
42 5 Anonymous
* Change permissions of the monit token file. Enter at the command line:
43 5 Anonymous
<pre>
44 1 Anonymous
chown -R procksi.procksi_dev /home/procksi/monit/token
45 5 Anonymous
</pre>
46 1 Anonymous
47 5 Anonymous
* Edit the Apache configuration file _/etc/httpd/conf/httpd.conf_:
48 5 Anonymous
<pre>
49 1 Anonymous
#General Aliases for Monitoring and Testing
50 1 Anonymous
Alias /monit/    "/home/procksi/monit/"
51 1 Anonymous
Alias /ganglia/  "/usr/local/ganglia/html/"
52 1 Anonymous
Alias /trees/    "/home/procksi/trees/"
53 1 Anonymous
54 1 Anonymous
#Conditional Logging: Don't log Ganglia and Monit requests
55 5 Anonymous
[[SetEnvIf]] Request_URI "ganglia" dontlog
56 5 Anonymous
[[SetEnvIf]] Request_URI "^\/monit\/token$" dontlog
57 5 Anonymous
</pre>
58 1 Anonymous
59 5 Anonymous
* Restart the Apache server. Enter at the command line as _root_:
60 5 Anonymous
<pre>
61 1 Anonymous
/sbin/service httpd restart
62 5 Anonymous
</pre>
63 1 Anonymous
64 5 Anonymous
* Make the Monit daemon start at bootup. Enter at the command line as _root_:
65 5 Anonymous
<pre>
66 1 Anonymous
/sbin/chkconfig  monit  on
67 5 Anonymous
</pre>
68 4 Anonymous
69 5 Anonymous
* Start the Monit daemon. Enter at the command line as _root_:
70 5 Anonymous
<pre>
71 1 Anonymous
/sbin/service  monit  start
72 5 Anonymous
</pre>
73 1 Anonymous
74 1 Anonymous
75 5 Anonymous
76 5 Anonymous
h3. Slave nodes
77 5 Anonymous
78 1 Anonymous
On the master node, the following services will be monitore:[[br]]
79 5 Anonymous
_devices_ (/ and /scratch), _nfs_ (/home), _ntp_, _pbs_mom_, _ssh_, _system_, _ypbind_
80 1 Anonymous
81 5 Anonymous
* Download the [source:Externals/Cluster/procksi_monit.tgz configuration files] from the repository and extract the files. Enter at the command line:
82 5 Anonymous
<pre>
83 1 Anonymous
tar -xvzf procksi_monit.tgz
84 5 Anonymous
</pre>
85 1 Anonymous
86 5 Anonymous
* Copy a the files in _./monit/slave_ to the appropriate directories (_/etc/_, _/etc/monit.d/_).
87 1 Anonymous
88 5 Anonymous
* Edit _/etc/monit.d/system_ and set the correct host name for each slave node.
89 1 Anonymous
90 5 Anonymous
* Make the Monit daemon start at bootup. Enter at the command line as _root_:
91 5 Anonymous
<pre>
92 1 Anonymous
/sbin/chkconfig  monit  on
93 5 Anonymous
</pre>
94 1 Anonymous
95 5 Anonymous
* Start the Monit daemon. Enter at the command line as _root_:
96 5 Anonymous
<pre>
97 1 Anonymous
/sbin/service  monit  start
98 5 Anonymous
</pre>
99 1 Anonymous
100 1 Anonymous
101 1 Anonymous
102 5 Anonymous
h2. Online Monitoring
103 1 Anonymous
104 5 Anonymous
105 5 Anonymous
The status of each monitored service, process, file, etc. is available with the Monit's integrated webserver at port 2812 from _localhost_ and selected machines. Username and password can be found at the secret [[[secretAuthentication|authentication]]] page.
106 5 Anonymous
107 5 Anonymous
 || master01 || "|| slave01  || [http://procksi1.cs.nott.ac.uk:2812":http://procksi0.cs.nott.ac.uk:2812]
108 5 Anonymous
 || slave02  || "|| slave03  || [http://procksi3.cs.nott.ac.uk:2812":http://procksi2.cs.nott.ac.uk:2812]
109 1 Anonymous
 || slave04  || [http://procksi4.cs.nott.ac.uk:2812]
110 1 Anonymous
111 1 Anonymous
112 5 Anonymous
113 5 Anonymous
h2. Offline Monitoring
114 5 Anonymous
115 1 Anonymous
116 1 Anonymous
Monit sends alerts to "procksi@cs.nott.ac.uk" if services are unavailable, have been restarted, or similar events.