2010-05-19 Miguel de Dios <miguel.dedios@artica.es>
* DEBIAN, DEBIAN/control, DEBIAN/conffiles, DEBIAN/make_deb_package.sh, DEBIAN/md5sums: added the scripts and conf files for create package. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2758 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
d6bd8f3cde
commit
784d9e057b
|
@ -1,3 +1,8 @@
|
||||||
|
2010-05-19 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* DEBIAN, DEBIAN/control, DEBIAN/conffiles, DEBIAN/make_deb_package.sh,
|
||||||
|
DEBIAN/md5sums: added the scripts and conf files for create package.
|
||||||
|
|
||||||
2010-05-18 Ramon Novoa <rnovoa@artica.es>
|
2010-05-18 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
* pandora_agent: Added a data collection layer and native modules
|
* pandora_agent: Added a data collection layer and native modules
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
/etc/pandora/pandora_agent.conf
|
|
@ -0,0 +1,10 @@
|
||||||
|
package: PandoraFMS-Agent
|
||||||
|
Version: 3.1.0
|
||||||
|
Architecture: all
|
||||||
|
Priority: optional
|
||||||
|
Section: admin
|
||||||
|
Installed-Size: 260
|
||||||
|
Maintainer: Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
Homepage: http://pandorafms.org/
|
||||||
|
Depends: coreutils, perl
|
||||||
|
Description: 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. 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.
|
|
@ -0,0 +1,124 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
#Pandora FMS- http:#pandorafms.com
|
||||||
|
# ==================================================
|
||||||
|
# Copyright (c) 2005-2010 Artica Soluciones Tecnologicas
|
||||||
|
# Please see http:#pandorafms.org for full contribution list
|
||||||
|
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU Lesser General Public License
|
||||||
|
# as published by the Free Software Foundation; version 2
|
||||||
|
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
|
pandora_agent_version="3.1.0"
|
||||||
|
|
||||||
|
echo "Test if you has the tools for to make the packages."
|
||||||
|
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||||
|
if [ $? = 1 ]
|
||||||
|
then
|
||||||
|
echo "No found \"dpkg-deb\" aplication, please install."
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "Found \"dpkg-debs\"."
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
echo "Make a \"temp_package\" temp dir for job."
|
||||||
|
mkdir -p temp_package/usr/share/pandora_agent
|
||||||
|
mkdir -p temp_package/var/spool/pandora/data_out
|
||||||
|
mkdir -p temp_package/var/log/pandora/
|
||||||
|
mkdir -p temp_package/etc/pandora
|
||||||
|
mkdir -p temp_package/etc/init.d/
|
||||||
|
mkdir -p temp_package/usr/bin
|
||||||
|
|
||||||
|
echo "Make directory system tree for package."
|
||||||
|
cp DEBIAN temp_package -R
|
||||||
|
|
||||||
|
PANDORA_LOG=temp_package/var/log/pandora/pandora_agent.log
|
||||||
|
PANDORA_BIN=temp_package/usr/bin/pandora_agent
|
||||||
|
PANDORA_HOME=temp_package/usr/share/pandora_agent
|
||||||
|
TENTACLE=temp_package/usr/bin/tentacle_client
|
||||||
|
PANDORA_CFG=temp_package/etc/pandora
|
||||||
|
PANDORA_STARTUP=temp_package/etc/init.d/pandora_agent_daemon
|
||||||
|
|
||||||
|
# Create logfile
|
||||||
|
if [ ! -z "`touch $PANDORA_LOG`" ]
|
||||||
|
then
|
||||||
|
echo "Seems to be a problem generating logfile ($PANDORA_LOG) please check it";
|
||||||
|
exit
|
||||||
|
else
|
||||||
|
echo "Creating logfile at $PANDORA_LOG..."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Copying agent
|
||||||
|
echo "Copying Pandora FMS Agent to $PANDORA_BIN..."
|
||||||
|
cp pandora_agent $PANDORA_BIN
|
||||||
|
|
||||||
|
echo "Copying Pandora FMS Agent contrib dir to $PANDORA_HOME/..."
|
||||||
|
cp pandora_agent_daemon $PANDORA_HOME
|
||||||
|
|
||||||
|
echo "Copying default agent configuration to $PANDORA_HOME/pandora_agent.conf"
|
||||||
|
cp pandora_agent.conf $PANDORA_HOME/pandora_agent.conf
|
||||||
|
|
||||||
|
echo "Copying Pandora FMS Agent plugins to $PANDORA_HOME/plugins..."
|
||||||
|
cp -r plugins $PANDORA_HOME
|
||||||
|
|
||||||
|
echo "Copying tentacle client to $TENTACLE"
|
||||||
|
cp tentacle_client $TENTACLE
|
||||||
|
|
||||||
|
echo "Linking start-up daemon script at $PANDORA_STARTUP";
|
||||||
|
cp pandora_agent_daemon $PANDORA_STARTUP
|
||||||
|
|
||||||
|
touch $PANDORA_CFG/pandora_agent.conf
|
||||||
|
|
||||||
|
echo "Remove the SVN files and other temp files."
|
||||||
|
for item in `find temp_package`
|
||||||
|
do
|
||||||
|
echo -n "."
|
||||||
|
echo $item | grep "svn" > /dev/null
|
||||||
|
#last command success
|
||||||
|
if [ $? -eq 0 ]
|
||||||
|
then
|
||||||
|
rm -rf $item
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo $item | grep "make_deb_package.sh" > /dev/null
|
||||||
|
#last command success
|
||||||
|
if [ $? -eq 0 ]
|
||||||
|
then
|
||||||
|
rm -rf $item
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo "END"
|
||||||
|
|
||||||
|
echo "Calcule md5sum for md5sums file control of package"
|
||||||
|
for item in `find temp_package`
|
||||||
|
do
|
||||||
|
echo -n "."
|
||||||
|
if [ ! -d $item ]
|
||||||
|
then
|
||||||
|
echo $item | grep "DEBIAN" > /dev/null
|
||||||
|
#last command success
|
||||||
|
if [ $? -eq 1 ]
|
||||||
|
then
|
||||||
|
md5=`md5sum $item | cut -d" " -f1`
|
||||||
|
|
||||||
|
#delete "temp_package" in the path
|
||||||
|
final_path=${item#temp_package}
|
||||||
|
echo $md5" "$final_path >> temp_package/DEBIAN/md5sums
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo "END"
|
||||||
|
|
||||||
|
echo "Make the package \"Pandorafms console\"."
|
||||||
|
dpkg-deb --build temp_package
|
||||||
|
mv temp_package.deb pandorafms.agent_$pandora_agent_version.deb
|
||||||
|
|
||||||
|
echo "Delete the \"temp_package\" temp dir for job."
|
||||||
|
rm -rf temp_package
|
Loading…
Reference in New Issue