Monitoring Lotus Notes (on Linux)

Remotely monitoring a Lotus Notes (R5) server can be a bit of a pain - I've written a couple of scripts to help ease the burden. What's more, they could be used to monitor more than just Lotus Notes.
<--break-->
Remotely monitoring something like Lotus Notes is not really very easy. You can of course check to make sure services such as the Web server, SMTP server, POP/IMAP etc. are available. That'll get 90% of Notes. The problem comes when the "router" process dies without you noticing; now, the machine will accept SMTP, or mails sent via the client, but it'll queue them (without telling users that it's not sending them immediately). So, it may be quite some time before you realise that there's a problem.

There are a million ways to skin this particular cat. Most Network Monitoring tools come with some way to monitor remote processes. I'm never 100% happy with running a daemon on a machine that checks processes, CPU usage, diskspace etc, mainly because of security. Happily, most of these sorts of things can be secured using ssh. Problem is, I don't have such a thing handy, and besides, my needs are really pretty simple.

I wrote two scripts; the first runs on the server, and figures out which processes are running, and then reports on this. The second gathers the information from the first. Since Netsaint uses scripts and programs to do the service checks, it's easy to slide in an extra one to fetch the information from the remote machine.

The way this works is simple; Netsaint calls the monitoring script (which it calls a "plugin"). The script simply uses "ssh" to logon to a remote machine. To avoid having to worry about passwords and the like, I use cryptographically secured host/user based security on the server (ssh without a password).

On the server side, there is a whole unix user who's entire life is there to run the server_ps_check script (as it's shell). I know there are often security concerns about this sort of thing, but (a) it's very close to being perfectly secure, and (b) since the server user can't actually be logged into, except by the network monitor, things are plenty secure enough.

Anyway, so the network monitor (the client) logs into the server, which burps out the status of the Lotus processes. The client then strips this information apart to "understand" it, and then returns what ever is appropriate to Netsaint. Pretty simple.

Here are the two Bourne Shell scripts:
server_ps_check (1k file) for running as the shell of the server user.
check_lotus_procs (1k file) for running as the Netsaint "plugin".

Of course, if you want to check some other application, besides Lotus Notes, then just edit the list of processes that it's watching. Similarly, if you don't use Netsaint, then modify the client script for what ever you do use. If you don't use any kind of Network Monitor (why!?) then just run the client via Cron, and perhaps make it send you an email or something instead of just quitting with a grumble.

Submitted by coofercat on Thu, 2003-11-20 17:54