From 006d8c185119552434edadcaf3c42f619c260da6 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Fri, 30 Oct 2009 11:36:34 +0000 Subject: [PATCH] 2009-10-30 Miguel de Dios * DEBIAN/control, DEBIAN/md5sums, DEBIAN/postinst, DEBIAN/prerm, DEBIAN/conffiles: sorry, I had the permissions to directory DEBIAN not "755" and in the previus commit don't upload. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2061 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/DEBIAN/conffiles | 1 + pandora_console/DEBIAN/control | 10 ++++---- pandora_console/DEBIAN/postinst | 41 ++++++++++++++++++++++++-------- pandora_console/DEBIAN/prerm | 12 ++++++++++ 4 files changed, 49 insertions(+), 15 deletions(-) create mode 100644 pandora_console/DEBIAN/conffiles create mode 100755 pandora_console/DEBIAN/prerm diff --git a/pandora_console/DEBIAN/conffiles b/pandora_console/DEBIAN/conffiles new file mode 100644 index 0000000000..0a0587e3db --- /dev/null +++ b/pandora_console/DEBIAN/conffiles @@ -0,0 +1 @@ +/etc/pandora/pandora_agent.conf diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index a545f9fc77..4171a2a7dc 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,10 +1,10 @@ -package: PandoraFMS-Console -Version: 3.0.0.20091028 +package: PandoraFMS-Agent +Version: 3.0.0.rc1 Architecture: all Priority: optional Section: admin -Installed-Size: 42112 +Installed-Size: 260 Maintainer: Miguel de Dios Homepage: http://pandorafms.org/ -Depends: apache2, mysql-server, libapache2-mod-php5, php5, php5-snmp, php5-gd, php5-mysql, php-pear, php-db, php5-xmlrpc, php-gettext, graphviz, dbconfig-common, php5-ldap, mysql-client -Description: The Web Console is a web application that allows to see graphical reports, state of every agent, also to access to the information sent by the agent, to see every monitored parameter and to see its evolution throughout the time, to form the different nodes, groups and users of the system. It is the part that interacts with the final user, and that will allows you to administer the system. +Depends: coreutils, perl +Description: andora 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. 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. diff --git a/pandora_console/DEBIAN/postinst b/pandora_console/DEBIAN/postinst index 169dfe78d3..4ebc85059e 100755 --- a/pandora_console/DEBIAN/postinst +++ b/pandora_console/DEBIAN/postinst @@ -1,15 +1,36 @@ #!/bin/bash -#I think that all world was online ;) . -#echo Install PEAR XML/RPC.php PHP Library. -#pear install XML_RPC +PANDORA_LOG=/var/log/pandora/pandora_agent.log +PANDORA_BIN=/usr/bin/pandora_agent +PANDORA_HOME=/usr/share/pandora_agent +PANDORA_TEMP=/var/spool/pandora/data_out +PANDORA_CFG=/etc/pandora -echo Change the user and group to /var/www/pandora_console. -chmod 755 /var/www/pandora_console -R -chgrp www-data /var/www/pandora_console -R -chown www-data /var/www/pandora_console -R +LOG_TIMESTAMP=`date +"%Y/%m/%d %H:%M:%S"` -echo Restart the apache. -/etc/init.d/apache2 restart +echo "Linking Pandora FMS Agent plugins directory to $PANDORA_CFG/plugins..." +rm $PANDORA_CFG/plugins 2> /dev/null +ln -s $PANDORA_HOME/plugins $PANDORA_CFG 2> /dev/null -echo "Please, now, point your browser to http://your_IP_address/pandora_console/install.php and follow all the steps described on it." \ No newline at end of file +echo "Linking Pandora FMS Agent configuration to $PANDORA_CFG/pandora_agent.conf..." +rm $PANDORA_CFG/pandora_agent.conf 2> /dev/null +ln -s $PANDORA_HOME/pandora_agent.conf $PANDORA_CFG/pandora_agent.conf + +echo "Start log of agent." +echo "$LOG_TIMESTAMP Pandora FMS installer has created this file at startup" > $PANDORA_LOG + +echo "Setting secure permissions and ownership for all Pandora FMS Agent files..." +chmod 700 $PANDORA_BIN +chmod 600 $PANDORA_HOME/pandora_agent.conf +chmod -R 700 $PANDORA_HOME/plugins +chown -R root $PANDORA_HOME +chmod -R 600 $PANDORA_TEMP +chmod 640 $PANDORA_LOG +chgrp root $PANDORA_LOG +chown -R root:root $PANDORA_BIN + +INITLV=`cat /etc/inittab | grep "[0-9]\:initdefault" | cut -f 2 -d ":"` +echo "Linking start-up daemon script to /etc/rc$INITLV.d"; +ln -s /etc/init.d/pandora_agent_daemon /etc/rc$INITLV.d/S90pandora_agent + +echo "Please, now setup the $PANDORA_HOME/pandora_agent.conf and before start the /etc/init.d/pandora_agent_daemon" diff --git a/pandora_console/DEBIAN/prerm b/pandora_console/DEBIAN/prerm new file mode 100755 index 0000000000..ede6b26aeb --- /dev/null +++ b/pandora_console/DEBIAN/prerm @@ -0,0 +1,12 @@ +#!/bin/bash + +echo Stop Pandora agent daemon +/etc/init.d/pandora_agent_daemon stop + +PANDORA_CFG=/etc/pandora + +rm -rf $PANDORA_CFG/plugins +rm -rf $PANDORA_CFG/pandora_agent.conf + +INITLV=`cat /etc/inittab | grep "[0-9]\:initdefault" | cut -f 2 -d ":"` +rm /etc/rc$INITLV.d/S90pandora_agent