Hello community,
here is the log from the commit of package nagios-nsca
checked in at Fri Feb 9 17:01:07 CET 2007.
--------
--- nagios-nsca/nagios-nsca.changes 2007-01-29 16:27:13.000000000 +0100
+++ /mounts/work_src_done/STABLE/nagios-nsca/nagios-nsca.changes 2007-02-09 11:47:31.797659000 +0100
@@ -1,0 +2,8 @@
+Fri Feb 9 11:46:40 CET 2007 - tsieden@suse.de
+
+- update to version 2.7.1
+ * Fixed bug that prevented single mode daemon from working properly
+ * Added sample scripts for testing functionality to nsca_tests/
+ (Ton Voon/Altinity)
+
+-------------------------------------------------------------------
Old:
----
nsca-2.7.tar.bz2
New:
----
nsca-2.7.1.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ nagios-nsca.spec ++++++
--- /var/tmp/diff_new_pack.sW6636/_old 2007-02-09 16:58:38.000000000 +0100
+++ /var/tmp/diff_new_pack.sW6636/_new 2007-02-09 16:58:38.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package nagios-nsca (Version 2.7)
+# spec file for package nagios-nsca (Version 2.7.1)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -13,7 +13,7 @@
Name: nagios-nsca
BuildRequires: libmcrypt-devel tcpd-devel
Summary: The Nagios Service Check Acceptor
-Version: 2.7
+Version: 2.7.1
Release: 1
URL: http://www.nagios.org/
License: GNU General Public License (GPL)
@@ -119,6 +119,11 @@
%config(noreplace) /etc/nagios/send_nsca.cfg
%changelog -n nagios-nsca
+* Fri Feb 09 2007 - tsieden@suse.de
+- update to version 2.7.1
+ * Fixed bug that prevented single mode daemon from working properly
+ * Added sample scripts for testing functionality to nsca_tests/
+ (Ton Voon/Altinity)
* Mon Jan 29 2007 - tsieden@suse.de
- update to version 2.7
* Fixed crash from malformed command line
++++++ nsca-2.7.tar.bz2 -> nsca-2.7.1.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nsca-2.7/Changelog new/nsca-2.7.1/Changelog
--- old/nsca-2.7/Changelog 2006-12-13 19:27:34.000000000 +0100
+++ new/nsca-2.7.1/Changelog 2007-01-30 06:53:04.000000000 +0100
@@ -3,6 +3,12 @@
**************
+2.7.1 - 01/29/2007
+------------------
+- Fixed bug that prevented single mode daemon from working properly
+- Added sample scripts for testing functionality to nsca_tests/ (Ton Voon/Altinity)
+
+
2.7 - 12/13/2006
----------------
- Fixed crash from malformed command line
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nsca-2.7/configure new/nsca-2.7.1/configure
--- old/nsca-2.7/configure 2006-12-13 19:27:34.000000000 +0100
+++ new/nsca-2.7.1/configure 2007-01-30 06:53:04.000000000 +0100
@@ -1288,9 +1288,9 @@
PKG_NAME=nsca
-PKG_VERSION="2.7"
+PKG_VERSION="2.7.1"
PKG_HOME_URL="http://www.nagios.org/"
-PKG_REL_DATE="12-13-2006"
+PKG_REL_DATE="01-29-2007"
ac_aux_dir=
for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nsca-2.7/configure.in new/nsca-2.7.1/configure.in
--- old/nsca-2.7/configure.in 2006-12-13 19:27:34.000000000 +0100
+++ new/nsca-2.7.1/configure.in 2007-01-30 06:53:05.000000000 +0100
@@ -9,9 +9,9 @@
AC_PREFIX_DEFAULT(/usr/local/nagios)
PKG_NAME=nsca
-PKG_VERSION="2.7"
+PKG_VERSION="2.7.1"
PKG_HOME_URL="http://www.nagios.org/"
-PKG_REL_DATE="12-13-2006"
+PKG_REL_DATE="01-29-2007"
dnl Figure out how to invoke "install" and what install options to use.
AC_PROG_INSTALL
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nsca-2.7/include/common.h new/nsca-2.7.1/include/common.h
--- old/nsca-2.7/include/common.h 2006-12-13 19:27:34.000000000 +0100
+++ new/nsca-2.7.1/include/common.h 2007-01-30 06:53:05.000000000 +0100
@@ -24,8 +24,8 @@
#include "config.h"
-#define PROGRAM_VERSION "2.7"
-#define MODIFICATION_DATE "12-13-2006"
+#define PROGRAM_VERSION "2.7.1"
+#define MODIFICATION_DATE "01-29-2007"
#define OK 0
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nsca-2.7/nsca.spec new/nsca-2.7.1/nsca.spec
--- old/nsca-2.7/nsca.spec 2006-12-13 19:27:34.000000000 +0100
+++ new/nsca-2.7.1/nsca.spec 2007-01-30 06:53:05.000000000 +0100
@@ -1,5 +1,5 @@
%define name nsca
-%define version 2.7
+%define version 2.7.1
%define release 1
%define nsusr nagios
%define nsgrp nagios
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nsca-2.7/nsca_tests/basic.t new/nsca-2.7.1/nsca_tests/basic.t
--- old/nsca-2.7/nsca_tests/basic.t 1970-01-01 01:00:00.000000000 +0100
+++ new/nsca-2.7.1/nsca_tests/basic.t 2007-01-30 06:53:05.000000000 +0100
@@ -0,0 +1,40 @@
+#!/usr/bin/perl
+#
+# DESCRIPTION:
+# Test sending basic passive results to nsca
+#
+# COPYRIGHT:
+# Copyright (C) 2007 Altinity Limited
+# Copyright is freely given to Ethan Galstad if included in the NSCA distribution
+#
+# LICENCE:
+# GNU GPLv2
+
+use strict;
+use NSCATest;
+use Test::More;
+
+plan tests => 2;
+
+my $data = [
+ ["hostname", "0", "Plugin output"],
+ ["hostname-with-other-bits", "1", "More data to be read"],
+ ["hostname.here", "2", "Check that ; are okay to receive"],
+ ["host", "service", 0, "A good result here"],
+ ["host54", "service with spaces", 1, "Warning! My flies are undone!"],
+ ["host-robin", "service with a :)", 2, "Critical? Alert! Alert!"],
+ ["host-batman", "another service", 3, "Unknown - the only way to travel"],
+ ];
+
+foreach my $type qw(--single --daemon) {
+ my $nsca = NSCATest->new( config => "basic" );
+
+ $nsca->start($type);
+ $nsca->send($data);
+ sleep 1; # Need to wait for --daemon to finish processing
+
+ my $output = $nsca->read_cmd;
+ is_deeply($data, $output, "Got all data as expected");
+
+ $nsca->stop;
+}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nsca-2.7/nsca_tests/multiple.t new/nsca-2.7.1/nsca_tests/multiple.t
--- old/nsca-2.7/nsca_tests/multiple.t 1970-01-01 01:00:00.000000000 +0100
+++ new/nsca-2.7.1/nsca_tests/multiple.t 2007-01-30 06:53:05.000000000 +0100
@@ -0,0 +1,50 @@
+#!/usr/bin/perl
+#
+# DESCRIPTION:
+# Test sending more than one passive result to nsca
+#
+# COPYRIGHT:
+# Copyright (C) 2007 Altinity Limited
+# Copyright is freely given to Ethan Galstad if included in the NSCA distribution
+#
+# LICENCE:
+# GNU GPLv2
+
+
+use strict;
+use NSCATest;
+use Test::More;
+use Clone qw(clone);
+
+my $iterations = 10;
+
+plan tests => 2;
+
+my $data = [
+ ["hostname", "0", "Plugin output"],
+ ["host", "service", 0, "A good result here"],
+ ];
+
+my $copies = [];
+for (1 .. $iterations) {
+ my $c = clone($data);
+ push @$copies, @$c;
+}
+
+foreach my $type qw(--single --daemon) {
+ my $nsca = NSCATest->new( config => "basic" );
+
+ $nsca->start($type);
+
+ my $i = 0;
+ for($i; $i < $iterations; $i++) {
+ $nsca->send($data);
+ }
+ sleep 1; # Need to wait for --daemon to finish processing
+
+ my $output = $nsca->read_cmd;
+
+ is_deeply( $output, $copies );
+
+ $nsca->stop;
+}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nsca-2.7/nsca_tests/nsca_basic.cfg new/nsca-2.7.1/nsca_tests/nsca_basic.cfg
--- old/nsca-2.7/nsca_tests/nsca_basic.cfg 1970-01-01 01:00:00.000000000 +0100
+++ new/nsca-2.7.1/nsca_tests/nsca_basic.cfg 2007-01-30 06:53:05.000000000 +0100
@@ -0,0 +1,190 @@
+####################################################
+# Sample NSCA Daemon Config File
+# Written by: Ethan Galstad (nagios@nagios.org)
+#
+# Last Modified: 04-03-2006
+####################################################
+
+
+# PID FILE
+# The name of the file in which the NSCA daemon should write it's process ID
+# number. The file is only written if the NSCA daemon is started by the root
+# user as a single- or multi-process daemon.
+
+pid_file=var/nsca.pid
+
+
+
+# PORT NUMBER
+# Port number we should wait for connections on.
+# This must be a non-priveledged port (i.e. > 1024).
+
+server_port=56677
+
+
+
+# SERVER ADDRESS
+# Address that NSCA has to bind to in case there are
+# more as one interface and we do not want NSCA to bind
+# (thus listen) on all interfaces.
+
+#server_address=192.168.1.1
+
+
+
+# NSCA USER
+# This determines the effective user that the NSCA daemon should run as.
+# You can either supply a username or a UID.
+#
+# NOTE: This option is ignored if NSCA is running under either inetd or xinetd
+
+#nsca_user=nagios
+
+
+
+# NSCA GROUP
+# This determines the effective group that the NSCA daemon should run as.
+# You can either supply a group name or a GID.
+#
+# NOTE: This option is ignored if NSCA is running under either inetd or xinetd
+
+#nsca_group=nagios
+
+
+
+# NSCA CHROOT
+# If specified, determines a directory into which the nsca daemon
+# will perform a chroot(2) operation before dropping its privileges.
+# for the security conscious this can add a layer of protection in
+# the event that the nagios daemon is compromised.
+#
+# NOTE: if you specify this option, the command file will be opened
+# relative to this directory.
+
+#nsca_chroot=/var/run/nagios/rw
+
+
+
+# DEBUGGING OPTION
+# This option determines whether or not debugging
+# messages are logged to the syslog facility.
+# Values: 0 = debugging off, 1 = debugging on
+
+debug=0
+
+
+
+# COMMAND FILE
+# This is the location of the Nagios command file that the daemon
+# should write all service check results that it receives.
+
+command_file=var/nagios.cmd
+
+
+# ALTERNATE DUMP FILE
+# This is used to specify an alternate file the daemon should
+# write service check results to in the event the command file
+# does not exist. It is important to note that the command file
+# is implemented as a named pipe and only exists when Nagios is
+# running. You may want to modify the startup script for Nagios
+# to dump the contents of this file into the command file after
+# it starts Nagios. Or you may simply choose to ignore any
+# check results received while Nagios was not running...
+
+alternate_dump_file=var/nsca.dump
+
+
+
+# AGGREGATED WRITES OPTION
+# This option determines whether or not the nsca daemon will
+# aggregate writes to the external command file for client
+# connections that contain multiple check results. If you
+# are queueing service check results on remote hosts and
+# sending them to the nsca daemon in bulk, you will probably
+# want to enable bulk writes, as this will be a bit more
+# efficient.
+# Values: 0 = do not aggregate writes, 1 = aggregate writes
+
+aggregate_writes=0
+
+
+
+# APPEND TO FILE OPTION
+# This option determines whether or not the nsca daemon will
+# will open the external command file for writing or appending.
+# This option should almost *always* be set to 0!
+# Values: 0 = open file for writing, 1 = open file for appending
+
+append_to_file=1
+
+
+
+# MAX PACKET AGE OPTION
+# This option is used by the nsca daemon to determine when client
+# data is too old to be valid. Keeping this value as small as
+# possible is recommended, as it helps prevent the possibility of
+# "replay" attacks. This value needs to be at least as long as
+# the time it takes your clients to send their data to the server.
+# Values are in seconds. The max packet age cannot exceed 15
+# minutes (900 seconds). If this variable is set to zero (0), no
+# packets will be rejected based on their age.
+
+max_packet_age=30
+
+
+
+# DECRYPTION PASSWORD
+# This is the password/passphrase that should be used to descrypt the
+# incoming packets. Note that all clients must encrypt the packets
+# they send using the same password!
+# IMPORTANT: You don't want all the users on this system to be able
+# to read the password you specify here, so make sure to set
+# restrictive permissions on this config file!
+
+#password=
+
+
+
+# DECRYPTION METHOD
+# This option determines the method by which the nsca daemon will
+# decrypt the packets it receives from the clients. The decryption
+# method you choose will be a balance between security and performance,
+# as strong encryption methods consume more processor resources.
+# You should evaluate your security needs when choosing a decryption
+# method.
+#
+# Note: The decryption method you specify here must match the
+# encryption method the nsca clients use (as specified in
+# the send_nsca.cfg file)!!
+# Values:
+#
+# 0 = None (Do NOT use this option)
+# 1 = Simple XOR (No security, just obfuscation, but very fast)
+#
+# 2 = DES
+# 3 = 3DES (Triple DES)
+# 4 = CAST-128
+# 5 = CAST-256
+# 6 = xTEA
+# 7 = 3WAY
+# 8 = BLOWFISH
+# 9 = TWOFISH
+# 10 = LOKI97
+# 11 = RC2
+# 12 = ARCFOUR
+#
+# 14 = RIJNDAEL-128
+# 15 = RIJNDAEL-192
+# 16 = RIJNDAEL-256
+#
+# 19 = WAKE
+# 20 = SERPENT
+#
+# 22 = ENIGMA (Unix crypt)
+# 23 = GOST
+# 24 = SAFER64
+# 25 = SAFER128
+# 26 = SAFER+
+#
+
+decryption_method=2
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nsca-2.7/nsca_tests/NSCATest.pm new/nsca-2.7.1/nsca_tests/NSCATest.pm
--- old/nsca-2.7/nsca_tests/NSCATest.pm 1970-01-01 01:00:00.000000000 +0100
+++ new/nsca-2.7.1/nsca_tests/NSCATest.pm 2007-01-30 06:53:05.000000000 +0100
@@ -0,0 +1,92 @@
+#
+# DESCRIPTION:
+# Helper object class for NSCA testing
+#
+# COPYRIGHT:
+# Copyright (C) 2007 Altinity Limited
+# Copyright is freely given to Ethan Galstad if included in the NSCA distribution
+#
+# LICENCE:
+# GNU GPLv2
+
+package NSCATest;
+
+use strict;
+use Class::Struct;
+use IO::File;
+
+struct NSCATest => {
+ config => '$',
+ pid => '$',
+ timeout => '$',
+ };
+
+$| = 1; # Autoflush on
+
+sub start {
+ my ($self, $mode) = @_;
+ $mode ||= "--single";
+
+ printf "Starting nsca with $mode\n";
+ system("../src/nsca -c nsca_".$self->config.".cfg $mode");
+
+ sleep 1; # Let daemon start
+ open F, "var/nsca.pid" or die "No pid file found";
+ chop(my $pid = <F>);
+ close F;
+ $self->pid($pid);
+
+ open(F, "> var/nagios.cmd") or die "Cannot create var/nagios.cmd";
+ close F;
+ return $pid;
+}
+
+sub stop {
+ my $self = shift;
+ print "Stopping nsca: ".$self->pid.$/;
+ kill "TERM", $self->pid;
+ $self->pid(undef);
+ unlink "var/nagios.cmd", "var/nsca.dump";
+ sleep 1; # Let daemon die
+}
+
+sub send {
+ my ($self, $data) = @_;
+ my @output = map { join("\t", @$_)."\n" } @$data;
+ open SEND, "| ".$self->send_cmd;
+ print SEND @output;
+ close SEND;
+}
+
+sub send_cmd {
+ my ($self) = @_;
+ my $timeout = $self->timeout || 2;
+ return "../src/send_nsca -to $timeout -p 56677 -H localhost -c send_".$self->config.".cfg";
+}
+
+sub read_cmd {
+ my ($self, $file) = @_;
+ $file ||= "var/nagios.cmd";
+ my $fh = IO::File->new($file) or die "Can't open $file";
+ $self->process_data($fh);
+}
+
+sub process_data {
+ my ($self, $fh) = @_;
+ my $data = [];
+ while(<$fh>) {
+ chop;
+ my @bits = /\[\d+\] PROCESS_(?:HOST|SERVICE)_CHECK_RESULT;([^;]+);(?:([^;]+);)?([0123]);(.*)$/o;
+
+ # Remove the service name if doesn't exist
+ splice @bits, 1, 1 unless defined $bits[1];
+
+ push @$data, [ @bits ];
+ }
+ return $data;
+}
+
+# Was thinking of calling $self->stop in DESTROY, but with the forking
+# going on, this wouldn't work
+
+1;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nsca-2.7/nsca_tests/README new/nsca-2.7.1/nsca_tests/README
--- old/nsca-2.7/nsca_tests/README 1970-01-01 01:00:00.000000000 +0100
+++ new/nsca-2.7.1/nsca_tests/README 2007-01-30 06:53:05.000000000 +0100
@@ -0,0 +1,38 @@
+NSCA Tests
+==========
+Originally contributed by Ton Voon/Altinity 01/26/2007.
+
+These tests are designed to make sure that the Nagios daemon can start up
+and accept messages by comparing the output in the dummy nagios.cmd file with
+the sent data.
+
+There are 3 tests at the moment:
+
+ * basic - just sends a few passive checks and makes sure that the nagios.cmd file receives them
+
+ * multiple - runs the same as basic, but several times to check the daemon can handle multiple requests
+
+ * simultaneous - runs lots of send_nscas at the same time (well, nearly). Uses Parallel::Forker to setup all the sends then executes them all at once. Expect about 200 extra processes to hit your server!
+
+
+Requirements
+------------
+You will need to have the following CPAN modules installed:
+
+Test::More
+Class::Struct
+Clone
+Parallel::Forker
+
+
+Running the Tests
+-----------------
+1. Run the NSCA configure script and compile the NSCA binaries
+
+2. Run the tests from this directory by running the following command:
+
+ ./runtests
+
+
+
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nsca-2.7/nsca_tests/runtests new/nsca-2.7.1/nsca_tests/runtests
--- old/nsca-2.7/nsca_tests/runtests 1970-01-01 01:00:00.000000000 +0100
+++ new/nsca-2.7.1/nsca_tests/runtests 2007-01-30 06:53:05.000000000 +0100
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+prove *.t
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nsca-2.7/nsca_tests/send_basic.cfg new/nsca-2.7.1/nsca_tests/send_basic.cfg
--- old/nsca-2.7/nsca_tests/send_basic.cfg 1970-01-01 01:00:00.000000000 +0100
+++ new/nsca-2.7.1/nsca_tests/send_basic.cfg 2007-01-30 06:53:05.000000000 +0100
@@ -0,0 +1,62 @@
+####################################################
+# Sample NSCA Client Config File
+# Written by: Ethan Galstad (nagios@nagios.org)
+#
+# Last Modified: 02-21-2002
+####################################################
+
+
+# ENCRYPTION PASSWORD
+# This is the password/passphrase that should be used to encrypt the
+# outgoing packets. Note that the nsca daemon must use the same
+# password when decrypting the packet!
+# IMPORTANT: You don't want all the users on this system to be able
+# to read the password you specify here, so make sure to set
+# restrictive permissions on this config file!
+
+#password=
+
+
+
+# ENCRYPTION METHOD
+# This option determines the method by which the send_nsca client will
+# encrypt the packets it sends to the nsca daemon. The encryption
+# method you choose will be a balance between security and performance,
+# as strong encryption methods consume more processor resources.
+# You should evaluate your security needs when choosing an encryption
+# method.
+#
+# Note: The encryption method you specify here must match the
+# decryption method the nsca daemon uses (as specified in
+# the nsca.cfg file)!!
+# Values:
+# 0 = None (Do NOT use this option)
+# 1 = Simple XOR (No security, just obfuscation, but very fast)
+#
+# 2 = DES
+# 3 = 3DES (Triple DES)
+# 4 = CAST-128
+# 5 = CAST-256
+# 6 = xTEA
+# 7 = 3WAY
+# 8 = BLOWFISH
+# 9 = TWOFISH
+# 10 = LOKI97
+# 11 = RC2
+# 12 = ARCFOUR
+#
+# 14 = RIJNDAEL-128
+# 15 = RIJNDAEL-192
+# 16 = RIJNDAEL-256
+#
+# 19 = WAKE
+# 20 = SERPENT
+#
+# 22 = ENIGMA (Unix crypt)
+# 23 = GOST
+# 24 = SAFER64
+# 25 = SAFER128
+# 26 = SAFER+
+#
+
+encryption_method=2
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nsca-2.7/nsca_tests/simultaneous.t new/nsca-2.7.1/nsca_tests/simultaneous.t
--- old/nsca-2.7/nsca_tests/simultaneous.t 1970-01-01 01:00:00.000000000 +0100
+++ new/nsca-2.7.1/nsca_tests/simultaneous.t 2007-01-30 06:53:05.000000000 +0100
@@ -0,0 +1,74 @@
+#!/usr/bin/perl
+#
+# DESCRIPTION:
+# Test sending lots of results at the same time
+#
+# COPYRIGHT:
+# Copyright (C) 2007 Altinity Limited
+# Copyright is freely given to Ethan Galstad if included in the NSCA distribution
+#
+# LICENCE:
+# GNU GPLv2
+
+
+use strict;
+use NSCATest;
+use Test::More;
+use Clone qw(clone);
+use Parallel::Forker;
+
+my $iterations = 100;
+my $timeout = 8;
+
+plan tests => 4;
+
+my $data = [
+ ["hostname", "0", "Plugin output"],
+ ["hostname-with-other-bits", "1", "More data to be read"],
+ ["hostname.here", "2", "Check that ; are okay to receive"],
+ ["host", "service", 0, "A good result here"],
+ ["host54", "service with spaces", 1, "Warning! My flies are undone!"],
+ ["host-robin", "service with a :)", 2, "Critical? Alert! Alert!"],
+ ["host-batman", "another service", 3, "Unknown - the only way to travel"],
+ ];
+
+
+my $Fork = Parallel::Forker->new;
+$SIG{CHLD} = sub { $Fork->sig_child; };
+$SIG{TERM} = sub { $Fork->kill_tree_all('TERM') if $Fork; die "Quitting..."; };
+
+foreach my $type qw(--single --daemon) {
+ my $expected = [];
+ my $nsca = NSCATest->new( config => "basic", timeout => $timeout );
+
+ $nsca->start($type);
+
+ for (my $i = 0; $i < $iterations; $i++) {
+ my $c = clone($data);
+ push @$c, [ "host$i", 2, "Some unique data: ".rand() ];
+ push @$expected, @$c;
+ $Fork->schedule(
+ run_on_start => sub { $nsca->send($c) },
+ );
+ }
+
+ $Fork->ready_all;
+ $Fork->wait_all;
+
+ sleep 1; # Need to wait for --daemon to finish processing
+
+ my $output = $nsca->read_cmd;
+
+ is( scalar @$output, scalar @$expected, "Got all ".scalar @$expected." packets of data" );
+ is_deeply_sorted( $output, $expected, "All data as expected" );
+
+ $nsca->stop;
+}
+
+sub is_deeply_sorted {
+ my ($expected, $against, $text) = @_;
+ my $e = [ sort map { join(";", map { $_ } @$_) } @$expected ];
+ my $a = [ sort map { join(";", map { $_ } @$_) } @$against ];
+ is_deeply($e, $a, $text);
+}
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nsca-2.7/nsca_tests/var/README new/nsca-2.7.1/nsca_tests/var/README
--- old/nsca-2.7/nsca_tests/var/README 1970-01-01 01:00:00.000000000 +0100
+++ new/nsca-2.7.1/nsca_tests/var/README 2007-01-30 06:53:05.000000000 +0100
@@ -0,0 +1,3 @@
+The purpose of this file is simply to keep this otherwise empty
+directory from getting pruned when I do CVS exports for new
+NSCA releases...
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nsca-2.7/src/nsca.c new/nsca-2.7.1/src/nsca.c
--- old/nsca-2.7/src/nsca.c 2006-12-13 19:27:34.000000000 +0100
+++ new/nsca-2.7.1/src/nsca.c 2007-01-30 06:53:05.000000000 +0100
@@ -1,10 +1,10 @@
/*******************************************************************************
*
* NSCA.C - Nagios Service Check Acceptor
- * Copyright (c) 2000-2006 Ethan Galstad (nagios@nagios.org)
+ * Copyright (c) 2000-2007 Ethan Galstad (nagios@nagios.org)
* License: GPL v2
*
- * Last Modified: 12-13-2006
+ * Last Modified: 01-29-2007
*
* Command line: NSCA -c