rpms/pnp4nagios/EL-4 pnp4nagios-README.fedora, NONE, 1.1 pnp4nagios-npcd.sysvinit, NONE, 1.1 pnp4nagios.logrotate.conf, NONE, 1.1 pnp4nagios.spec, NONE, 1.1 sources, 1.1, 1.2

Xavier Bachelot (xavierb) fedora-extras-commits at redhat.com
Fri Jul 11 22:01:16 UTC 2008


Author: xavierb

Update of /cvs/pkgs/rpms/pnp4nagios/EL-4
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv22953/EL-4

Modified Files:
	sources 
Added Files:
	pnp4nagios-README.fedora pnp4nagios-npcd.sysvinit 
	pnp4nagios.logrotate.conf pnp4nagios.spec 
Log Message:
initial import into F-9, EL-4 and EL-5


--- NEW FILE pnp4nagios-README.fedora ---
* 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 default-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 /nagios/pnp4nagios/index.php?host=$HOSTNAME$
    }


--- NEW FILE pnp4nagios-npcd.sysvinit ---
#!/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 $?


--- NEW FILE pnp4nagios.logrotate.conf ---
/var/log/pnp4nagios/* {
    compress
    missingok
    notifempty
    rotate 5
    size 100K
}


--- NEW FILE pnp4nagios.spec ---
Name:           pnp4nagios
Version:        0.4.10
Release:        1%{?dist}
Summary:        Nagios performance data analysis tool

Group:          Applications/System
License:        GPLv2
URL:            http://www.pnp4nagios.org/
Source0:        http://downloads.sourceforge.net/%{name}/pnp-%{version}.tar.gz
Source1:        pnp4nagios.logrotate.conf
Source2:        pnp4nagios-npcd.sysvinit
Source3:        pnp4nagios-README.fedora
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  rrdtool
Requires:       nagios
Requires:       rrdtool
Requires:       php-gd
Requires(post): chkconfig
Requires(preun): chkconfig
Requires(preun): initscripts
Requires(postun): initscripts


%description
PNP is an addon to nagios which analyzes performance data provided by plugins
and stores them automatically into RRD-databases.


%prep
%setup -q -n pnp-%{version}
cp -p %{SOURCE3} README.fedora
sed -i -e 's/^INSTALL_OPTS="-o $nagios_user -g $nagios_grp"/INSTALL_OPTS=""/' \
    configure
sed -i -e '/^\t$(MAKE) strip-post-install$/d' src/Makefile.in


%build
%configure --bindir=%{_sbindir}/ \
           --libexecdir=%{_libexecdir}/%{name}/ \
           --sysconfdir=%{_sysconfdir}/%{name}/ \
           --localstatedir=%{_localstatedir}/log/%{name}/ \
           --datadir=%{_datadir}/nagios/html/%{name}/ \
           --datarootdir=%{_datadir}/nagios/html/%{name}/ \
           --with-perfdata-dir=%{_localstatedir}/lib/%{name}/ \
           --with-perfdata-spool-dir=%{_localstatedir}/spool/%{name}/
make %{?_smp_mflags} all


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT 
make install-config DESTDIR=$RPM_BUILD_ROOT 
find $RPM_BUILD_ROOT/%{_sysconfdir}/pnp4nagios -name *-sample -exec rename "-sample" "" {} ';'
sed -i -e 's|/usr/libexec/process_perfdata.pl|/usr/libexec/pnp4nagios/process_perfdata.pl|' \
       -e 's|^log_type = syslog|log_type = file|' \
       $RPM_BUILD_ROOT/%{_sysconfdir}/pnp4nagios/npcd.cfg

mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/%{name}
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/%{name}
install -Dp -m 0644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/pnp4nagios
install -Dp -m 0755 %{SOURCE2} $RPM_BUILD_ROOT%{_initrddir}/npcd


%clean
rm -rf $RPM_BUILD_ROOT


%post
/sbin/chkconfig --add npcd


%preun
if [ $1 = 0 ]; then
        /sbin/service npcd stop >/dev/null 2>&1
        /sbin/chkconfig --del npcd
fi


%postun
if [ "$1" -ge "1" ]; then
        /sbin/service npcd condrestart >/dev/null 2>&1 || :
fi


%files
%defattr(644,root,root,755)
%doc AUTHORS BUGS ChangeLog COPYING INSTALL NEWS README README.fedora
%doc README.npcd THANKS TODO
%dir %{_sysconfdir}/pnp4nagios
%config(noreplace) %{_sysconfdir}/pnp4nagios/*
%config(noreplace) %{_sysconfdir}/logrotate.d/pnp4nagios
%attr(755,root,root) %{_initrddir}/npcd
%attr(755,root,root) %{_sbindir}/npcd
%attr(755,root,root) %{_libexecdir}/pnp4nagios/process_perfdata.pl
%attr(755,nagios,nagios) %{_localstatedir}/lib/%{name}
%attr(755,nagios,nagios) %{_localstatedir}/log/%{name}
%attr(755,nagios,nagios) %{_localstatedir}/spool/%{name}
%{_datadir}/nagios/html/pnp4nagios


%changelog
* Wed Jul 09 2008 Xavier Bachelot <xavier at bachelot.org> 0.4.10-1
- Update to 0.4.10.

* Tue May 27 2008 Xavier Bachelot <xavier at bachelot.org> 0.4.9-3
- Fix npcd init script to use /etc/pnp4nagios.

* Tue May 27 2008 Xavier Bachelot <xavier at bachelot.org> 0.4.9-2
- Install npcd unstripped to let rpm do it.

* Sat May 24 2008 Xavier Bachelot <xavier at bachelot.org> 0.4.9-1
- Update to 0.4.9.
- Rename to pnp4nagios to match other distros packages.

* Mon Apr 14 2008 Xavier Bachelot <xavier at bachelot.org> 0.4.7-5
- Log to file by default.
- Kill pnpsender man page.

* Mon Apr 07 2008 Xavier Bachelot <xavier at bachelot.org> 0.4.7-4
- Install inside of nagios html dir.

* Mon Apr 07 2008 Xavier Bachelot <xavier at bachelot.org> 0.4.7-3
- Provide properly named config files.
- Add missing Requires:.
- Add a logrotate conf file.

* Fri Apr 04 2008 Xavier Bachelot <xavier at bachelot.org> 0.4.7-2
- Add an initscript for npcd.

* Wed Mar 19 2008 Xavier Bachelot <xavier at bachelot.org> 0.4.7-1
- Initial build.


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/pnp4nagios/EL-4/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	10 Jul 2008 21:06:15 -0000	1.1
+++ sources	11 Jul 2008 21:59:57 -0000	1.2
@@ -0,0 +1 @@
+5e57d50e2d895878b626497fd7b217b7  pnp-0.4.10.tar.gz




More information about the fedora-extras-commits mailing list