70 |
</code> |
</code> |
71 |
<br> |
<br> |
72 |
<p> |
<p> |
73 |
<li><b>Execute programs via the <i>alert</i> statement.</b><p> |
<li><b>Execute arbitary programs.</b><p> |
|
This functionality will allow you to start any program in an alert |
|
|
statement, like so: |
|
74 |
|
|
75 |
<pre> |
This functionality will allow you to start an arbitary program in a |
76 |
alert "/usr/bin/snpp -m "Monit: $EVENT for $PROGRAM on $HOST" rladams" |
timestamp or resource statement. Examples: |
|
</pre> |
|
|
|
|
|
and because the alert statement is associated with events you may even |
|
|
be more specific, like so: |
|
77 |
|
|
78 |
<pre> |
<pre> |
79 |
alert "/bin/program" on { checksum } |
if timestamp /usr/local/apache/conf/httpd.conf was changed |
80 |
</pre> |
then exec "/etc/init.d/apache restart" |
81 |
|
|
82 |
This version of the alert statement is going to be a "fire-and-forget" |
if mem > 100 Mb then exec "/<path>/program argument" |
83 |
operation. That is, you cannot check the return value from the script |
as UID nobody and with GID nobody |
|
and do stuff like this |
|
|
<pre> |
|
|
if alert "myprogram" > 0 then |
|
|
do stuff |
|
|
else |
|
|
do other stuff |
|
|
</pre> |
|
|
Never the less we think this will cover most of the need for calling |
|
|
programs outside monit without implementing a regular pluggin |
|
|
architecture, which we really do not want to implement. |
|
84 |
</pre> |
</pre> |
85 |
|
|
86 |
<p> |
<p> |
87 |
<code> |
<code> |
88 |
<table border=0 cellspacing=5> |
<table border=0 cellspacing=5> |
91 |
</tr> |
</tr> |
92 |
<tr> |
<tr> |
93 |
<td width=50%>Progress:</td> |
<td width=50%>Progress:</td> |
94 |
<td width=50% bgcolor="#0000aa" align=center><b><font color=#ffffff>0%</font></b></td> |
<td width=50% bgcolor="green" align=center><b><font color=#ffffff>100%</font></b></td> |
95 |
</tr> |
</tr> |
96 |
<tr> |
<tr> |
97 |
<td width=50%>Importance:</td><td width=50%>HIGH</td> |
<td width=50%>Importance:</td><td width=50%>HIGH</td> |