189 |
|
|
190 |
|
|
191 |
|
|
192 |
<li><b>Add support for a user submitted Notify program and/or SNMP |
<li><b>Add support for SNMP via a built in snmp module</b> |
193 |
support.</b><p>Request: <i>At the moment, the only way to get alerts |
<p><pre> |
194 |
is to mail them. How about making user defined alerts. I would like to |
SNMP-TRAP on {RESTART, TIMEOUT, CHECKSUM} to TARGET |
|
see a feature where monit runs a certain user defined program and |
|
|
possibly pass information to it for example, what monitored program |
|
|
made this alert.</i> |
|
|
<p> |
|
|
A possible solution could be to use a statement like this in the |
|
|
control file (keywords in capital): |
|
|
|
|
|
<pre> |
|
|
NOTIFY program on {RESTART, TIMEOUT, CHECKSUM} with ARGUMENTS { |
|
|
arg1= "Apache restarted" |
|
|
arg2= $DATE |
|
|
arg3= $EVENT |
|
|
.. |
|
|
argN="this is the last argument" |
|
|
} |
|
|
</pre> |
|
|
In other words the NOTIFY statement will work like the alert statement |
|
|
except that monit will start a notify <i>program</i> with arguments |
|
|
given in the ARGUMENT block and where the standard alert variables |
|
|
will also be available. ($EVENT, $PROGRAM, $DATE and $HOST) |
|
|
<p> |
|
|
<i>Martin comments:</i><br> I think this it is general enough to allow |
|
|
users to get the alerts where needed. |
|
|
<p> |
|
|
Maybe monit could have native support for SNMP (mentioned in the past) |
|
|
<pre> |
|
|
NOTIFY SNMP-TRAP on {RESTART, TIMEOUT, CHECKSUM} to TARGET |
|
195 |
snmp.manager.com with COMMUNITY abcd1234 |
snmp.manager.com with COMMUNITY abcd1234 |
196 |
</pre> |
</pre> |
197 |
<p> |
<p> |
198 |
And maybe the target for SNMP can be set with a global <i>set</i> |
The target for SNMP can be set with a global <i>set</i> |
199 |
statement with specific options and in the rule we can use only target |
statement with specific options and in the rule we can use only target |
200 |
name, such as: |
name, such as: |
201 |
<pre> |
<pre> |
206 |
SET TARGET myprogram |
SET TARGET myprogram |
207 |
PROGRAM logger |
PROGRAM logger |
208 |
ARGUMENTS {...} |
ARGUMENTS {...} |
|
|
|
|
SET NOTIFY myprogram on {RESTART, TIMEOUT, CHECKSUM} |
|
|
SET NOTIFY mysnmp on {RESTART, TIMEOUT, CHECKSUM} |
|
209 |
</pre> |
</pre> |
|
|
|
|
The NOTIFY directive can be used on global level (for example with SET |
|
|
NOTIFY ...) or can be overriden on per-process level (NOTIFY ... ) |
|
|
<p> |
|
|
With your syntax (NOTIFY program ...) the above isn't actually needed |
|
|
- users can have external programs that does similar thing - it's on |
|
|
discussion. |
|
|
<p> |
|
|
<i>Jan-Henrik comments:</i><br> Let's chew a bit on this, but I'm |
|
|
inclined to Martins proposal. |
|
|
<p> |
|
210 |
<code> |
<code> |
211 |
<table border=0 cellspacing=5> |
<table border=0 cellspacing=5> |
212 |
<tr> |
<tr> |
213 |
<td width=50%>Responsible:</td><td width=50%>Jan-Henrik/Martin</td> |
<td width=50%>Responsible:</td><td width=50%>Martin</td> |
214 |
</tr> |
</tr> |
215 |
<tr> |
<tr> |
216 |
<td width=50%>Progress:</td> |
<td width=50%>Progress:</td> |