It is possible to use general 'trick' for this by using custom script
running from cron for example, which updates the timestamp of some
state file.
Monit then checks the timestamp of this file using the timestamp rule,
for example:
--8<--
check file nfs_proc_count with path /tmp/nfs_state
if timestamp > 10 minutes then ...
--8<--
The script running from cron for example each 5 minutes, could be
simple, something like:
--8<--
if [ `pgrep nfsd | wc -l` -ge 4 ]; then touch /tmp/nfs_state; fi
--8<--
=> in the case that there are at least four nfs processes, timestamp
of the /tmp/nfs_state file will be updated. In the case that there are
less then four process, state file timestamp will not be updated and
monit will trigger event.
Martin
Marco Ermini wrote:
This is what the OpenView sysadmin sometimes did. They have the agent
running an external script using, for instance, Korn shell. In this
script you can put anything, for instance, check that you have at
least 4 Java processes, or grep a log file, or whatever. Then the
result (0 as positive, other values as wrong) will trigger the alarm
or not.
--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general