2013-04-01 Sancho Lerena <slerena@artica.es>

* DEBIAN/postinst,
	pandora_server.redhat.spec,
	pandora_server.spec,
	pandora_server_installer: Moved maintance process to hourly
	instead daily. Improves performance and avoid locks on heavy 
	loaded systems.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7902 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
slerena 2013-04-01 01:28:14 +00:00
parent dfb6f20bac
commit c47d3794e5
7 changed files with 37 additions and 26 deletions

View File

@ -1,3 +1,12 @@
2013-04-01 Sancho Lerena <slerena@artica.es>
* DEBIAN/postinst,
pandora_server.redhat.spec,
pandora_server.spec,
pandora_server_installer: Moved maintance process to hourly
instead daily. Improves performance and avoid locks on heavy
loaded systems.
2013-03-26 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/Core.pm,

View File

@ -88,14 +88,14 @@ update-rc.d pandora_server defaults
echo "Installing tentacle server in /etc/rc2.d/S80tentacle_serverd"
update-rc.d tentacle_serverd defaults
if [ -d /etc/cron.daily ]
if [ -d /etc/cron.hourly ]
then
echo "Create the Cron script to run daily Pandora DB tool"
echo "#!/bin/bash" > /etc/cron.daily/pandora_db
echo "perl /usr/share/pandora_server/util/pandora_db.pl /etc/pandora/pandora_server.conf" >> /etc/cron.daily/pandora_db
chmod 750 /etc/cron.daily/pandora_db
echo "Create the Cron script to run hourly Pandora DB tool"
echo "#!/bin/bash" > /etc/cron.hourly/pandora_db
echo "perl /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
else
echo "You're probably not using cron for automatic scheduling. You should schedule the following command to run frequently (daily) on your master server:"
echo "You're probably not using cron for automatic scheduling. You should schedule the following command to run frequently (each hour) on your master server:"
echo " perl /usr/share/pandora_server/util/pandora_db.pl /etc/pandora/pandora_server.conf"
fi

View File

@ -65,9 +65,9 @@ rm /etc/init.d/tentacle_serverd
update-rc.d pandora_server remove
update-rc.d tentacle_serverd remove
if [ -d /etc/cron.daily ]
if [ -d /etc/cron.hourly ]
then
rm /etc/cron.daily/pandora_db
rm /etc/cron.hourly/pandora_db
fi
rm /usr/bin/pandora_exec

View File

@ -53,7 +53,7 @@ mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/pandora/
mkdir -p $RPM_BUILD_ROOT%{prefix}/pandora_server/conf/
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1/
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/cron.hourly/
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/pandora/.ssh
mkdir -p $RPM_BUILD_ROOT/usr/lib/perl5/
@ -78,11 +78,11 @@ rm -f $RPM_BUILD_ROOT%{prefix}/pandora_server/util/recon_scripts/PandoraFMS
install -m 0644 util/pandora_logrotate $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/pandora_server
install -m 0640 conf/pandora_server.conf $RPM_BUILD_ROOT%{_sysconfdir}/pandora/
cat <<EOF > $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/pandora_db
cat <<EOF > $RPM_BUILD_ROOT%{_sysconfdir}/cron.hourly/pandora_db
#!/bin/bash
%__perl %{prefix}/pandora_server/util/pandora_db.pl %{_sysconfdir}/pandora/pandora_server.conf
EOF
chmod 0755 $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/pandora_db
chmod 0755 $RPM_BUILD_ROOT%{_sysconfdir}/cron.hourly/pandora_db
%clean
rm -fr $RPM_BUILD_ROOT
@ -135,7 +135,7 @@ exit 0
%doc AUTHORS COPYING ChangeLog README
%{_sysconfdir}/rc.d/init.d/pandora_server
%{_sysconfdir}/rc.d/init.d/tentacle_serverd
%{_sysconfdir}/cron.daily/pandora_db
%{_sysconfdir}/cron.hourly/pandora_db
%config(noreplace) %{_sysconfdir}/logrotate.d/pandora_server
%defattr(755,pandora,root)

View File

@ -101,8 +101,8 @@ fi
chkconfig pandora_server on
chkconfig tentacle_serverd on
echo "/usr/share/pandora_server/util/pandora_db.pl /etc/pandora/pandora_server.conf" > /etc/cron.daily/pandora_db
chmod 750 /etc/cron.daily/pandora_db
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
cp -aRf /usr/share/pandora_server/util/pandora_logrotate /etc/logrotate.d/pandora
if [ ! -d /etc/pandora ] ; then
@ -149,7 +149,7 @@ rm -Rf /etc/pandora/pandora_server.conf
rm -Rf /var/spool/pandora
rm -Rf /etc/init.d/pandora_server /etc/init.d/tentacle_serverd
rm -Rf /usr/bin/pandora_exec /usr/bin/pandora_server /usr/bin/tentacle_server
rm -Rf /etc/cron.daily/pandora_db
rm -Rf /etc/cron.hourly/pandora_db
rm -Rf /etc/logrotate.d/pandora
rm -Rf /usr/share/man/man1/pandora_server.1.gz
rm -Rf /usr/share/man/man1/tentacle_server.1.gz

View File

@ -374,12 +374,12 @@ perl-TimeDate perl-XML-Simple perl-XML-Twig perl-libwww-perl mysql-client perl-S
mkdir $PANDORA_HOME 2> /dev/null
cp -R util $PANDORA_HOME
if [ -d /etc/cron.daily ]
if [ -d /etc/cron.hourly ]
then
echo "Creating the Cron script to run daily Pandora DB tool"
echo "#!/bin/bash" > /etc/cron.daily/pandora_db
echo "perl /usr/share/pandora_server/util/pandora_db.pl /etc/pandora/pandora_server.conf" >> /etc/cron.daily/pandora_db
chmod +x /etc/cron.daily/pandora_db
echo "Creating the Cron script to run Pandora DB tool each hour"
echo "#!/bin/bash" > /etc/cron.hourly/pandora_db
echo "perl /usr/share/pandora_server/util/pandora_db.pl /etc/pandora/pandora_server.conf" >> /etc/cron.hourly/pandora_db
chmod +x /etc/cron.hourly/pandora_db
else
if [ "$DISTRO" = "FreeBSD" ]
then
@ -392,7 +392,7 @@ perl-TimeDate perl-XML-Simple perl-XML-Twig perl-libwww-perl mysql-client perl-S
echo "The crontab for pandora_db.pl is already configured."
fi
else
echo "You're probably not using cron for automatic scheduling. You should schedule the following command to run frequently (daily) on your master server:"
echo "You're probably not using cron for automatic scheduling. You should schedule the following command to run frequently (hourly) on your master server:"
echo " perl /usr/share/pandora_server/util/pandora_db.pl /etc/pandora/pandora_server.conf"
fi
fi
@ -480,7 +480,7 @@ uninstall () {
rm -Rf /usr/bin/pandora_server 2> /dev/null
rm -Rf /usr/bin/pandora_exec 2> /dev/null
rm -Rf $PANDORA_HOME
rm -Rf /etc/cron.daily/pandora_db
rm -Rf /etc/cron.hourly/pandora_db
rm -Rf /etc/logrotate.d/pandora
if [ "$DISTRO" = "UBUNTU" ] || [ "$DISTRO" = "DEBIAN" ]
then

View File

@ -47,10 +47,12 @@ install () {
cp util/pandora_server /etc/init.d
cp util/tentacle_serverd /etc/init.d
if [ ! -e /etc/cron.daily/pandora_db ]
if [ ! -e /etc/cron.hourly/pandora_db ]
then
echo "You don't have a /etc/cron.daily/pandora_purge_db file, you should consider"
echo "to setup the Pandora FMS daily Database Maintance script: "
echo "You don't have a /etc/cron.hourly/pandora_db file, you should consider"
echo "to setup the Pandora FMS Database Maintance script. Create with 755 perms a file in /etc/cron.hourly "
echo "called 'pandora_db', with following contents: "
echo " "
echo " perl /usr/share/pandora_server/util/pandora_db.pl /etc/pandora/pandora_server.conf"
fi
@ -66,7 +68,7 @@ help () {
# Script banner at start
echo " "
echo "Pandora FMS 4.0dev Server Upgrade (c) 2009-2010 Artica ST"
echo "Pandora FMS 5.0 Server Upgrade (c) 2009-2013 Artica ST"
echo "This program is licensed under GPL2 Terms. http://pandorafms.org"
echo " "