bulk update thru send_nsca

John P. Rouillard rouilj at cs.umb.edu
Mon Mar 27 05:16:17 CEST 2006


In message <c396f43e0603261839j25e74948yfb0e0dcf473052ad at mail.gmail.com>,
"Joseph Hardeman" writes:
>Does anyone know a way to post multiple checks thru a single send_nsca
>post?

Afraid not. I do everything over ssh and this is easy to do.

>Currently every process/device that we check sends an individual
>send_nsca post to our central server.  As we have anywhere between 5 to 250
>devices at over 450 different locations this can be quite consuming at the
>sites. Currently we are primarily doing pings on most of our devices to make
>sure they are live, but want to do much more and to keep the amount of
>nsca's on the central server down, I was wondering if it wouldn't be better
>to have multiple posts sent thru a single connection, verses every post
>establishing a connection.

I used ssh and a small perl script for this. Setup ssh from the remote
system to the master nagios system using public key ssh.

On the remote system have each check send it's properly formatted
*CHECK_RESULT output to a file. Then a small shell script that is run
when you want to submit your checks. The small script cats the file
into "ssh nagios at nagios_master_host".

On the master nagios system create a small shell or perl script that:

 reads a line of input
 verifies it has the proper form for a PROCESS_HOST/SERVICE_CHECK_RESULT
 submits the result to the command queue

Install the shell script/perl script as a forced command for the keys
that you are using from the remote system. So loss of the key doesn't
allow the user to do anything other than submit
*CHECK_RESULTS. Specifically they can't run any programs or submit
other passive nagios commands.

Obviously this works best if you already use ssh for your remote
infrastructure. I used it to have a Cyclades terminal servers report
events back to the central nagios server, worked like a charm.

You can also use 'tail -f local_input_file_or_pipe | autossh
nagios_master_host' to keep a persistent ssh open if you don't have
too many permanent connections that you need to set up. I used this
setup with SEC to handle alerts coming from syslog monitoring and
analysis.

				-- rouilj
John Rouillard
===========================================================================
My employers don't acknowledge my existence much less my opinions.


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list