Re: [Nagios-devel] NSCA using PROCESS_FILE

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

Re: [Nagios-devel] NSCA using PROCESS_FILE

Post by Guest »

Am Donnerstag, 1. M=E4rz 2007 12:29 schrieb Thomas Guyot-Sionnest:
> On 01/03/07 01:54 AM, Hendrik Baecker wrote:
> > Thomas Guyot-Sionnest schrieb:
> >> Eh, I just realized my test could have been wrong... I restarted Nagio=
s and
> >> did an strace and yes, it won't block. However it won't write anything
> >> either:
> >>
> >> write(5, "[SERVICEPERFDATA]\t1172678948\t10."..., 58) =3D -1 EPIPE (Br=
oken
> >> pipe)
[...]

Hi List,

just an other way to do a bulk update.
Let nagios write to a File in append Mode.

nagios.cfg:
service_perfdata_file=3D/usr/local/nagios/var/service-perfdata
service_perfdata_file_mode=3Da

Nagios will write a line as defined in "service_perfdata_file_template"

Next let nagios rotate the file every 20 seconds by starting the command de=
fined in service_perfdata_file_processing_command.

nagios.cfg:
service_perfdata_file_processing_interval=3D20
service_perfdata_file_processing_command=3Dprocess-service-perfdata-file

The command process-service-perfdata-file is a simple move to a spool direc=
tory.

define command{
command_name process-service-perfdata-file
command_line /bin/mv /usr/local/nagios/var/service-perfdata /us=
r/local/nagios/var/spool/service-perfdata.$TIMET$
}

Nagios will close the Filehandle and move the file to /usr/local/nagios/var=
/spool

Now a little Perl Daemon ( or perhaps incrond ) watches /usr/local/nagios/v=
ar/spool and processes the data in one block.
Also put /usr/local/nagios/var/spool on a ramdisk to minimize Disk IO.

So without a FIFO there is no blocking situation and no data loss.

What do you think abut that ?=20

J=F6rg








This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked