OBS-URL: https://build.opensuse.org/package/show/server:monitoring/eventdb?expand=0&rev=3
181 lines
5.4 KiB
RPMSpec
181 lines
5.4 KiB
RPMSpec
#
|
|
# spec file for package eventdb
|
|
#
|
|
# This file and all modifications and additions to the pristine
|
|
# package are under the same license as the package itsels
|
|
|
|
Name: eventdb2
|
|
Summary: Manage and administrate recipient events
|
|
Version: 2.0
|
|
Release: 1
|
|
Url: https://www.netways.org/projects/show/eventdb
|
|
License: GPL v2 or later
|
|
Group: System/Monitoring
|
|
Recommends: snmptt
|
|
Source0: eventdb-%version.tar.bz2
|
|
Source1: syslog-ng-ng2mysql.init
|
|
Requires: mysql
|
|
# for %pre/%post checks
|
|
BuildRequires: apache2
|
|
BuildRequires: php5
|
|
%if 0%{?suse_version} > 1020
|
|
BuildRequires: fdupes
|
|
%endif
|
|
BuildArch: noarch
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
%define nsusr nagios
|
|
%define nsgrp nagios
|
|
%define libexecdir %{_prefix}/lib/nagios/plugins
|
|
%define webdir %{_datadir}/%{name}
|
|
|
|
%description
|
|
EventDB is a Tool for an easy handling of event based data, e.g. SNMP Traps,
|
|
eMails or logfiles in monitoring systems like Nagios. It has multiple plugins
|
|
for different data sources and can be extended for new data input channels. The
|
|
webinterface allows users to search, filter and acknowledge all events.
|
|
Integration in Nagios is made through a Nagios plugin, which is also part of
|
|
this package.
|
|
|
|
|
|
%package www
|
|
Summary: Classic web interface
|
|
Group: System/Monitoring
|
|
PreReq: apache2
|
|
Requires: %{name} = %{version}
|
|
Requires: php-mysql
|
|
Requires: php-mbstring
|
|
Requires: php-mhash
|
|
Requires: apache2-mod_php
|
|
|
|
%description www
|
|
This package contains all parts for the classic web interface of eventdb.
|
|
|
|
|
|
%package syslog-ng2mysql
|
|
Summary: Daemon for writing directly into the MySQL database
|
|
Group: System/Daemons
|
|
PreReq: %insserv_prereq
|
|
Requires: %{name} = %{version}
|
|
Requires: syslog-ng
|
|
Requires: perl(NetAddr::IP::Util)
|
|
Requires: perl(DBD::mysql)
|
|
Requires: perl(DBI)
|
|
|
|
%description syslog-ng2mysql
|
|
Because direct from syslog-ng to database is not the fastest, a small perl
|
|
daemon (syslog-ng2mysql.pl) was introduced. Syslog-ng2mysql.pl opens a
|
|
unix-pipe on the one side and uses DBI on the other to write data to MySQL.
|
|
|
|
%package plugin
|
|
Summary: Check plugin for Icinga/Nagios
|
|
Group: System/Monitoring
|
|
Requires: %{name} = %{version}
|
|
Requires: python >= 2.4
|
|
Requires: python-mysql
|
|
|
|
%description plugin
|
|
The job of checking the EventDB for entries is done by this plugin.
|
|
|
|
%prep
|
|
%setup -q -n eventdb
|
|
find -name "*.gitignore" | xargs rm -rf
|
|
|
|
%build
|
|
#
|
|
|
|
%install
|
|
mkdir -p %{buildroot}%{webdir}
|
|
mkdir -p %{buildroot}%{_defaultdocdir}/%{name}
|
|
mkdir -p %{buildroot}%{_sysconfdir}/%{name}
|
|
# install documentation
|
|
cp -r db %{buildroot}%{_defaultdocdir}/%{name}/
|
|
cp -r doc/* %{buildroot}%{_defaultdocdir}/%{name}/
|
|
# install plugin including config
|
|
install -Dm755 plugin/check_eventdb.py %{buildroot}/%{libexecdir}/check_eventdb.py
|
|
# command definition
|
|
cat >>%{buildroot}/%{_defaultdocdir}/%{name}/check_eventdb_cmd.cfg<<EOF
|
|
define command {
|
|
command_name check_eventdb
|
|
command_line $USER1$/check_eventdb.py --dbuser=eventdb --dbpass=eventdb -H $HOSTNAME$ $ARG1$
|
|
}
|
|
EOF
|
|
# service definition
|
|
cat >>%{buildroot}/%{_defaultdocdir}/%{name}/check_eventdb_service.cfg<<EOF
|
|
define service {
|
|
use generic-service
|
|
host_name host1
|
|
service_description eventdb_error
|
|
check_command check_eventdb!--facility 4 --priority 0,1,2 -m "%ssh%" -w 1 -c 2 --label=ssh_errors
|
|
}
|
|
EOF
|
|
#
|
|
# install syslog-ng2mysql.pl
|
|
pushd agenten/syslog-ng
|
|
install -Dm755 %{SOURCE1} %buildroot/%{_sysconfdir}/init.d/syslog-ng2mysql
|
|
install -m644 syslog-ng.conf %{buildroot}/%{_defaultdocdir}/%{name}/
|
|
mkdir -p %{buildroot}/%{_defaultdocdir}/%{name}/agent-examples/
|
|
cp -r ../not_supported_yet/* %{buildroot}/%{_defaultdocdir}/%{name}/agent-examples/
|
|
install -Dm755 syslog-ng2mysql.pl %{buildroot}/%{_bindir}/syslog-ng2mysql.pl
|
|
popd
|
|
#
|
|
# classicWeb
|
|
install -Dm644 classicWeb/index.php %{buildroot}/%{webdir}/index.php
|
|
#
|
|
# icinga-cronk
|
|
pushd icinga-cronk
|
|
mkdir -p %buildroot/%{_datadir}/icinga
|
|
sed -i "s|icinga.path=/usr/local/icinga-web|icinga.path=%{_datadir}/icinga|g" build.properties
|
|
php ./phing.php -q install-cronk
|
|
popd
|
|
|
|
%clean
|
|
rm -rf %{buildroot}
|
|
|
|
%post www
|
|
if [ x"$1" == x"1" ]; then
|
|
# this is the initial installation: enable pnp4nagios
|
|
test -x %{_sbindir}/a2enflag && %{_sbindir}/a2enflag EVENTDB >/dev/null
|
|
fi
|
|
|
|
%postun www
|
|
if [ x"$1" == x"0" ]; then
|
|
# deinstallation of the package - remove the apache flag
|
|
test -x %{_sbindir}/a2disflag && %{_sbindir}/a2disflag EVENTDB >/dev/null
|
|
fi
|
|
|
|
%postun syslog-ng2mysql
|
|
%restart_on_update syslog-ng2mysql
|
|
#insserv_cleanup
|
|
|
|
%post syslog-ng2mysql
|
|
%{fillup_and_insserv -f -y syslog-ng2mysql}
|
|
|
|
%files
|
|
%defattr(0644,root,root,0755)
|
|
%doc %{_defaultdocdir}/%name/
|
|
%exclude %{_defaultdocdir}/%{name}/agent-examples
|
|
%exclude %{_defaultdocdir}/%{name}/check_eventdb*.cfg
|
|
%exclude %{_defaultdocdir}/%{name}/syslog-ng.conf
|
|
|
|
%files plugin
|
|
%defattr(-,root,root)
|
|
%dir %{_prefix}/lib/nagios
|
|
%dir %{libexecdir}
|
|
%doc %{_defaultdocdir}/%{name}/check_eventdb*.cfg
|
|
%{libexecdir}/check_eventdb.py
|
|
|
|
%files syslog-ng2mysql
|
|
%defattr(-,root,root)
|
|
%doc %{_defaultdocdir}/%{name}/syslog-ng.conf
|
|
%dir %{_defaultdocdir}/%{name}/agent-examples
|
|
%doc %{_defaultdocdir}/%{name}/agent-examples/*
|
|
%config %{_sysconfdir}/init.d/syslog-ng2mysql
|
|
%{_bindir}/syslog-ng2mysql.pl
|
|
|
|
%files www
|
|
%defattr(-,root,root)
|
|
%dir %{_datadir}/%{name}
|
|
%{_datadir}/%{name}/*
|
|
|
|
%changelog
|