"Fossies" - the Fresh Open Source Software Archive

Member "pandora_server/pandora_server.spec" (5 Nov 2021, 8395 Bytes) of package /linux/misc/pandorafms_server-7.0NG.758.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) RPM Spec source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "pandora_server.spec": 7.0NG.757_vs_7.0NG.758.

    1 #
    2 # Pandora FMS Server 
    3 #
    4 %define name        pandorafms_server
    5 %define version     7.0NG.758
    6 %define release     211105
    7 
    8 Summary:            Pandora FMS Server
    9 Name:               %{name}
   10 Version:            %{version}
   11 Release:            %{release}
   12 License:            GPL
   13 Vendor:             ArticaST <http://www.artica.es>
   14 Source0:            %{name}-%{version}.tar.gz
   15 URL:                http://www.pandorafms.com
   16 Group:              System/Monitoring
   17 Packager:           Sancho Lerena <slerena@artica.es>
   18 Prefix:             /usr/share
   19 BuildRoot:          %{_tmppath}/%{name}-buildroot
   20 BuildArch:          noarch 
   21 # PreReq:            %fillup_prereq %insserv_prereq /usr/bin/sed /usr/bin/grep /usr/sbin/useradd
   22 Requires(pre,preun):/usr/bin/sed /usr/bin/grep /usr/sbin/useradd
   23 AutoReq:            0
   24 Provides:           %{name}-%{version}
   25 Requires:           perl-DBI perl-DBD-mysql perl-libwww-perl
   26 Requires:           perl-NetAddr-IP net-snmp net-tools perl-XML-Twig
   27 Requires:           fping nmap sudo perl-HTML-Tree perl-XML-Simple perl-Net-Telnet
   28 Requires:           perl-IO-Socket-INET6 perl-Socket6 perl-IO-Socket-SSL snmp-mibs perl-JSON
   29 Requires:           perl-Encode-Locale perl-Geo-IP
   30 
   31 %description
   32 
   33 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. 
   34 
   35 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? 
   36 
   37 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. 
   38 
   39 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. 
   40 
   41 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.
   42 
   43 
   44 %prep
   45 rm -rf $RPM_BUILD_ROOT
   46 
   47 %setup -q -n pandora_server
   48 
   49 %build
   50 
   51 %install
   52 
   53 rm -rf $RPM_BUILD_ROOT
   54 mkdir -p $RPM_BUILD_ROOT/usr/bin/
   55 mkdir -p $RPM_BUILD_ROOT/usr/sbin/
   56 mkdir -p $RPM_BUILD_ROOT/etc/init.d/
   57 mkdir -p $RPM_BUILD_ROOT/etc/pandora/
   58 mkdir -p $RPM_BUILD_ROOT/etc/tentacle/
   59 mkdir -p $RPM_BUILD_ROOT/var/spool/pandora/data_in
   60 mkdir -p $RPM_BUILD_ROOT/var/spool/pandora/data_in/conf
   61 mkdir -p $RPM_BUILD_ROOT/var/spool/pandora/data_in/md5
   62 mkdir -p $RPM_BUILD_ROOT/var/spool/pandora/data_in/collections
   63 mkdir -p $RPM_BUILD_ROOT/var/spool/pandora/data_in/netflow
   64 mkdir -p $RPM_BUILD_ROOT/var/spool/pandora/data_in/trans
   65 mkdir -p $RPM_BUILD_ROOT/var/spool/pandora/data_in/commands
   66 mkdir -p $RPM_BUILD_ROOT/var/log/pandora/
   67 mkdir -p $RPM_BUILD_ROOT%{prefix}/pandora_server/conf/
   68 mkdir -p $RPM_BUILD_ROOT%{prefix}/tentacle/conf/
   69 mkdir -p $RPM_BUILD_ROOT/usr/lib/perl5/
   70 mkdir -p $RPM_BUILD_ROOT/usr/share/man/man1/
   71 
   72 # All binaries go to /usr/bin
   73 cp -aRf bin/pandora_server $RPM_BUILD_ROOT/usr/bin/
   74 cp -aRf bin/pandora_exec $RPM_BUILD_ROOT/usr/bin/
   75 cp -aRf bin/tentacle_server $RPM_BUILD_ROOT/usr/bin/
   76 
   77 cp -aRf conf/pandora_* $RPM_BUILD_ROOT%{prefix}/pandora_server/conf/
   78 cp -aRf conf/pandora_server.conf.new $RPM_BUILD_ROOT/etc/pandora/
   79 cp -aRf conf/tentacle_* $RPM_BUILD_ROOT%{prefix}/tentacle/conf/
   80 cp -aRf conf/tentacle_server.conf.new $RPM_BUILD_ROOT/etc/tentacle/
   81 cp -aRf util $RPM_BUILD_ROOT%{prefix}/pandora_server/
   82 cp -aRf util/pandora_ha.pl $RPM_BUILD_ROOT/usr/bin/pandora_ha
   83 cp -aRf lib/* $RPM_BUILD_ROOT/usr/lib/perl5/
   84 cp -aRf AUTHORS COPYING README $RPM_BUILD_ROOT%{prefix}/pandora_server/
   85 
   86 cp -aRf util/pandora_server $RPM_BUILD_ROOT/etc/init.d/
   87 cp -aRf util/tentacle_serverd $RPM_BUILD_ROOT/etc/init.d/
   88 
   89 cp -aRf man/man1/pandora_server.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/
   90 cp -aRf man/man1/tentacle_server.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/
   91 
   92 rm -Rf $RPM_BUILD_ROOT%{prefix}/pandora_server/util/PandoraFMS
   93 rm -Rf $RPM_BUILD_ROOT%{prefix}/pandora_server/util/recon_scripts/PandoraFMS
   94 
   95 %clean
   96 rm -fr $RPM_BUILD_ROOT
   97 
   98 %pre
   99 if [ "`id pandora | grep uid | wc -l`" = 0 ]
  100 then
  101     /usr/sbin/useradd -d %{prefix}/pandora -s /bin/false -M -g 0 pandora
  102 fi
  103 exit 0
  104 
  105 %post
  106 if [ `command -v systemctl` ];
  107 then
  108         echo "Copying new version for tentacle_serverd service"
  109         cp -f /usr/share/pandora_server/util/tentacle_serverd.service /usr/lib/systemd/system/
  110         chmod -x /usr/lib/systemd/system/tentacle_serverd.service
  111 
  112 # Enable the service on SystemD
  113         systemctl enable tentacle_serverd.service
  114 else
  115         chkconfig tentacle_serverd on
  116 fi
  117 
  118 chkconfig pandora_server on
  119 
  120 # Enable the service on SystemD
  121 systemctl enable pandora_server.service
  122 
  123 
  124 echo "/usr/share/pandora_server/util/pandora_db.pl /etc/pandora/pandora_server.conf" > /etc/cron.hourly/pandora_db
  125 chmod 750 /etc/cron.hourly/pandora_db
  126 
  127 if [ -d /etc/logrotate.d ] ; then
  128    if [ ! -f /etc/logrotate.d/pandora_server ] ; then
  129       cp -aRf /usr/share/pandora_server/util/pandora_server_logrotate /etc/logrotate.d/pandora_server
  130    fi
  131 fi
  132 
  133 if [ ! -d /etc/pandora ] ; then
  134    mkdir -p /etc/pandora
  135 fi
  136 
  137 # Avoid to overwrite config files on upgrades
  138 # Main configuration files
  139 if [ ! -e "/etc/pandora/pandora_server.conf" ]
  140 then
  141         echo "Creating a new version of Pandora FMS Server config file at /etc/pandora/pandora_server.conf"
  142         cat /etc/pandora/pandora_server.conf.new > /etc/pandora/pandora_server.conf
  143 else
  144         # Do a copy of current .conf, just in case.
  145         echo "An existing version of pandora_server.conf is found."
  146         cat /etc/pandora/pandora_server.conf > /etc/pandora/pandora_server.conf.old
  147 fi
  148 # Tentacle config files
  149 if [ ! -e "/etc/tentacle/tentacle_server.conf" ]
  150 then
  151         echo "Creating a new version of Tentacle Server config file at /etc/tentacle/tentacle_server.conf"
  152         cat /etc/tentacle/tentacle_server.conf.new > /etc/tentacle/tentacle_server.conf
  153 fi
  154 
  155 echo "Don't forget to start Tentacle Server daemon if you want to receive"
  156 echo "data using tentacle"
  157 
  158 if [ "$1" -gt 1 ]
  159 then
  160 
  161       echo "If Tentacle Server daemon was running with init.d script,"
  162       echo "please stop it manually and start the service with systemctl"
  163 
  164 fi
  165 
  166 exit 0
  167 
  168 %preun
  169 
  170 # Upgrading
  171 if [ "$1" = "1" ]; then
  172         exit 0
  173 fi
  174 
  175 /etc/init.d/pandora_server stop &>/dev/null
  176 /etc/init.d/tentacle_serverd stop &>/dev/null
  177 chkconfig --del pandora_server
  178 chkconfig --del tentacle_serverd
  179 
  180 %postun
  181 
  182 # Upgrading
  183 if [ "$1" = "1" ]; then
  184         exit 0
  185 fi
  186 
  187 rm -Rf /etc/init.d/tentacle_serverd
  188 rm -Rf /etc/init.d/pandora_server
  189 rm -Rf %{prefix}pandora_server
  190 rm -Rf /var/log/pandora
  191 rm -Rf /usr/lib/perl5/PandoraFMS/
  192 rm -Rf /etc/pandora/pandora_server.conf*
  193 rm -Rf /etc/tentacle/tentacle_server.conf*
  194 rm -Rf /var/spool/pandora
  195 rm -Rf /etc/init.d/pandora_server /etc/init.d/tentacle_serverd 
  196 rm -Rf /usr/bin/pandora_exec /usr/bin/pandora_server /usr/bin/tentacle_server
  197 rm -Rf /usr/bin/pandora_ha
  198 rm -Rf /etc/cron.hourly/pandora_db
  199 rm -Rf /etc/logrotate.d/pandora_server
  200 rm -Rf /usr/share/man/man1/pandora_server.1.gz
  201 rm -Rf /usr/share/man/man1/tentacle_server.1.gz
  202 
  203 %files
  204 
  205 %defattr(750,pandora,root)
  206 /etc/init.d/pandora_server
  207 /etc/init.d/tentacle_serverd
  208 
  209 %defattr(755,pandora,root)
  210 /usr/bin/pandora_exec
  211 /usr/bin/pandora_server
  212 /usr/bin/tentacle_server
  213 /usr/bin/pandora_ha
  214 
  215 %defattr(755,pandora,root,755)
  216 /usr/lib/perl5/PandoraFMS/
  217 %{prefix}/pandora_server
  218 %{prefix}/tentacle
  219 /var/log/pandora
  220 
  221 %defattr(-,pandora,www,2770)
  222 /var/spool/pandora
  223 /var/spool/pandora/data_in
  224 /var/spool/pandora/data_in/md5
  225 /var/spool/pandora/data_in/collections
  226 /var/spool/pandora/data_in/netflow
  227 /var/spool/pandora/data_in/conf
  228 /var/spool/pandora/data_in/trans
  229 /var/spool/pandora/data_in/commands
  230 
  231 %defattr(-,pandora,root,750)
  232 /etc/pandora
  233 
  234 %defattr(-,pandora,root,754)
  235 /etc/tentacle
  236 
  237 %defattr(644,pandora,root)
  238 /usr/share/man/man1/pandora_server.1.gz
  239 /usr/share/man/man1/tentacle_server.1.gz
  240