Date: 27-09-01 06:51
Netsaint comes with lots of tools that monitor remote services, like the HTTP and SMTP checkers. But how do you check remote status properties like free disk, or load average? Well of course, people have thought of this.
The "Addons: section of the Netsaint download page:
has at least 3 different packages for doing this. I looked at:
NetSaint Remote Plugin Executor (NRPE) 1.2.4
NetSaint Remote Plugin Executor/Perl (NRPEP) 0.2
For various reasons, I went with netsaint_statd, but if you have had a good experience with any of the others, let me know. netsaint_statd consists of an RPC daemon that runs on the remote machine, and a series of plugins with which the Netsaint server can query it. For security, it implements an allowed-hosts list and will only report a limited set of data.
After untaring and reading through the brief INSTALL doc, I simply put a copy of the rpc daemon on each of the servers from which I wanted reports. I decided that /usr/local/libexec/ was a decent place for it. The RPC daemon is a Perl script, and you will want to edit it to add your Netsaint server to the list of addresses allowed to query it. Since I seem to be restarting these servers all the time (every 3 - 6 months), I dropped a little init script in /usr/local/etc/rc.d/. It looks like:
Once I had those all running I returned to my Netsaint server and dropped the new plugin in my Netsaint plugins directory. Actually I put them in a sub directory,
to keep things tidy. Last thing to do was to let Nesaint know about its new toys.
First I added the following lines to Netsaint's commands.cfg:
# netsaint_statd remote commands
command[check_rload]=$USER1$/netsaint_statd/check_load.pl $HOSTADDRESS$ $ARG1$ $ARG2$ $ARG3$
command[check_rprocs]=$USER1$/netsaint_statd/check_procs.pl $HOSTADDRESS$ $ARG1$ $ARG2$ $ARG3$ $ARG4$
command[check_rusers]=$USER1$/netsaint_statd/check_users.pl $HOSTADDRESS$ $ARG1$ $ARG2$ $ARG3$
command[check_rdisks]=$USER1$/netsaint_statd/check_all_disks.pl $HOSTADDRESS$ $ARG1$ $ARG2$ $ARG3$ $ARG4$
command[check_rnamed_proc=$USER1$/netsaint_statd/check_named_proc.pl $HOSTADDRESS$ $ARG1$ $ARG2$ $ARG3$ $ARG4$
which I mostly just copied from the netsaint_statd README. Lastly, I added services I wanted to monitor to my hosts.cfg and restarted my Netsaint process. That's it, really.
Another nice thing is that adding your own plugins looks like it would be easy to hack in.