diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer old mode 100644 new mode 100755 index 9d793cc197..735726c8c0 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -45,7 +45,7 @@ set_global_vars () { OS_VERSION=`uname -r` DISTRO=`uname -s` - # set corret value for LINUX_DISTRO + # set correct value for LINUX_DISTRO case $DISTRO in Linux) # Default for Linux @@ -168,92 +168,98 @@ install () { set_global_vars FORCE=0 + BINARIES=0 # parse options while : do case $1 in --force) FORCE=1;; - --no-tentacle) WITHOUT_TENTALCE=1;; + --from-binary) BINARIES=1;; + --no-tentacle) WITHOUT_TENTACLE=1;; --destdir) DESTDIR=$2;shift;; *) break;; esac shift done - - $PERL Makefile.PL INSTALLMAN1DIR=none WITHOUT_TENTACLE=$WITHOUT_TENTACLE > output 2>&1 - #&& sleep 2 && cat output | grep "found" | wc -l - DEPENDENCIAS=`cat output | grep "found" | wc -l` - - if [ $DEPENDENCIAS -gt 0 ] && [ $FORCE -eq 0 ] - then - echo "You are missing the following dependencies" - echo " " - cat output | awk -F ": prerequisite" '{print $2}' | awk -F " " '{print $1}' - echo "The complete installation guide is at: http://openideas.info/wiki/index.php?title=Pandora" - echo " " - echo "Debian-based distribution do:" - echo " # apt-get install snmp snmpd libjson-perllibio-socket-inet6-perl libsocket6-perl libxml-simple-perl libxml-twig-perl libnetaddr-ip-perl libdbi-perl libnetaddr-ip-perl libhtml-parser-perl wmi-client xprobe2 snmp-mibs-downloader" - echo " " - echo "For CentOS / RHEL do: " - echo " " - echo " # yum install perl-XML-Simple* perl-XML-Twig perl-JSON perl-IO-Socket* perl-Socket6 perl-Time-modules* perl-NetAddr-IP* perl-DateTime* perl-ExtUtils perl-DBI nmap " - echo " " - echo "For OpenSUSE / SLES do : " - echo " " - echo " # zypper install nmap perl-DBD-mysql perl-DBI perl-HTML-Parser perl-JSON -perl-HTML-Encoding perl-HTML-Tree perl-NetAddr-IP perl-IO-Socket-INET6 perl-Socket6 -perl-TimeDate perl-XML-Simple perl-XML-Twig perl-libwww-perl mysql-client" - echo " " - echo " You also will need to install (optionally) xprobe2 and wmiclient from rpm (download from our website)" - echo " " - echo "For FreeBSD do : " - echo " " - echo " Install perl5.8 or later from ports with thread enabled." - echo " (perl-5.8.x.pkg can not be used.)" - echo " # cd /usr/ports/lang/perl5.8" - echo " # make config" - echo " -> Enable THREADS." - echo " # make" - echo " # make install" - echo " " - echo " Install following tools from ports. Don't use packages." - echo " Recommended: p5-DBI p5-NetAddr-IP p5-XML-Simple p5-XML-Twig p5-HTML-Parser p5-DBD-mysql p5-Socket6 p5-IO-Socket-INET6 p5-JSON" - echo " Optional: nmap xprobe" - echo " " - echo "To get it from source through CPAN do" - echo " " - echo " $ cpan Time::Local DBI Socket6 XML::Simple XML::Twig IO::Socket Time::HiRes NetAddr::IP HTML::Entities IO::Socket::INET6 JSON" - echo " " - rm output - exit 1 - fi - rm output - + if [ "$LINUX" = YES ] then echo "$DISTRO distribution detected" else echo "$DISTRO detected" fi - - echo "Installing binaries and libraries" - make - make DESTDIR=$DESTDIR install - - echo "Checking binaries at /usr/local/bin -> /usr/bin" - if [ ! -f "$DESTDIR/usr/bin/pandora_server" ] + + if [ ! $BINARIES -eq 1 ] + # Do not compile files if binary is distributed then - if [ ! -f "$DESTDIR/usr/local/bin/pandora_server" ] + $PERL Makefile.PL INSTALLMAN1DIR=none WITHOUT_TENTACLE=$WITHOUT_TENTACLE > output 2>&1 + #&& sleep 2 && cat output | grep "found" | wc -l + DEPENDENCIAS=`cat output | grep "found" | wc -l` + + if [ $DEPENDENCIAS -gt 0 ] && [ $FORCE -eq 0 ] then - echo "ERROR compiling Pandora FMS Server from sources. Aborting" + echo "You are missing the following dependencies" + echo " " + cat output | awk -F ": prerequisite" '{print $2}' | awk -F " " '{print $1}' + echo "The complete installation guide is at: http://openideas.info/wiki/index.php?title=Pandora" + echo " " + echo "Debian-based distribution do:" + echo " # apt-get install snmp snmpd libjson-perllibio-socket-inet6-perl libsocket6-perl libxml-simple-perl libxml-twig-perl libnetaddr-ip-perl libdbi-perl libnetaddr-ip-perl libhtml-parser-perl wmi-client xprobe2 snmp-mibs-downloader" + echo " " + echo "For CentOS / RHEL do: " + echo " " + echo " # yum install perl-XML-Simple* perl-XML-Twig perl-JSON perl-IO-Socket* perl-Socket6 perl-Time-modules* perl-NetAddr-IP* perl-DateTime* perl-ExtUtils perl-DBI nmap " + echo " " + echo "For OpenSUSE / SLES do : " + echo " " + echo " # zypper install nmap perl-DBD-mysql perl-DBI perl-HTML-Parser perl-JSON + perl-HTML-Encoding perl-HTML-Tree perl-NetAddr-IP perl-IO-Socket-INET6 perl-Socket6 + perl-TimeDate perl-XML-Simple perl-XML-Twig perl-libwww-perl mysql-client" + echo " " + echo " You also will need to install (optionally) xprobe2 and wmiclient from rpm (download from our website)" + echo " " + echo "For FreeBSD do : " + echo " " + echo " Install perl5.8 or later from ports with thread enabled." + echo " (perl-5.8.x.pkg can not be used.)" + echo " # cd /usr/ports/lang/perl5.8" + echo " # make config" + echo " -> Enable THREADS." + echo " # make" + echo " # make install" + echo " " + echo " Install following tools from ports. Don't use packages." + echo " Recommended: p5-DBI p5-NetAddr-IP p5-XML-Simple p5-XML-Twig p5-HTML-Parser p5-DBD-mysql p5-Socket6 p5-IO-Socket-INET6 p5-JSON" + echo " Optional: nmap xprobe" + echo " " + echo "To get it from source through CPAN do" + echo " " + echo " $ cpan Time::Local DBI Socket6 XML::Simple XML::Twig IO::Socket Time::HiRes NetAddr::IP HTML::Entities IO::Socket::INET6 JSON" + echo " " + rm output exit 1 fi - if [ "$DISTRO" != "FreeBSD" ] && [ "$DISTRO" != "NetBSD" ] + rm output + + echo "Installing binaries and libraries" + make + make DESTDIR=$DESTDIR install + + echo "Checking binaries at /usr/local/bin -> /usr/bin" + if [ ! -f "$DESTDIR/usr/bin/pandora_server" ] then - ln -s /usr/local/bin/pandora_server $DESTDIR$PREFIX/bin - ln -s /usr/local/bin/pandora_exec $DESTDIR$PREFIX/bin - ln -s /usr/local/bin/tentacle_server $DESTDIR$PREFIX/bin + if [ ! -f "$DESTDIR/usr/local/bin/pandora_server" ] + then + echo "ERROR compiling Pandora FMS Server from sources. Aborting" + exit 1 + fi + if [ "$DISTRO" != "FreeBSD" ] && [ "$DISTRO" != "NetBSD" ] + then + ln -s /usr/local/bin/pandora_server $DESTDIR$PREFIX/bin + ln -s /usr/local/bin/pandora_exec $DESTDIR$PREFIX/bin + ln -s /usr/local/bin/tentacle_server $DESTDIR$PREFIX/bin + fi fi fi @@ -484,12 +490,13 @@ help () { echo " --force Ignore dependency problems and do the install" echo " --no-tentacle Skip tentacle server installation (by default tentacle server installed)" echo " --destdir DIR Specify root directory for \"fakeroot\" installation" + echo " --from-binary No compile Pandora Server and not execute Makefiles" echo " " } # Script banner at start echo " " -echo "Pandora FMS Server Installer $PI_VERSION $PI_BUILD (c) 2008-2015 Artica ST" +echo "Pandora FMS Server Installer $PI_VERSION $PI_BUILD (c) 2008-2016 Artica ST" echo "This program is licensed under GPL2 Terms. http://pandorafms.com" echo " " @@ -497,12 +504,12 @@ case "$MODE" in '--install') install "$@" - exit + exit 0 ;; '--uninstall') uninstall "$@" - exit + exit 0 ;; *)