The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
Article Feedback - NetSaint - a network monitor
 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Newer Topic  |  Older Topic 
 Remote Monitoring
Author: RevDigger 
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:

<A HREF=""></A>

has at least 3 different packages for doing this. I looked at:

netsaint_statd v2.11
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/ $HOSTADDRESS$ $ARG1$ $ARG2$ $ARG3$
command[check_rprocs]=$USER1$/netsaint_statd/ $HOSTADDRESS$ $ARG1$ $ARG2$ $ARG3$ $ARG4$
command[check_rusers]=$USER1$/netsaint_statd/ $HOSTADDRESS$ $ARG1$ $ARG2$ $ARG3$
command[check_rdisks]=$USER1$/netsaint_statd/ $HOSTADDRESS$ $ARG1$ $ARG2$ $ARG3$ $ARG4$
command[check_rnamed_proc=$USER1$/netsaint_statd/ $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.

Reply To This Message
 Forum List  |  Threaded View   Newer Topic  |  Older Topic 

 User Login
 User Name:
 Remember my login:
 Forgot Your Password?
Enter your email address or user name below and a new password will be sent to the email address associated with your profile.
How to get the most out of the forum