NSCA Help

So I’ve decided to try out NSCA in lieu of NRPE to execute local service checks on remote hosts. I’ve read through the README and configured the send_nsca.cfg and nsca.cfg files, making passwords match, etc. The question is…now what? I know I need to configure NSCA on the remote host(s) to send local host info back to my Nagios server, but I’m confused as to where I should specify what services are to be checked. Do I just need to install Nagios on the remote hosts and have them execute only local checks, after which NSCA will send that info to my main Nagios box?

I guess I’m just a bit confused as to how this works…

Nagios isn’t required on the remote machines, just the check_xxx program. On the remote machine, I use a cron entry to execute a command every 5 minutes:

0-59/5 * * * * /usr/local/nagios/bin/check_openser.sh

this script runs my check_openser and pipes the output to send_nsca:

#!/bin/bash
/usr/local/nagios/libexec/check_openser | /usr/local/nagios/bin/send_nsca -H www.domain.com -c /usr/local/nagios/etc/send_nsca.cfg 2>&1 >> /dev/null

-mike

Edited Wed Dec 28 2005, 08:41PM ]

mh720 is correct, but it may be worthwhile to go ahead and setup nagios on another box, so that you get familiar with how a redundant or distributed nagios setup would work. For example, let’s say we have 10,000 service checks to perform. I’m pretty sure that we can’t do that with ONE nagios machine making 10k ACTIVE service checks. So we could setup 10 nagios machines splitting up the load. All of these 10 could then be making 1000 ACTIVE checks and sending PASSIVE checks to a central nagios server via nsca.
This could be helpful in the event that the central nagios server dies. It would be simple to have any one of the other machines setup to easily change over to perform the duties of a central nagios machine.

Having 1000 cron jobs on a remote host is also possible, but might be difficult to schedule them correctly. Since nagios will change it’s schedule to fit the needs, a cronjob will not. For example, you seperate 60 cronjobs by ONE second over a 1 minute period, but then one job takes longer to run than 1 second. Crond is simply going to fire off the other job, but a nagios setup would change the schedule and wait for the first one to finish.

If you are only going to run one or 2 things, then yes, just use cron. But if you are bored, try a mini nagios setup on the remote host and use nsca to pass the data to your central box.