Update of /cvsroot/nagios/nagios
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10020
Modified Files:
configure configure.in p1.pl
Log Message:
Embedded Perl updates (Stanley)
Index: p1.pl
===================================================================
RCS file: /cvsroot/nagios/nagios/p1.pl,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** p1.pl 26 Jan 2004 02:04:21 -0000 1.3
--- p1.pl 9 Dec 2004 06:48:33 -0000 1.4
***************
*** 1,6 ****
! package Embed::Persistent;
#
! # Hacked version of p1.pl distributed with Nagios 1.0
#
# Only major changes are that STDOUT is redirected to a scalar
--- 1,6 ----
! package Embed::Persistent;
#
! # p1.pl distributed with Nagios 2.x
#
# Only major changes are that STDOUT is redirected to a scalar
***************
*** 17,21 ****
use constant DEBUG => 0 ;
! use constant EPN_STDERR_LOG =>
'/usr/home/anwsmh/perl/embedded_perl/epn_in_mem_hack_p1_debug.log' ;
use constant TEXT_RETICENT => <<'RETICENT' ;
--- 17,21 ----
use constant DEBUG => 0 ;
! use constant EPN_STDERR_LOG => 'Some_Path_to_a_Log' ;
use constant TEXT_RETICENT => <<'RETICENT' ;
***************
*** 123,127 ****
if ($@) {
# Log eval'd text of plugin.
! # Correct the line number of the error by removing the
lines added (the subroutine prologue) by Embed::eval_file.
my $i = 1 ;
$eval =~ s/^/sprintf('%10d ', $i++)/meg ;
--- 123,127 ----
if ($@) {
# Log eval'd text of plugin.
! # Correct the line number of the error by removing the
lines added (the subroutine prologue).
my $i = 1 ;
$eval =~ s/^/sprintf('%10d ', $i++)/meg ;
***************
*** 164,168 ****
if ($@ =~ /^ExitTrap: /) {
# For normal plugin exit the ExitTrap string is set by
the
! # redefined CORE::GLOBAL::exit sub calling die to
return a string =~ /^ExitTrap: -?\d+ $package/
# However, there is only _one_ exit sub so the last
plugin to be compiled sets _its_
# package name.
--- 164,168 ----
if ($@ =~ /^ExitTrap: /) {
# For normal plugin exit the ExitTrap string is set by
the
! # redefined CORE::GLOBAL::exit sub calling die to
return a string =~ /^ExitTrap: -?\d+ $package/.
# However, there is only _one_ exit sub so the last
plugin to be compiled sets _its_
# package name.
***************
*** 345,349 ****
if ($@) {
# Log eval'd text of plugin.
! # Correct the line number of the error by removing the
lines added (the subroutine prologue) by Embed::eval_file.
my $i = 1 ;
$eval =~ s/^/sprintf('%10d ', $i++)/meg ;
--- 345,349 ----
if ($@) {
# Log eval'd text of plugin.
! # Correct the line number of the error by removing the
lines added (the subroutine prologue).
my $i = 1 ;
$eval =~ s/^/sprintf('%10d ', $i++)/meg ;
***************
*** 571,575 ****
if ($@) {
# Log eval'd text of plugin.
! # Correct the line number of the error by removing the
lines added (the subroutine prologue) by Embed::eval_file.
# $@ =~ s/line (\d+)\.\n/'line ' . ($1 - 8) . ".\n"/ge ;
my $i = 1 ;
--- 571,575 ----
if ($@) {
# Log eval'd text of plugin.
! # Correct the line number of the error by removing the
lines added (the subroutine prologue).
# $@ =~ s/line (\d+)\.\n/'line ' . ($1 - 8) . ".\n"/ge ;
my $i = 1 ;
***************
*** 668,671 ****
--- 668,686 ----
p1.pl - Perl program to provide Perl code persistence for the Nagios project
(http://www.Nagios.Org).
+ This program attempts to provide a mod_perl like facility for Nagios.
+
+ =head1 SYNOPSIS
+
+ Edit the text to set the values of (the 'use constant' statements) the log
path, B<EPN_STDERR_LOG>, and any one
+ (only) of the boolean log level flags B<GARRULOUS>, B<DEBUG>, and
B<RETICENT>. The default is to set RETICENT, and
+ to use S<<path_to_Nagios>/var/epn_stderr.log> as the log path.
+
+ The log level flags determine the amount and type of messages logged in the
log path.
+
+ The RETICENT log level results in similar behaviour to former versions of
p1.pl.
+ In particular, the log file EPN_STDERR_LOG will B<not> be opened.
+
+ =head1 DESCRIPTION
+
Nagios is a program to monitor service availability; it does this by
scheduling 'plugins' - discrete programs
that check a service and output a line of text describing the service state
intended for
***************
*** 688,704 ****
and all the good things mentioned in the B<perlembed> man page under
'Maintaining a persistent interpreter'.
- =head1 SYNOPSIS
-
- Edit the text to set the values of (the 'use constant' statements) the log
path, B<EPN_STDERR_LOG>, and any one
- (only) of the boolean log level flags B<GARRULOUS>, B<DEBUG>, and
B<RETICENT>. The default is to set RETICENT, and
- to use S<<path_to_Nagios>/var/epn_stderr.log> as the log path.
-
- The log level flags determine the amount and type of messages logged in the
log path.
-
- The RETICENT log level results in similar behaviour to former versions of
p1.pl.
- In particular, the log file EPN_STDERR_LOG will B<not> be opened.
-
- =head1 DESCRIPTION
-
Plugin syntax errors (possibly introduced when the plugin is transformed by
the persistence framework) and run-time
errors are logged depending on the log level flags.
--- 703,706 ----
***************
*** 855,867 ****
=head1 BUGS
! This framework does nothing to prevent the memory leaks mentioned in
B<perlembed>, relying on Nagios to do so. Nagios versions prior
! to 2.0 did not periodically deallocate and allocate the Perl data structures
resulting in a Nagios process that could double it's memory
! use in less than 5 days.
! Nagios 1.x installations using the persistence framework must monitor the
memory use of the Nagios process and stop/start it when
the usage is exorbidant (for example, for a site with 400 services on 200
hosts and custom Perl plugins used for about 10% of the
! service checks, the Nagios process uses ~ 80 MB after 20-30 days running. It
is usually stopped and started at this point.)
! Note that a HUP signal is not sufficient to deallocate the Perl memory; the
Nagios process must be stopped and started.
--- 857,877 ----
=head1 BUGS
! This framework does nothing to prevent the memory leaks mentioned in
B<perlembed>, relying on operator intervention.
! Probably the best way of doing so is by periodically scheduling
!
! =over 4
!
! =item 1 A check of the memory used by the Nagios process (by running for
example the standard Nagios plugin check_vsz)
!
! =item 2 Restarting Nagios with the (supplied with Nagios) startup script
(restart command).
!
! =back
!
! Nagios installations using the persistence framework must monitor the memory
use of the Nagios process and stop/start it when
the usage is exorbidant (for example, for a site with 400 services on 200
hosts and custom Perl plugins used for about 10% of the
! service checks, the Nagios process uses ~ 80 MB after 20-30 days running. It
is usually stopped and started at this point.
! Note that a HUP signal is B<not> sufficient to deallocate the Perl memory;
the Nagios process must be stopped and started.
***************
*** 880,882 ****
=cut
-
--- 890,891 ----
Index: configure
===================================================================
RCS file: /cvsroot/nagios/nagios/configure,v
retrieving revision 1.61
retrieving revision 1.62
diff -C2 -d -r1.61 -r1.62
*** configure 30 Oct 2004 23:39:14 -0000 1.61
--- configure 9 Dec 2004 06:48:33 -0000 1.62
***************
*** 3169,3172 ****
--- 3169,3177 ----
USEPERL=yes
INSTALLPERLSTUFF=yes;
+ PERLXSI_O=perlxsi.o
+ OBJS="${OBJS} ${PERLXSI_O}"
+ echo "creating base/perlxsi.c"
+ perl -MExtUtils::Embed -e xsinit -- -o base/perlxsi.c
+
fi
***************
*** 3236,3240 ****
set dummy traceroute; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
! echo "configure:3239: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PATH_TO_TRACEROUTE'+set}'`\" = set";
then
echo $ac_n "(cached) $ac_c" 1>&6
--- 3241,3245 ----
set dummy traceroute; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
! echo "configure:3244: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PATH_TO_TRACEROUTE'+set}'`\" = set";
then
echo $ac_n "(cached) $ac_c" 1>&6
***************
*** 3281,3290 ****
echo $ac_n "checking for snprintf""... $ac_c" 1>&6
! echo "configure:3284: checking for snprintf" >&5
if eval "test \"`echo '$''{'ac_cv_func_snprintf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
! #line 3289 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
--- 3286,3295 ----
echo $ac_n "checking for snprintf""... $ac_c" 1>&6
! echo "configure:3289: checking for snprintf" >&5
if eval "test \"`echo '$''{'ac_cv_func_snprintf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
! #line 3294 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
***************
*** 3309,3313 ****
; return 0; }
EOF
! if { (eval echo configure:3312: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
&& test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_snprintf=yes"
--- 3314,3318 ----
; return 0; }
EOF
! if { (eval echo configure:3317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
&& test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_snprintf=yes"
***************
*** 3335,3341 ****
echo $ac_n "checking for type va_list""... $ac_c" 1>&6
! echo "configure:3338: checking for type va_list" >&5
cat > conftest.$ac_ext <<EOF
! #line 3340 "configure"
#include "confdefs.h"
#ifdef __STDC__
--- 3340,3346 ----
echo $ac_n "checking for type va_list""... $ac_c" 1>&6
! echo "configure:3343: checking for type va_list" >&5
cat > conftest.$ac_ext <<EOF
! #line 3345 "configure"
#include "confdefs.h"
#ifdef __STDC__
***************
*** 3352,3356 ****
; return 0; }
EOF
! if { (eval echo configure:3355: \"$ac_compile\") 1>&5; (eval $ac_compile)
2>&5; }; then
rm -rf conftest*
echo "$ac_t""yes" 1>&6
--- 3357,3361 ----
; return 0; }
EOF
! if { (eval echo configure:3360: \"$ac_compile\") 1>&5; (eval $ac_compile)
2>&5; }; then
rm -rf conftest*
echo "$ac_t""yes" 1>&6
***************
*** 3374,3381 ****
# Extract the first word of "perl", so it can be a program name with args.
set dummy perl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
! echo "configure:3380: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
--- 3379,3387 ----
+
# Extract the first word of "perl", so it can be a program name with args.
set dummy perl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
! echo "configure:3386: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
***************
*** 3550,3553 ****
--- 3556,3560 ----
s%@PERLLIBS@%$PERLLIBS%g
s%@PERLDIR@%$PERLDIR%g
+ s%@PERLXSI_O@%$PERLXSI_O%g
s%@BASEEXTRALIBS@%$BASEEXTRALIBS%g
s%@INITDIR@%$INITDIR%g
Index: configure.in
===================================================================
RCS file: /cvsroot/nagios/nagios/configure.in,v
retrieving revision 1.62
retrieving revision 1.63
diff -C2 -d -r1.62 -r1.63
*** configure.in 30 Oct 2004 23:39:14 -0000 1.62
--- configure.in 9 Dec 2004 06:48:33 -0000 1.63
***************
*** 555,558 ****
--- 555,563 ----
USEPERL=yes
INSTALLPERLSTUFF=yes;
+ PERLXSI_O=perlxsi.o
+ OBJS="${OBJS} ${PERLXSI_O}"
+ echo "creating base/perlxsi.c"
+ perl -MExtUtils::Embed -e xsinit -- -o base/perlxsi.c
+
])
***************
*** 638,641 ****
--- 643,647 ----
AC_SUBST(PERLLIBS)
AC_SUBST(PERLDIR)
+ AC_SUBST(PERLXSI_O)
AC_SUBST(BASEEXTRALIBS)
AC_SUBST(INITDIR)
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
|