New upstream version 0.6.27
This commit is contained in:
4
contrib/.gitignore
vendored
Normal file
4
contrib/.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
fedora/logwatch/conf/logfiles/pnp4nagios.conf
|
||||
fedora/logwatch/scripts/services/pnp4nagios
|
||||
fedora/pnp4nagios.logrotate.conf
|
||||
ssi/status-header.ssi
|
||||
25
contrib/fedora/logwatch/conf/logfiles/pnp4nagios.conf.in
Normal file
25
contrib/fedora/logwatch/conf/logfiles/pnp4nagios.conf.in
Normal file
@@ -0,0 +1,25 @@
|
||||
##########################################################################
|
||||
# $Id$
|
||||
##########################################################################
|
||||
|
||||
########################################################
|
||||
# This was written and is maintained by:
|
||||
# Chuck Lane <lane@dchooz.org>
|
||||
#
|
||||
########################################################
|
||||
|
||||
# What actual file? Defaults to LogPath if not absolute path....
|
||||
LogFile = @PERFDATA_LOG@
|
||||
Logfile = @logdir@/npcd.log
|
||||
|
||||
# If the archives are searched, here is one or more line
|
||||
# (optionally containing wildcards) that tell where they are...
|
||||
#If you use a "-" in naming add that as well -mgt
|
||||
Archive = @PERFDATA_LOG@?[0-9]+
|
||||
Archive = @PERFDATA_LOG@?[0-9]+.gz
|
||||
Archive = @logdir@/npcd.log.[0-9]+
|
||||
Archive = @logdir@/npcd.log.[0-9]+.gz
|
||||
|
||||
|
||||
*ApplyEuroDate =
|
||||
# vi: shiftwidth=3 tabstop=3 et
|
||||
21
contrib/fedora/logwatch/conf/services/pnp4nagios.conf
Normal file
21
contrib/fedora/logwatch/conf/services/pnp4nagios.conf
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
# You can put comments anywhere you want to. They are effective for the
|
||||
# rest of the line.
|
||||
|
||||
# this is in the format of <name> = <value>. Whitespace at the beginning
|
||||
# and end of the lines is removed. Whitespace before and after the = sign
|
||||
# is removed. Everything is case *insensitive*.
|
||||
|
||||
# Yes = True = On = 1
|
||||
# No = False = Off = 0
|
||||
|
||||
Title = pnp4nagios-messages
|
||||
|
||||
# Which logfile group...
|
||||
LogFile = pnp4nagios
|
||||
|
||||
# *OnlyService = vsftpd
|
||||
#*RemoveHeaders =
|
||||
|
||||
|
||||
# vi: shiftwidth=3 tabstop=3 et
|
||||
71
contrib/fedora/logwatch/scripts/services/pnp4nagios.in
Normal file
71
contrib/fedora/logwatch/scripts/services/pnp4nagios.in
Normal file
@@ -0,0 +1,71 @@
|
||||
#!@PERL@
|
||||
##########################################################################
|
||||
# $Id: $
|
||||
##########################################################################
|
||||
# $Log: $
|
||||
# Rev for pnp4nagios 0.6.26 2022/10/23 lane@dchooz.org
|
||||
##########################################################################
|
||||
|
||||
use strict;
|
||||
use Logwatch ':all';
|
||||
|
||||
my $Debug = $ENV{'LOGWATCH_DEBUG'} || 0;
|
||||
my $DebugCounter = 0;
|
||||
|
||||
my @OtherList = ();
|
||||
|
||||
if ( $Debug >= 5 ) {
|
||||
print STDERR "\n\nDEBUG: Inside pnp4nagios Filter \n\n";
|
||||
$DebugCounter = 1;
|
||||
}
|
||||
|
||||
my $line = 0;
|
||||
#my $date = '\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d \[\d+\] \[\d+\]';
|
||||
while (defined(my $ThisLine = <STDIN>)) {
|
||||
if ( $Debug >= 5 ) {
|
||||
print STDERR "DEBUG($DebugCounter): $ThisLine";
|
||||
$DebugCounter++;
|
||||
}
|
||||
chomp($ThisLine);
|
||||
$ThisLine =~ s/^File truncated// if $line == 0;
|
||||
$line++;
|
||||
|
||||
if (
|
||||
($ThisLine =~ /Found Performance Data for/) or
|
||||
($ThisLine =~ /\d+ lines processed/) or
|
||||
($ThisLine =~ /\/var\/spool\/pnp4nagios\/service-perfdata\.\d+-PID-\d+ deleted/) or
|
||||
($ThisLine =~ /\/var\/spool\/pnp4nagios\/host-perfdata\.\d+-PID-\d+ deleted/) or
|
||||
($ThisLine =~ /PNP exiting \(runtime/) or
|
||||
($ThisLine =~ /process_perfdata.pl-[\.\d]+ starting in BULK Mode called by (NPCD|Nagios)/) or
|
||||
($ThisLine =~ /process_perfdata.pl-[\.\d]+ starting in SYNC Mode/) or
|
||||
($ThisLine =~ /process_perfdata.pl-[\.\d]+ starting in STDIN Mode/) or
|
||||
($ThisLine =~ /NPCD: Found \d+ files in/) or
|
||||
($ThisLine =~ /NPCD: ThreadCounter \d+\/\d+ File is/) or
|
||||
($ThisLine =~ /NPCD: Regular File: (host|service)-perfdata\.\d+/) or
|
||||
($ThisLine =~ /NPCD: A thread was started on thread_counter = \d+/) or
|
||||
($ThisLine =~ /NPCD: Processing file (host|service)-perfdata\.\d+ with ID \d+ - going to exec/) or
|
||||
($ThisLine =~ /NPCD: Have to wait: Filecounter = \d+ - thread_counter = \d+/) or
|
||||
($ThisLine =~ /NPCD: No more files to process\.\.\. waiting for \d+ seconds/) or
|
||||
0 # this line prevents blame-shifting as lines are added above
|
||||
)
|
||||
{
|
||||
if ( $Debug >= 6 ) {
|
||||
print STDERR "DEBUG($DebugCounter): line ignored\n";
|
||||
}
|
||||
} else
|
||||
{
|
||||
# Report any unmatched entries...
|
||||
push @OtherList, "$ThisLine\n";
|
||||
}
|
||||
}
|
||||
|
||||
###########################################################
|
||||
|
||||
if ($#OtherList >= 0) {
|
||||
print "\n**Unmatched Entries**\n";
|
||||
print @OtherList;
|
||||
}
|
||||
|
||||
exit(0);
|
||||
|
||||
# vi: shiftwidth=3 tabstop=3 syntax=perl et
|
||||
17
contrib/fedora/npcd.service
Normal file
17
contrib/fedora/npcd.service
Normal file
@@ -0,0 +1,17 @@
|
||||
[Unit]
|
||||
Description=npcd rrd processor for pnp4nagios
|
||||
Documentation=http://docs.pnp4nagios.org/
|
||||
After=network.target local-fs.target
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
User=nagios
|
||||
Group=nagios
|
||||
PIDFile=/run/nagios/npcd.pid
|
||||
Environment="CONFIG_FILE=/etc/pnp4nagios/npcd.cfg"
|
||||
EnvironmentFile=-/etc/sysconfig/npcd
|
||||
ExecStart=/usr/sbin/npcd -d -f ${CONFIG_FILE}
|
||||
ExecStop=/bin/kill -s QUIT $MAINPID
|
||||
|
||||
[Install]
|
||||
WantedBy=nagios.service
|
||||
5
contrib/fedora/npcd.sysconfig
Normal file
5
contrib/fedora/npcd.sysconfig
Normal file
@@ -0,0 +1,5 @@
|
||||
#
|
||||
#
|
||||
# if the config file is in a different location, change it here
|
||||
#
|
||||
#CONFIG_FILE=/etc/pnp4nagios/npcd.cfg
|
||||
89
contrib/fedora/pnp4nagios-README.fedora
Normal file
89
contrib/fedora/pnp4nagios-README.fedora
Normal file
@@ -0,0 +1,89 @@
|
||||
(For Fedora and other redhat-ish variants)
|
||||
|
||||
**** httpd integration ****
|
||||
pnp4nagios.httpd.plugin.conf -> /etc/systemd/system/httpd.service.d/pnp4nagios.conf
|
||||
systemctl daemon-reload
|
||||
...this sets the XDG_CACHE_HOME environment variable needed by
|
||||
fontconfig that is in turn needed by rrdtool graph generation
|
||||
it should be an apache-writable directory, typically /var/cache/httpd
|
||||
|
||||
|
||||
**** nagios integration *****
|
||||
|
||||
|
||||
* Default Mode
|
||||
|
||||
/etc/nagios/nagios.cfg
|
||||
|
||||
process_performance_data=1
|
||||
service_perfdata_command=process-service-perfdata
|
||||
|
||||
/etc/nagios/commands.cfg
|
||||
|
||||
define command {
|
||||
command_name process-service-perfdata
|
||||
command_line /usr/bin/perl /usr/libexec/pnp4nagios/process_perfdata.pl
|
||||
}
|
||||
|
||||
define command {
|
||||
command_name process-host-perfdata
|
||||
command_line /usr/bin/perl /usr/libexec/pnp4nagios/process_perfdata.pl -d HOSTPERFDATA
|
||||
}
|
||||
|
||||
|
||||
* Bulk Mode
|
||||
|
||||
/etc/nagios/nagios.cfg :
|
||||
|
||||
process_performance_data=1
|
||||
#
|
||||
# service performance data
|
||||
#
|
||||
service_perfdata_file=/var/spool/nagios/service-perfdata
|
||||
service_perfdata_file_template=DATATYPE::SERVICEPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tSERVICEDESC::$SERVICEDESC$\tSERVICEPERFDATA::$SERVICEPERFDATA$\tSERVICECHECKCOMMAND::$SERVICECHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$\tSERVICESTATE::$SERVICESTATE$\tSERVICESTATETYPE::$SERVICESTATETYPE$
|
||||
service_perfdata_file_mode=a
|
||||
service_perfdata_file_processing_interval=15
|
||||
service_perfdata_file_processing_command=process-service-perfdata-file
|
||||
|
||||
/etc/nagios/commands.cfg :
|
||||
|
||||
define command{
|
||||
command_name process-service-perfdata-file
|
||||
command_line $USER1$/process_perfdata.pl --bulk=/var/spool/nagios/service-perfdata
|
||||
}
|
||||
|
||||
define command{
|
||||
command_name process-host-perfdata-file
|
||||
command_line $USER1$/process_perfdata.pl --bulk=/var/spool/nagios/host-perfdata
|
||||
}
|
||||
|
||||
|
||||
* Bulk Mode with NPCD
|
||||
|
||||
npcd daemon needs to be started :
|
||||
service npcd start
|
||||
chkconfig npcd on
|
||||
|
||||
The configuration is identical to the bulk mode except for the used command.
|
||||
|
||||
/etc/nagios/commands.cfg :
|
||||
|
||||
define command{
|
||||
command_name process-service-perfdata-file
|
||||
command_line /bin/mv /var/spool/nagios/service-perfdata /var/spool/pnp4nagios/service-perfdata.$TIMET$
|
||||
}
|
||||
|
||||
define command{
|
||||
command_name process-host-perfdata-file
|
||||
command_line /bin/mv /var/spool/nagios/host-perfdata /var/spool/pnp4nagios/service-perfdata.$TIMET$
|
||||
}
|
||||
|
||||
|
||||
* Nagios integration
|
||||
|
||||
/etc/nagios/hostextinfo.cfg :
|
||||
|
||||
define hostextinfo {
|
||||
host_name localhost
|
||||
action_url /pnp4nagios/graph?host=$HOSTNAME$
|
||||
}
|
||||
103
contrib/fedora/pnp4nagios-npcd.sysvinit
Normal file
103
contrib/fedora/pnp4nagios-npcd.sysvinit
Normal file
@@ -0,0 +1,103 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# npcd Nagios Performancedata C Daemon
|
||||
#
|
||||
# chkconfig: - 98 02
|
||||
# description: Nagios Performancedata C Daemon
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides:
|
||||
# Required-Start:
|
||||
# Required-Stop:
|
||||
# Should-Start:
|
||||
# Should-Stop:
|
||||
# Default-Start:
|
||||
# Default-Stop:
|
||||
# Short-Description:
|
||||
# Description:
|
||||
### END INIT INFO
|
||||
|
||||
# Source function library.
|
||||
. /etc/rc.d/init.d/functions
|
||||
|
||||
exec="/usr/sbin/npcd"
|
||||
prog="npcd"
|
||||
config="/etc/pnp4nagios/npcd.cfg"
|
||||
|
||||
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
|
||||
|
||||
lockfile=/var/lock/subsys/$prog
|
||||
|
||||
start() {
|
||||
[ -x $exec ] || exit 5
|
||||
[ -f $config ] || exit 6
|
||||
echo -n $"Starting $prog: "
|
||||
daemon $exec -f $config -d
|
||||
retval=$?
|
||||
echo
|
||||
[ $retval -eq 0 ] && touch $lockfile
|
||||
return $retval
|
||||
}
|
||||
|
||||
stop() {
|
||||
echo -n $"Stopping $prog: "
|
||||
killproc $prog
|
||||
retval=$?
|
||||
echo
|
||||
[ $retval -eq 0 ] && rm -f $lockfile
|
||||
return $retval
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
reload() {
|
||||
restart
|
||||
}
|
||||
|
||||
force_reload() {
|
||||
restart
|
||||
}
|
||||
|
||||
rh_status() {
|
||||
status $prog
|
||||
}
|
||||
|
||||
rh_status_q() {
|
||||
rh_status >/dev/null 2>&1
|
||||
}
|
||||
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
rh_status_q && exit 0
|
||||
$1
|
||||
;;
|
||||
stop)
|
||||
rh_status_q || exit 0
|
||||
$1
|
||||
;;
|
||||
restart)
|
||||
$1
|
||||
;;
|
||||
reload)
|
||||
rh_status_q || exit 7
|
||||
$1
|
||||
;;
|
||||
force-reload)
|
||||
force_reload
|
||||
;;
|
||||
status)
|
||||
rh_status
|
||||
;;
|
||||
condrestart|try-restart)
|
||||
rh_status_q || exit 0
|
||||
restart
|
||||
;;
|
||||
*)
|
||||
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
|
||||
exit 2
|
||||
esac
|
||||
exit $?
|
||||
7
contrib/fedora/pnp4nagios.logrotate.conf.in
Normal file
7
contrib/fedora/pnp4nagios.logrotate.conf.in
Normal file
@@ -0,0 +1,7 @@
|
||||
@logdir@/*.log {
|
||||
compress
|
||||
missingok
|
||||
notifempty
|
||||
rotate 5
|
||||
size 100k
|
||||
}
|
||||
@@ -1,128 +0,0 @@
|
||||
# $Id:$
|
||||
# Upstream: pnp4nagios-devel@lists.sourceforge.net
|
||||
Name: pnp4nagios
|
||||
Version: 0.6.16
|
||||
Release: 1
|
||||
Summary: PNP is not PerfParse. A Nagios/Icinga perfdata graphing solution
|
||||
|
||||
Group: Applications/System
|
||||
License: GPLv2
|
||||
URL: http://www.pnp4nagios.org/
|
||||
Source: http://downloads.sourceforge.net/pnp4nagios/%{name}-%{version}.tar.gz
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
||||
|
||||
BuildRequires: rrdtool-devel
|
||||
BuildRequires: perl-rrdtool
|
||||
Requires: rrdtool
|
||||
Requires: perl-rrdtool
|
||||
Obsoletes: pnp
|
||||
|
||||
%description
|
||||
PNP is an addon to Nagios/Icinga which analyzes performance data provided by plugins and stores them automatically into RRD-databases.
|
||||
|
||||
%prep
|
||||
%setup
|
||||
|
||||
|
||||
%build
|
||||
sed -i -e 's/INSTALL_OPTS="-o $nagios_user -g $nagios_grp"/INSTALL_OPTS=""/' configure
|
||||
sed -i -e 's/INIT_OPTS=-o root -g root/INIT_OPTS=/' scripts/Makefile.in
|
||||
# hardcode that until a proper fix is upstream
|
||||
sed -i -e 's/MANDIR=@mandir@/MANDIR=\/usr\/share\/man/' man/Makefile.in
|
||||
%configure --with-perfdata-logfile=%{_localstatedir}/log/nagios/perfdata.log \
|
||||
--sysconfdir=%{_sysconfdir}/%{name} \
|
||||
--datarootdir=%{_datadir}/%{name} \
|
||||
--with-perfdata-dir=%{_datadir}/%{name}/perfdata \
|
||||
--with-perfdata-spool-dir=%{_localstatedir}/spool/nagios \
|
||||
--mandir=%{_mandir} \
|
||||
--libdir=%{_libdir}/%{name} # only kohana is installed there and maybe we have a system wide kohana already
|
||||
make %{?_smp_mflags} all
|
||||
|
||||
|
||||
%install
|
||||
rm -rf %{buildroot}
|
||||
%{__mkdir} -p %{buildroot}%{_sysconfdir}/httpd/conf.d/
|
||||
make fullinstall DESTDIR=%{buildroot}
|
||||
mv %{buildroot}%{_sysconfdir}/%{name}/check_commands/check_nwstat.cfg-sample %{buildroot}%{_sysconfdir}/%{name}/check_commands/check_nwstat.cfg
|
||||
mv %{buildroot}%{_sysconfdir}/%{name}/pages/web_traffic.cfg-sample %{buildroot}%{_sysconfdir}/%{name}/pages/web_traffic.cfg
|
||||
mv %{buildroot}%{_sysconfdir}/%{name}/rra.cfg-sample %{buildroot}%{_sysconfdir}/%{name}/rra.cfg
|
||||
|
||||
sed -i -e 's*log_file = /var/npcd.log*log_file = /var/log/nagios/npcd.log*' %{buildroot}%{_sysconfdir}/%{name}/npcd.cfg
|
||||
|
||||
# drop local versioning, we already provide our own upgrade safety
|
||||
rm -f %{buildroot}%{_sysconfdir}/%{name}/config.php.%{version}
|
||||
rm -f %{buildroot}%{_sysconfdir}/%{name}/config_local.php
|
||||
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
|
||||
%files
|
||||
%defattr(-,nagios,nagios,-)
|
||||
%doc AUTHORS
|
||||
%doc ChangeLog
|
||||
%doc COPYING
|
||||
%doc INSTALL
|
||||
%doc README
|
||||
%doc THANKS
|
||||
%config(noreplace) %{_sysconfdir}/%{name}/check_commands/check_all_local_disks.cfg-sample
|
||||
%config(noreplace) %{_sysconfdir}/%{name}/check_commands/check_nrpe.cfg-sample
|
||||
%config(noreplace) %{_sysconfdir}/%{name}/check_commands/check_nwstat.cfg
|
||||
%config(noreplace) %{_sysconfdir}/%{name}/npcd.cfg
|
||||
%config(noreplace) %{_sysconfdir}/%{name}/pages/web_traffic.cfg
|
||||
%config(noreplace) %{_sysconfdir}/%{name}/process_perfdata.cfg
|
||||
%config(noreplace) %{_sysconfdir}/%{name}/rra.cfg
|
||||
%config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf
|
||||
%{_sysconfdir}/%{name}/background.pdf
|
||||
%{_sysconfdir}/%{name}/config.php
|
||||
%{_sysconfdir}/%{name}/misccommands.cfg-sample
|
||||
%{_sysconfdir}/%{name}/nagios.cfg-sample
|
||||
%{_sysconfdir}/%{name}/pnp4nagios_release
|
||||
%attr(755,root,root) %{_sysconfdir}/rc.d/init.d/npcd
|
||||
%attr(755,root,root) %{_sysconfdir}/rc.d/init.d/pnp_gearman_worker
|
||||
%{_bindir}/npcd
|
||||
%{_libdir}/pnp4nagios/npcdmod.o
|
||||
%{_libdir}/%{name}
|
||||
%{_libexecdir}/check_pnp_rrds.pl
|
||||
%{_libexecdir}/process_perfdata.pl
|
||||
%{_libexecdir}/rrd_convert.pl
|
||||
%{_datadir}/%{name}
|
||||
%{_mandir}/man8/npcd.8.gz
|
||||
|
||||
|
||||
%changelog
|
||||
* Mon Feb 06 2012 Michael Friedrich <michael.friedrich@univie.ac.at> - 0.6.16-1
|
||||
- Updated to version 0.6.16.
|
||||
- drop (Build)Requires nagios, we can use other core(s) as well
|
||||
- verify_pnp_config.pl => verify_pnp_config_v2.pl not installed anymore
|
||||
- npcd.cfg and process_perfdata.cfg get now installed by make install w/o -sample suffix
|
||||
- recognize new initscript for pnp_gearman_worker
|
||||
- autoremove versionized config.php, we use config(noreplace)
|
||||
- drop config_local.php which would override default settings
|
||||
- fix npcd.8 man page prefix install
|
||||
|
||||
* Tue Feb 15 2011 Christoph Maser <cmr@financial.com> - 0.6.11-1
|
||||
- Updated to version 0.6.11.
|
||||
|
||||
* Tue Aug 31 2010 Christoph Maser <cmr@financial.com> - 0.6.6-1
|
||||
- Updated to version 0.6.6.
|
||||
|
||||
* Thu Dec 24 2009 Christoph Maser <cmr@financial.com> - 0.6.2 - 2
|
||||
- add --with-perfdata-spool-dir and --with-perfdata--dir
|
||||
- mark httpd-config snippet as config file
|
||||
|
||||
* Thu Dec 24 2009 Christoph Maser <cmr@financial.com> - 0.6.2 - 1
|
||||
- Update to version 0.6.2
|
||||
- Rename to pnp4nagios
|
||||
|
||||
* Mon Mar 23 2009 Christoph Maser <cmr@financial.com> - 0.4.14 - 2
|
||||
- Update to version 0.4.14
|
||||
|
||||
* Mon Mar 23 2009 Christoph Maser <cmr@financial.com> - 0.4.13 - 2
|
||||
- modify log path
|
||||
- add documentation files
|
||||
|
||||
* Mon Mar 23 2009 Christoph Maser <cmr@financial.com> - 0.4.13 - 1
|
||||
- Initial package (using brain ;)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script src="@BASE_URL@/media/js/jquery-min.js" type="text/javascript"></script>
|
||||
<script src="@BASE_URL@/media/js/jquery.cluetip.js" type="text/javascript"></script>
|
||||
<script src="@PNP_URL@/media/js/jquery-min.js" type="text/javascript"></script>
|
||||
<script src="@PNP_URL@/media/js/jquery.cluetip.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
jQuery.noConflict();
|
||||
jQuery(document).ready(function() {
|
||||
|
||||
Reference in New Issue
Block a user