2011-08-22 02:45:36 +02:00
|
|
|
#
|
|
|
|
#Pandora FMS Linux Agent
|
|
|
|
#
|
|
|
|
%define name pandorafms_agent_unix
|
2015-11-16 17:34:06 +01:00
|
|
|
%define version 6.1dev
|
2016-02-17 00:01:12 +01:00
|
|
|
%define release 160217
|
2011-08-22 02:45:36 +02:00
|
|
|
|
|
|
|
Summary: Pandora FMS Linux agent, PERL version
|
|
|
|
Name: %{name}
|
|
|
|
Version: %{version}
|
|
|
|
Release: %{release}
|
|
|
|
License: GPL
|
|
|
|
Vendor: ArticaST <http://www.artica.es>
|
|
|
|
Source0: %{name}-%{version}.tar.gz
|
|
|
|
URL: http://pandorafms.org
|
|
|
|
Group: System/Monitoring
|
|
|
|
Packager: Sancho Lerena <slerena@artica.es>
|
|
|
|
Prefix: /usr/share
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
|
|
|
|
BuildArch: noarch
|
2011-09-29 12:37:38 +02:00
|
|
|
PreReq: /bin/sed /bin/grep /usr/sbin/useradd
|
2016-02-02 16:03:15 +01:00
|
|
|
Requires: coreutils unzip perl
|
2011-08-22 02:45:36 +02:00
|
|
|
AutoReq: 0
|
|
|
|
Provides: %{name}-%{version}
|
|
|
|
|
|
|
|
%description
|
|
|
|
Pandora FMS agent for unix. Pandora FMS is an OpenSource full-featured monitoring software.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
|
|
|
%setup -q -n unix
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
|
|
|
%install
|
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
mkdir -p $RPM_BUILD_ROOT%{prefix}/pandora_agent/
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/usr/bin/
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/usr/sbin/
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/etc/pandora/
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/etc/init.d/
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/var/log/pandora/
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/usr/share/man/man1/
|
2015-11-02 16:52:30 +01:00
|
|
|
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/
|
2011-08-22 02:45:36 +02:00
|
|
|
cp -aRf * $RPM_BUILD_ROOT%{prefix}/pandora_agent/
|
|
|
|
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/tentacle_client $RPM_BUILD_ROOT/usr/bin/
|
|
|
|
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent $RPM_BUILD_ROOT/usr/bin/
|
|
|
|
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent_exec $RPM_BUILD_ROOT/usr/bin/
|
|
|
|
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent_daemon $RPM_BUILD_ROOT/etc/init.d/pandora_agent_daemon
|
|
|
|
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent_daemon $RPM_BUILD_ROOT/etc/init.d/pandora_agent_daemon
|
|
|
|
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/man/man1/pandora_agent.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/
|
|
|
|
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/man/man1/tentacle_client.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/
|
|
|
|
|
|
|
|
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/Linux/pandora_agent.conf $RPM_BUILD_ROOT/usr/share/pandora_agent/pandora_agent.conf.rpmnew
|
|
|
|
|
2015-11-02 16:52:30 +01:00
|
|
|
install -m 0644 pandora_agent_logrotate $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/pandora_agent
|
|
|
|
|
2011-08-22 02:45:36 +02:00
|
|
|
if [ -f $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent.spec ] ; then
|
|
|
|
rm $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent.spec
|
|
|
|
fi
|
|
|
|
|
|
|
|
%clean
|
|
|
|
rm -Rf $RPM_BUILD_ROOT
|
|
|
|
|
|
|
|
%pre
|
2012-06-27 08:54:08 +02:00
|
|
|
getent passwd pandora >/dev/null || \
|
|
|
|
/usr/sbin/useradd -d %{prefix}/pandora -s /bin/false -M -g 0 pandora
|
2011-08-22 02:45:36 +02:00
|
|
|
exit 0
|
2015-10-20 12:01:53 +02:00
|
|
|
chown pandora:root /var/log/pandora
|
2011-08-22 02:45:36 +02:00
|
|
|
|
|
|
|
%post
|
|
|
|
if [ ! -d /etc/pandora ] ; then
|
|
|
|
mkdir -p /etc/pandora
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -f /usr/share/pandora_agent/pandora_agent.conf ] ; then
|
|
|
|
cp /usr/share/pandora_agent/pandora_agent.conf.rpmnew /usr/share/pandora_agent/pandora_agent.conf
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -f /etc/pandora/pandora_agent.conf ] ; then
|
|
|
|
ln -s /usr/share/pandora_agent/pandora_agent.conf /etc/pandora/pandora_agent.conf
|
|
|
|
else
|
|
|
|
ln -s /usr/share/pandora_agent/pandora_agent.conf.rpmnew /etc/pandora/pandora_agent.conf.rpmnew
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -e /etc/pandora/plugins ]; then
|
|
|
|
ln -s /usr/share/pandora_agent/plugins /etc/pandora
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -e /etc/pandora/collections ]; then
|
|
|
|
ln -s /usr/share/pandora_agent/collections /etc/pandora
|
|
|
|
fi
|
|
|
|
|
|
|
|
mkdir -p /var/spool/pandora/data_out
|
2016-02-01 11:01:17 +01:00
|
|
|
if [ ! -d /var/log/pandora ]; then
|
|
|
|
mkdir -p /var/log/pandora
|
|
|
|
fi
|
2013-07-03 13:41:25 +02:00
|
|
|
/sbin/chkconfig --add pandora_agent_daemon
|
|
|
|
/sbin/chkconfig pandora_agent_daemon on
|
2016-02-02 16:03:15 +01:00
|
|
|
echo "You may need to install manually some additional required dependencies:"
|
|
|
|
echo "perl-Sys-Syslog"
|
2011-08-22 02:45:36 +02:00
|
|
|
|
|
|
|
%preun
|
|
|
|
|
|
|
|
# Upgrading
|
|
|
|
if [ "$1" = "1" ]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2013-07-03 13:41:25 +02:00
|
|
|
/sbin/chkconfig --del pandora_agent_daemon
|
2011-08-22 02:45:36 +02:00
|
|
|
/etc/init.d/pandora_agent_daemon stop
|
|
|
|
rm /etc/init.d/pandora_agent_daemon
|
|
|
|
/usr/sbin/userdel pandora
|
|
|
|
rm -Rf /etc/pandora/pandora_agent.conf
|
|
|
|
rm -Rf /var/log/pandora/pandora_agent* 2> /dev/null
|
|
|
|
rm -Rf /usr/share/pandora_agent
|
|
|
|
rm -Rf /usr/share/man/man1/pandora_agent.1.gz
|
|
|
|
rm -Rf /usr/share/man/man1/tentacle_client.1.gz
|
|
|
|
exit 0
|
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(750,pandora,root)
|
|
|
|
/usr/bin/pandora_agent
|
|
|
|
/usr/bin/pandora_agent_exec
|
2015-11-02 16:52:30 +01:00
|
|
|
%config(noreplace) %{_sysconfdir}/logrotate.d/pandora_agent
|
2011-08-22 02:45:36 +02:00
|
|
|
|
|
|
|
%defattr(755,pandora,root)
|
|
|
|
/usr/bin/tentacle_client
|
|
|
|
/etc/init.d/pandora_agent_daemon
|
|
|
|
%docdir %{prefix}/pandora_agents/docs
|
|
|
|
%{prefix}/pandora_agent
|
|
|
|
|
|
|
|
%defattr(644,pandora,root)
|
|
|
|
/usr/share/man/man1/pandora_agent.1.gz
|
|
|
|
/usr/share/man/man1/tentacle_client.1.gz
|
|
|
|
|