NSCA using PROCESS_FILE
Thomas Guyot-Sionnest
dermoth at aei.ca
Fri Mar 2 14:00:19 CET 2007
On 01/03/07 10:27 AM, Gerd Mueller wrote:
>> Whats the better Situation ?
>> 200 sec Service Latency or waiting 20 secs for data ?
>
> With ocsp_sweeper reading the pipe every second I never got a latency
> problem even with 3500 hosts.
Hi Gerd,
Hasn't you requested a ochp_sweeper as well?
I just made my daemon poll as many fifos as you like. You can now have
one daemon to process both OCHP and OCSP pipes. The command usage is
well documented if you run it with the -h switch. I quickly updated the
howto draft as well:
############################################################
Piped OCP daemon Mini-HOWTO (Pre-Alpha!)
############################################################
1. Introduction
This document is a mini howto describing how to use Nagios's ability to
write host / service data to a FIFO to build a very fast OCHP/OCSP
processing system.
2. Copyright
GPL
3. Requirement
- A few properly setup Nagios boxes
- NSCA working
- Libevent
- Perl 5.8.6+ with Event::Lib
- You, the reader
4. Nagios setup
The Main nagios config file will require the following additional config
process_performance_data=1
host_perfdata_file=/path/to/host-perfdata.fifo
service_perfdata_file=/path/to/service-perfdata.fifo
host_perfdata_file_template=$HOSTNAME$\t$HOSTSTATEID$\t$HOSTOUTPUT$|$HOSTPERFDATA$
service_perfdata_file_template=$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATEID$\t$SERVICEOUTPUT$|$SERVICEPERFDATA$
host_perfdata_file_mode=w
service_perfdata_file_mode=w
host_perfdata_file_processing_interval=0
service_perfdata_file_processing_interval=0
5. Filesystem setup
Create FIFOs according to the paths you used for "host_perfdata_file"
and "service_perfdata_file" Nagios config. Make them read-write by
nagios user (can be skiped if you run OCP_daemon as root):
chgrp nagios /path/to/host-perfdata.fifo
chmod 660 /path/to/host-perfdata.fifo
chgrp nagios /path/to/service-perfdata.fifo
chmod 660 /path/to/service-perfdata.fifo
6. Daemon Setup
I recommend running this daemon under Daemontools
(http://cr.yp.to/daemontools.html). The run script would look like this:
-----
#!/bin/sh
exec > /dev/null
exec 2>&1
exec setuidgid nagios /usr/sbin/OCP_daemon \
-f /path/to/host-perfdata.fifo,/path/to/service-perfdata.fifo \
-n <path_to_send_nsca> -H <reveiving_host> -c <nsca_config> -r 1
-----
Critical errors will be printed out to stderr (in the example above they
are discarded).
Run the daemon alone or with "-h" to print the usage. You can have the
daemon send data as fast as possible or at given intervals. If opting
for intervals, you can also have it flush the data if the queue reach a
certain size (the timer will also be reset).
7. Comments?
Please send them to dermoth at aei.ca (me)
############################################################
Thomas
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: OCP_daemon
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20070302/bb7d8fd2/attachment.ksh>
-------------- next part --------------
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
-------------- next part --------------
_______________________________________________
Nagios-devel mailing list
Nagios-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-devel
More information about the Developers
mailing list