2008-03-19 11:12:45 +01:00
#
2008-09-08 18:12:57 +02:00
# Pandora FMS Server
2008-03-19 11:12:45 +01:00
#
2023-02-16 19:24:56 +01:00
%global __os_install_post %{nil}
2009-08-19 03:41:25 +02:00
%define name pandorafms_server
2023-05-09 11:02:11 +02:00
%define version 7.0NG.771
2023-06-06 01:00:20 +02:00
%define release 230606
2009-06-30 11:10:58 +02:00
2008-09-08 18:12:57 +02:00
Summary: Pandora FMS Server
2008-03-19 11:12:45 +01:00
Name: %{name}
Version: %{version}
2009-06-30 11:10:58 +02:00
Release: %{release}
2008-03-19 11:12:45 +01:00
License: GPL
2009-08-19 03:41:25 +02:00
Vendor: ArticaST <http://www.artica.es>
2008-03-19 11:12:45 +01:00
Source0: %{name}-%{version}.tar.gz
2008-09-08 18:12:57 +02:00
URL: http://www.pandorafms.com
2008-03-19 11:12:45 +01:00
Group: System/Monitoring
2011-08-10 12:37:36 +02:00
Packager: Sancho Lerena <slerena@artica.es>
2008-03-19 11:12:45 +01:00
Prefix: /usr/share
BuildRoot: %{_tmppath}/%{name}-buildroot
2011-08-22 02:41:14 +02:00
BuildArch: noarch
2019-12-23 13:28:38 +01:00
# PreReq: %fillup_prereq %insserv_prereq /usr/bin/sed /usr/bin/grep /usr/sbin/useradd
Requires(pre,preun):/usr/bin/sed /usr/bin/grep /usr/sbin/useradd
2008-03-19 11:12:45 +01:00
AutoReq: 0
Provides: %{name}-%{version}
2011-02-07 14:45:34 +01:00
Requires: perl-DBI perl-DBD-mysql perl-libwww-perl
2011-08-25 20:24:08 +02:00
Requires: perl-NetAddr-IP net-snmp net-tools perl-XML-Twig
2020-12-15 12:57:48 +01:00
Requires: fping nmap sudo perl-HTML-Tree perl-XML-Simple perl-Net-Telnet
2019-09-11 13:36:14 +02:00
Requires: perl-IO-Socket-INET6 perl-Socket6 perl-IO-Socket-SSL snmp-mibs perl-JSON
2018-07-05 19:04:13 +02:00
Requires: perl-Encode-Locale perl-Geo-IP
2008-03-19 11:12:45 +01:00
%description
2011-08-10 12:37:36 +02:00
Pandora FMS is a monitoring Open Source software. It watches your systems and applications, and allows you to know the status of any element of those systems.
Pandora FMS could detect a network interface down, a defacement in your website, a memory leak in one of your server application, or the movement of any value of the NASDAQ new technology market. Pandora FMS could send out SMS message when your systems fails... or when Google's value drop below US348.60?
Pandora FMS runs on any operating system, with specific agents for each platform, gathering data and sending it to a server, it has specific agents for GNU/Linux, AIX, Solaris, HP-UX, BSD/IPSO, and Windows 2000, XP and 2003.
Pandora FMS can also monitor any kind of TCP/IP service, without the need to install agents, and monitor network systems such as load balancers, routers, switches, operating systems, applications, or simply printers if you need. Pandora FMS also supports SNMP for collecting data and for receiving traps.
A few examples of common resources monitored by Pandora FMS could be processor load, disk and memory usage, running processes, log files, environmental factors such as temperature, or application values like strings contained in web pages or any possible way to collect data in an automatic way.
2008-03-19 11:12:45 +01:00
%prep
2020-01-08 11:22:14 +01:00
rm -rf $RPM_BUILD_ROOT
2008-03-19 11:12:45 +01:00
2020-01-08 13:19:51 +01:00
%setup -q -n pandora_server
2008-03-19 11:12:45 +01:00
%build
%install
2009-08-19 03:41:25 +02:00
2020-01-08 11:22:14 +01:00
rm -rf $RPM_BUILD_ROOT
2008-03-19 11:12:45 +01:00
mkdir -p $RPM_BUILD_ROOT/usr/bin/
2009-06-30 11:50:35 +02:00
mkdir -p $RPM_BUILD_ROOT/usr/sbin/
2008-03-19 11:12:45 +01:00
mkdir -p $RPM_BUILD_ROOT/etc/init.d/
mkdir -p $RPM_BUILD_ROOT/etc/pandora/
2018-04-30 13:11:38 +02:00
mkdir -p $RPM_BUILD_ROOT/etc/tentacle/
2008-03-19 11:12:45 +01:00
mkdir -p $RPM_BUILD_ROOT/var/spool/pandora/data_in
2009-08-28 13:07:52 +02:00
mkdir -p $RPM_BUILD_ROOT/var/spool/pandora/data_in/conf
mkdir -p $RPM_BUILD_ROOT/var/spool/pandora/data_in/md5
2010-07-19 12:17:17 +02:00
mkdir -p $RPM_BUILD_ROOT/var/spool/pandora/data_in/collections
2012-01-24 19:46:00 +01:00
mkdir -p $RPM_BUILD_ROOT/var/spool/pandora/data_in/netflow
2023-03-09 10:49:54 +01:00
mkdir -p $RPM_BUILD_ROOT/var/spool/pandora/data_in/sflow
2016-06-13 14:34:30 +02:00
mkdir -p $RPM_BUILD_ROOT/var/spool/pandora/data_in/trans
2019-11-21 18:21:46 +01:00
mkdir -p $RPM_BUILD_ROOT/var/spool/pandora/data_in/commands
2008-03-19 11:12:45 +01:00
mkdir -p $RPM_BUILD_ROOT/var/log/pandora/
2009-06-30 11:10:58 +02:00
mkdir -p $RPM_BUILD_ROOT%{prefix}/pandora_server/conf/
2023-04-10 14:43:33 +02:00
mkdir -p $RPM_BUILD_ROOT%{prefix}/pandora_server/conf.d/
2018-04-30 13:11:38 +02:00
mkdir -p $RPM_BUILD_ROOT%{prefix}/tentacle/conf/
2010-05-19 19:09:15 +02:00
mkdir -p $RPM_BUILD_ROOT/usr/lib/perl5/
2010-06-09 13:45:18 +02:00
mkdir -p $RPM_BUILD_ROOT/usr/share/man/man1/
2009-09-16 02:02:23 +02:00
2009-12-18 19:22:33 +01:00
# All binaries go to /usr/bin
cp -aRf bin/pandora_server $RPM_BUILD_ROOT/usr/bin/
cp -aRf bin/pandora_exec $RPM_BUILD_ROOT/usr/bin/
cp -aRf bin/tentacle_server $RPM_BUILD_ROOT/usr/bin/
2009-09-16 02:02:23 +02:00
2018-04-30 13:11:38 +02:00
cp -aRf conf/pandora_* $RPM_BUILD_ROOT%{prefix}/pandora_server/conf/
2013-11-08 12:20:27 +01:00
cp -aRf conf/pandora_server.conf.new $RPM_BUILD_ROOT/etc/pandora/
2023-04-10 14:43:33 +02:00
cp -aRf conf/pandora_server_sec.conf.template $RPM_BUILD_ROOT/etc/pandora/conf.d/pandora_server_sec.conf.template
2018-04-30 13:11:38 +02:00
cp -aRf conf/tentacle_* $RPM_BUILD_ROOT%{prefix}/tentacle/conf/
cp -aRf conf/tentacle_server.conf.new $RPM_BUILD_ROOT/etc/tentacle/
2009-06-30 11:10:58 +02:00
cp -aRf util $RPM_BUILD_ROOT%{prefix}/pandora_server/
2021-06-14 13:56:42 +02:00
cp -aRf util/pandora_ha.pl $RPM_BUILD_ROOT/usr/bin/pandora_ha
2010-05-19 19:09:15 +02:00
cp -aRf lib/* $RPM_BUILD_ROOT/usr/lib/perl5/
2014-09-15 11:33:53 +02:00
cp -aRf AUTHORS COPYING README $RPM_BUILD_ROOT%{prefix}/pandora_server/
2009-09-16 02:02:23 +02:00
cp -aRf util/pandora_server $RPM_BUILD_ROOT/etc/init.d/
2009-08-19 03:41:25 +02:00
cp -aRf util/tentacle_serverd $RPM_BUILD_ROOT/etc/init.d/
2008-03-19 11:12:45 +01:00
2010-06-09 12:46:06 +02:00
cp -aRf man/man1/pandora_server.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/
2010-06-09 13:34:49 +02:00
cp -aRf man/man1/tentacle_server.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/
2010-06-09 12:46:06 +02:00
2013-05-22 18:58:14 +02:00
rm -Rf $RPM_BUILD_ROOT%{prefix}/pandora_server/util/PandoraFMS
rm -Rf $RPM_BUILD_ROOT%{prefix}/pandora_server/util/recon_scripts/PandoraFMS
2010-05-20 16:16:43 +02:00
2008-03-19 11:12:45 +01:00
%clean
rm -fr $RPM_BUILD_ROOT
2009-12-18 19:22:33 +01:00
2009-06-30 11:10:58 +02:00
%pre
2011-08-22 02:41:14 +02:00
if [ "`id pandora | grep uid | wc -l`" = 0 ]
then
/usr/sbin/useradd -d %{prefix}/pandora -s /bin/false -M -g 0 pandora
fi
2023-02-15 10:36:49 +01:00
current_ver=$(perl -le 'eval "require $ARGV[0]" and print $ARGV[0]->VERSION' Thread::Semaphore 2> /dev/null | cut -d '.' -f 2)
if [ $((current_ver)) -lt 13 ] ; then
2023-02-15 12:20:31 +01:00
echo "perl Thread::Semaphore version >= 2.13 should be installed. Current version installed ver: $(perl -le 'eval "require $ARGV[0]" and print $ARGV[0]->VERSION' Thread::Semaphore 2> /dev/null)"
2023-02-15 10:36:49 +01:00
exit 1
fi
2009-06-30 11:10:58 +02:00
2008-03-19 11:12:45 +01:00
%post
2020-06-25 12:10:38 +02:00
if [ `command -v systemctl` ];
2020-06-24 13:33:22 +02:00
then
2020-08-28 14:16:57 +02:00
echo "Copying new version for tentacle_serverd service"
cp -f /usr/share/pandora_server/util/tentacle_serverd.service /usr/lib/systemd/system/
2020-06-24 13:33:22 +02:00
chmod -x /usr/lib/systemd/system/tentacle_serverd.service
# Enable the service on SystemD
systemctl enable tentacle_serverd.service
else
chkconfig tentacle_serverd on
fi
chkconfig pandora_server on
2009-12-18 19:22:33 +01:00
2020-06-24 13:33:22 +02:00
# Enable the service on SystemD
2017-10-03 17:56:13 +02:00
systemctl enable pandora_server.service
2013-04-01 03:28:14 +02:00
echo "/usr/share/pandora_server/util/pandora_db.pl /etc/pandora/pandora_server.conf" > /etc/cron.hourly/pandora_db
chmod 750 /etc/cron.hourly/pandora_db
2021-03-31 18:38:14 +02:00
if [ -d /etc/logrotate.d ] ; then
if [ ! -f /etc/logrotate.d/pandora_server ] ; then
cp -aRf /usr/share/pandora_server/util/pandora_server_logrotate /etc/logrotate.d/pandora_server
fi
fi
2009-06-30 11:10:58 +02:00
if [ ! -d /etc/pandora ] ; then
mkdir -p /etc/pandora
fi
2009-08-19 03:41:25 +02:00
2018-04-30 13:11:38 +02:00
# Avoid to overwrite config files on upgrades
# Main configuration files
2013-05-22 18:58:14 +02:00
if [ ! -e "/etc/pandora/pandora_server.conf" ]
then
echo "Creating a new version of Pandora FMS Server config file at /etc/pandora/pandora_server.conf"
cat /etc/pandora/pandora_server.conf.new > /etc/pandora/pandora_server.conf
else
# Do a copy of current .conf, just in case.
echo "An existing version of pandora_server.conf is found."
cat /etc/pandora/pandora_server.conf > /etc/pandora/pandora_server.conf.old
2009-06-30 11:10:58 +02:00
fi
2018-04-30 13:11:38 +02:00
# Tentacle config files
if [ ! -e "/etc/tentacle/tentacle_server.conf" ]
then
echo "Creating a new version of Tentacle Server config file at /etc/tentacle/tentacle_server.conf"
cat /etc/tentacle/tentacle_server.conf.new > /etc/tentacle/tentacle_server.conf
fi
2009-06-30 11:10:58 +02:00
2009-12-28 19:00:53 +01:00
echo "Don't forget to start Tentacle Server daemon if you want to receive"
echo "data using tentacle"
2009-06-30 11:10:58 +02:00
2020-09-08 11:53:53 +02:00
if [ "$1" -gt 1 ]
then
echo "If Tentacle Server daemon was running with init.d script,"
echo "please stop it manually and start the service with systemctl"
fi
2013-05-22 18:58:14 +02:00
exit 0
2009-06-30 11:10:58 +02:00
%preun
2010-06-04 11:42:14 +02:00
# Upgrading
if [ "$1" = "1" ]; then
exit 0
fi
2023-02-15 10:36:49 +01:00
current_ver=$(perl -le 'eval "require $ARGV[0]" and print $ARGV[0]->VERSION' Thread::Semaphore 2> /dev/null | cut -d '.' -f 2)
if [ $((current_ver)) -lt 13 ] ; then
2023-02-15 12:20:31 +01:00
echo "perl Thread::Semaphore version >= 2.13 should be installed. Current version installed ver: $(perl -le 'eval "require $ARGV[0]" and print $ARGV[0]->VERSION' Thread::Semaphore 2> /dev/null)"
2023-02-15 10:36:49 +01:00
exit 1
fi
2009-08-23 23:49:25 +02:00
/etc/init.d/pandora_server stop &>/dev/null
/etc/init.d/tentacle_serverd stop &>/dev/null
2010-01-22 15:24:56 +01:00
chkconfig --del pandora_server
chkconfig --del tentacle_serverd
2009-06-30 11:10:58 +02:00
2009-09-30 02:00:22 +02:00
%postun
2010-06-04 12:37:26 +02:00
# Upgrading
if [ "$1" = "1" ]; then
exit 0
fi
2009-09-30 02:00:22 +02:00
rm -Rf /etc/init.d/tentacle_serverd
rm -Rf /etc/init.d/pandora_server
rm -Rf %{prefix}pandora_server
rm -Rf /var/log/pandora
2010-05-19 19:09:15 +02:00
rm -Rf /usr/lib/perl5/PandoraFMS/
2013-05-22 18:58:14 +02:00
rm -Rf /etc/pandora/pandora_server.conf*
2023-04-10 14:43:33 +02:00
rm -Rf /etc/pandora/conf.d/*
2018-04-30 13:11:38 +02:00
rm -Rf /etc/tentacle/tentacle_server.conf*
2009-09-30 02:00:22 +02:00
rm -Rf /var/spool/pandora
rm -Rf /etc/init.d/pandora_server /etc/init.d/tentacle_serverd
2009-12-18 19:22:33 +01:00
rm -Rf /usr/bin/pandora_exec /usr/bin/pandora_server /usr/bin/tentacle_server
2021-06-14 13:56:42 +02:00
rm -Rf /usr/bin/pandora_ha
2013-04-01 03:28:14 +02:00
rm -Rf /etc/cron.hourly/pandora_db
2015-11-02 16:52:30 +01:00
rm -Rf /etc/logrotate.d/pandora_server
2010-06-09 12:46:06 +02:00
rm -Rf /usr/share/man/man1/pandora_server.1.gz
2010-06-09 13:34:49 +02:00
rm -Rf /usr/share/man/man1/tentacle_server.1.gz
2009-09-30 02:00:22 +02:00
2008-03-19 11:12:45 +01:00
%files
2009-06-30 11:10:58 +02:00
2009-08-19 03:41:25 +02:00
%defattr(750,pandora,root)
2008-03-19 11:12:45 +01:00
/etc/init.d/pandora_server
2009-06-30 11:10:58 +02:00
/etc/init.d/tentacle_serverd
2009-09-04 14:18:42 +02:00
%defattr(755,pandora,root)
2009-12-18 19:22:33 +01:00
/usr/bin/pandora_exec
/usr/bin/pandora_server
/usr/bin/tentacle_server
2021-06-14 13:56:42 +02:00
/usr/bin/pandora_ha
2008-03-19 11:12:45 +01:00
2013-06-26 11:22:10 +02:00
%defattr(755,pandora,root,755)
2010-05-19 19:09:15 +02:00
/usr/lib/perl5/PandoraFMS/
2009-06-30 11:10:58 +02:00
%{prefix}/pandora_server
2018-04-30 13:11:38 +02:00
%{prefix}/tentacle
2008-03-19 11:12:45 +01:00
/var/log/pandora
2009-06-30 11:10:58 +02:00
2017-02-27 13:06:19 +01:00
%defattr(-,pandora,www,2770)
2009-08-19 03:41:25 +02:00
/var/spool/pandora
2010-09-23 14:06:15 +02:00
/var/spool/pandora/data_in
2010-07-19 12:49:40 +02:00
/var/spool/pandora/data_in/md5
/var/spool/pandora/data_in/collections
2012-01-24 19:46:00 +01:00
/var/spool/pandora/data_in/netflow
2023-03-09 10:49:54 +01:00
/var/spool/pandora/data_in/sflow
2011-08-08 17:42:55 +02:00
/var/spool/pandora/data_in/conf
2016-06-13 14:34:30 +02:00
/var/spool/pandora/data_in/trans
2019-11-21 18:21:46 +01:00
/var/spool/pandora/data_in/commands
2009-08-19 03:41:25 +02:00
2013-06-26 11:22:10 +02:00
%defattr(-,pandora,root,750)
2009-08-19 03:41:25 +02:00
/etc/pandora
2009-06-30 11:50:35 +02:00
2018-04-30 16:22:52 +02:00
%defattr(-,pandora,root,754)
2018-04-30 13:11:38 +02:00
/etc/tentacle
2009-06-30 11:50:35 +02:00
2010-06-09 13:34:49 +02:00
%defattr(644,pandora,root)
/usr/share/man/man1/pandora_server.1.gz
/usr/share/man/man1/tentacle_server.1.gz