2007-01-01 19:25:25 +01:00
#
2009-08-19 04:28:44 +02:00
#Pandora FMS Linux Agent
#
2023-02-16 19:24:56 +01:00
%global __os_install_post %{nil}
2009-08-19 04:28:44 +02:00
%define name pandorafms_agent
2010-11-23 20:34:32 +01:00
%define version 3.2
2009-08-19 04:28:44 +02:00
Summary: Pandora FMS Linux agent
2007-01-01 19:25:25 +01:00
Name: %{name}
Version: %{version}
2010-05-20 15:09:50 +02:00
Release: 1
2007-01-01 19:25:25 +01:00
License: GPL
2009-08-19 04:28:44 +02:00
Vendor: ArticaST <http://www.artica.es>
2007-01-01 19:25:25 +01:00
Source0: %{name}-%{version}.tar.gz
2009-08-19 04:28:44 +02:00
URL: http://pandorafms.org
2007-01-08 10:05:32 +01:00
Group: System/Monitoring
2009-08-19 09:12:56 +02:00
Packager: Manuel Arostegui <manuel@todo-linux.com>
2007-04-11 Manuel Arostegui <marostegui@artica.es>
* pandora_agents/linux/pandora_agent.conf, pandora_agents.spec: Changed
PATHS to adapt them to the upcoming 1.3 release.
* pandora_agents/bsd-ipso/pandora_agent_daemon, pandora_agent.conf,
pandora_agent.sh: Changed PATHS to adapt them to
the upcoming 1.3 release.
* pandora_agents/aix/pandora_agent_daemon, pandora_agent.conf,
pandora_agent.sh: Changed PATHS to adapt them
to the upcoming 1.3 release.
* pandora_agents/hp-ux/pandora_agent_daemon, pandora_agent.conf,
pandora_agent.sh: Changed PATHS to adapt them
to the upcoming 1.3 release.
* pandora_agents/win32/bin/pandora_agent.conf: Changed PATHS to
adapt them to the upcoming 1.3 release.
* pandora_agents/meta_agent/pandora_agent_sim.sh, pandora_agent_daemon,
pandora_agent_1.conf, pandora_agent_2.conf, pandora_agent_3.conf,
pandora_agent_4.conf, pandora_agent_5.conf: Changed PATHS
to adapt them to the upcoming 1.3 release.
* pandora_agents/solaris/pandora_agent_daemon, pandora_agent.conf,
pandora_agent.sh: Changed PATHS to adapt them to the upcoming
1.3 release.
* pandora_server/pandora_network, pandora_snmpconsole, pandora_server
pandora_recon: Changed PATHS to adapt them to the
upcoming 1.3 release.
* pandora_server/specs/fedoracore5/pandora_server.spec: Changed
PATHS to adapt them to the upcoming 1.3 release.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@418 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2007-04-11 14:52:04 +02:00
Prefix: /usr/share
2007-01-01 19:25:25 +01:00
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
BuildArchitectures: noarch
2009-08-19 04:28:44 +02:00
Requires: coreutils
2007-01-01 19:25:25 +01:00
AutoReq: 0
Provides: %{name}-%{version}
%description
2009-08-19 04:28:44 +02:00
Pandora FMS agents are based on native languages in every platform: scripts that can be written in any language. It’ s possible to reproduce any agent in any programming language and can be extended without difficulty the existing ones in order to cover aspects not taken into account up to the moment.
2007-01-03 19:47:54 +01:00
These scripts are formed by modules that each one gathers a "chunk" of information. Thus, every agent gathers several "chunks" of information; this one is organized in a data set and stored in a single file, called data file.
2007-01-01 19:25:25 +01:00
%prep
2007-06-18 10:59:39 +02:00
rm -rf $RPM_BUILD_ROOT
2007-01-01 19:25:25 +01:00
%setup -q -n linux
%build
%install
rm -rf $RPM_BUILD_ROOT
2007-02-02 13:37:08 +01:00
mkdir -p $RPM_BUILD_ROOT%{prefix}/pandora_agent/
2007-01-02 12:32:02 +01:00
mkdir -p $RPM_BUILD_ROOT/usr/bin/
2009-07-02 19:49:29 +02:00
mkdir -p $RPM_BUILD_ROOT/usr/sbin/
2007-01-02 12:32:02 +01:00
mkdir -p $RPM_BUILD_ROOT/etc/pandora/
2009-07-02 19:49:29 +02:00
mkdir -p $RPM_BUILD_ROOT/etc/init.d/
2007-01-02 12:32:02 +01:00
mkdir -p $RPM_BUILD_ROOT/var/log/pandora/
2009-12-28 19:37:58 +01:00
mkdir -p $RPM_BUILD_ROOT/var/spool/pandora/data_out
2007-02-02 13:37:08 +01:00
cp -aRf * $RPM_BUILD_ROOT%{prefix}/pandora_agent/
2009-07-02 19:49:29 +02:00
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/tentacle_client $RPM_BUILD_ROOT/usr/bin/
2009-12-28 19:37:58 +01:00
mv $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent $RPM_BUILD_ROOT/usr/bin/
2007-04-19 16:20:15 +02:00
mv $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent_daemon $RPM_BUILD_ROOT/etc/init.d/pandora_agent_daemon
2009-08-19 04:28:44 +02:00
# Checking old config file (if exists)
if [ -f /etc/pandora/pandora_agent.conf ] ; then
cp /etc/pandora/pandora_agent.conf /etc/pandora/pandora_agent.conf.backup
fi
cp $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent.conf $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent.conf.rpmnew
2009-07-02 19:49:29 +02:00
if [ -f $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent.spec ] ; then
rm $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent.spec
2007-01-01 19:25:25 +01:00
fi
%clean
2009-08-19 04:28:44 +02:00
rm -Rf $RPM_BUILD_ROOT
2009-07-02 19:49:29 +02:00
%pre
2009-08-19 04:28:44 +02:00
/usr/sbin/useradd -d %{prefix}/pandora -s /bin/false -M -g 0 pandora
2009-07-02 19:49:29 +02:00
exit 0
2009-08-19 04:28:44 +02:00
2007-01-01 19:25:25 +01:00
%post
2009-08-19 04:28:44 +02:00
if [ ! -d /etc/pandora ] ; then
mkdir -p /etc/pandora
fi
2009-07-02 19:49:29 +02:00
if [ ! -f /usr/share/pandora_agent/pandora_agent.conf ] ; then
2009-08-19 04:28:44 +02:00
cp /usr/share/pandora_agent/pandora_agent.conf.rpmnew /usr/share/pandora_agent/pandora_agent.conf
2009-07-02 19:49:29 +02:00
else
2009-08-19 04:28:44 +02:00
cp /usr/share/pandora_agent/pandora_agent.conf /etc/pandora/pandora_agent.conf.backup
cp /usr/share/pandora_agent/pandora_agent.conf.rpmnew /usr/share/pandora_agent/pandora_agent.conf
2009-07-02 19:49:29 +02:00
fi
2009-08-19 04:28:44 +02:00
if [ -f /etc/pandora/pandora_agent.conf ] ; then
2009-10-27 22:04:49 +01:00
mv /etc/pandora/pandora_agent.conf /etc/pandora/pandora_agent.conf_backup
2009-08-19 04:28:44 +02:00
fi
if [ ! -e /etc/pandora/plugins ]; then
ln -s /usr/share/pandora_agent/plugins /etc/pandora
fi
if [ ! -e /etc/pandora/pandora_agent.conf ]; then
ln -s /usr/share/pandora_agent/pandora_agent.conf /etc/pandora/pandora_agent.conf
fi
2009-12-29 12:07:59 +01:00
# Create default temp dir for agent. If not exist, agent will not work !
if [ ! -d /var/spool/pandora/data_out ] ; then
mkdir -p /var/spool/pandora/data_out
fi
2010-02-10 18:37:48 +01:00
chkconfig pandora_agent_daemon on
2009-07-02 19:49:29 +02:00
%preun
2009-08-23 23:52:53 +02:00
2010-02-10 18:37:48 +01:00
chkconfig --del pandora_agent_daemon
2009-08-23 23:52:53 +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
2009-07-02 19:49:29 +02:00
exit 0
2007-01-01 19:25:25 +01:00
%files
2009-08-19 04:28:44 +02:00
%defattr(750,pandora,root)
2009-07-02 19:49:29 +02:00
/usr/bin/pandora_agent
2009-08-23 23:52:53 +02:00
2009-08-19 04:28:44 +02:00
%defattr(770,pandora,root)
2007-01-02 12:32:02 +01:00
/var/log/pandora/
2009-08-23 23:52:53 +02:00
2009-08-19 04:28:44 +02:00
%defattr(755,pandora,root)
2009-07-02 19:49:29 +02:00
/usr/bin/tentacle_client
2007-06-18 10:59:39 +02:00
/etc/init.d/pandora_agent_daemon
2007-02-02 13:37:08 +01:00
%docdir %{prefix}/pandora_agents/docs
%{prefix}/pandora_agent
2008-03-19 11:22:54 +01:00
#%{_mandir}/man1/pandora.1.gz
#%{_mandir}/man1/pandora_agents.1.gz
2009-07-02 19:49:29 +02:00