mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
Log rotation to .deb and split pandora_console_logrotate
This commit is contained in:
parent
6b724f3c15
commit
380e74ad91
@ -42,6 +42,7 @@ mkdir -p temp_package/var/spool/pandora/data_out
|
|||||||
mkdir -p temp_package/usr/share/man/man1/
|
mkdir -p temp_package/usr/share/man/man1/
|
||||||
mkdir -p temp_package/usr/share/pandora_agent/plugins
|
mkdir -p temp_package/usr/share/pandora_agent/plugins
|
||||||
mkdir -p temp_package/tmp
|
mkdir -p temp_package/tmp
|
||||||
|
mkdir -p temp_package/etc/logrotate.d/
|
||||||
|
|
||||||
echo "Make directory system tree for package."
|
echo "Make directory system tree for package."
|
||||||
cp DEBIAN temp_package -R
|
cp DEBIAN temp_package -R
|
||||||
@ -62,6 +63,7 @@ cp -aRf tentacle_client temp_package/usr/bin/
|
|||||||
cp -aRf pandora_agent temp_package/usr/bin/
|
cp -aRf pandora_agent temp_package/usr/bin/
|
||||||
cp -aRf pandora_agent_exec temp_package/usr/bin/pandora_agent_exec
|
cp -aRf pandora_agent_exec temp_package/usr/bin/pandora_agent_exec
|
||||||
cp -aRf pandora_agent_daemon temp_package/etc/init.d/pandora_agent_daemon
|
cp -aRf pandora_agent_daemon temp_package/etc/init.d/pandora_agent_daemon
|
||||||
|
cp -aRf pandora_agent_logrotate temp_package/etc/logrotate.d/pandora_agent
|
||||||
cp Linux/pandora_agent.conf temp_package/etc/pandora/
|
cp Linux/pandora_agent.conf temp_package/etc/pandora/
|
||||||
|
|
||||||
cp -aRf man/man1/* temp_package/usr/share/man/man1/
|
cp -aRf man/man1/* temp_package/usr/share/man/man1/
|
||||||
|
@ -88,10 +88,12 @@ mkdir -p temp_package
|
|||||||
if [ $package_pandora -eq 1 ]
|
if [ $package_pandora -eq 1 ]
|
||||||
then
|
then
|
||||||
mkdir -p temp_package/var/www/pandora_console
|
mkdir -p temp_package/var/www/pandora_console
|
||||||
|
mkdir -p temp_package/etc/logrotate.d
|
||||||
|
|
||||||
echo "Make directory system tree for package."
|
echo "Make directory system tree for package."
|
||||||
cp -R $(ls | grep -v temp_package | grep -v DEBIAN ) temp_package/var/www/pandora_console
|
cp -R $(ls | grep -v temp_package | grep -v DEBIAN ) temp_package/var/www/pandora_console
|
||||||
cp -R DEBIAN temp_package
|
cp -R DEBIAN temp_package
|
||||||
|
cp -aRf pandora_console_logrotate_ubuntu temp_package/etc/logrotate.d/pandora_console
|
||||||
find temp_package/var/www/pandora_console -name ".svn" | xargs rm -Rf
|
find temp_package/var/www/pandora_console -name ".svn" | xargs rm -Rf
|
||||||
rm -Rf temp_package/var/www/pandora_console/pandora_console.spec
|
rm -Rf temp_package/var/www/pandora_console/pandora_console.spec
|
||||||
chmod 755 -R temp_package/DEBIAN
|
chmod 755 -R temp_package/DEBIAN
|
||||||
|
@ -51,7 +51,7 @@ mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/
|
|||||||
cp -aRf * $RPM_BUILD_ROOT%{prefix}/pandora_console
|
cp -aRf * $RPM_BUILD_ROOT%{prefix}/pandora_console
|
||||||
rm $RPM_BUILD_ROOT%{prefix}/pandora_console/*.spec
|
rm $RPM_BUILD_ROOT%{prefix}/pandora_console/*.spec
|
||||||
rm $RPM_BUILD_ROOT%{prefix}/pandora_console/pandora_console_install
|
rm $RPM_BUILD_ROOT%{prefix}/pandora_console/pandora_console_install
|
||||||
install -m 0644 pandora_console_logrotate $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/pandora_console
|
install -m 0644 pandora_console_logrotate_centos $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/pandora_console
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
@ -66,7 +66,7 @@ if [ -f %{prefix}/pandora_console/include/config.php ] ; then
|
|||||||
else
|
else
|
||||||
echo "Please, now, point your browser to http://your_IP_address/pandora_console/install.php and follow all the steps described on it."
|
echo "Please, now, point your browser to http://your_IP_address/pandora_console/install.php and follow all the steps described on it."
|
||||||
fi
|
fi
|
||||||
cp -aRf %{prefix}/pandora_console/pandora_console_logrotate /etc/logrotate.d/pandora_console
|
cp -aRf %{prefix}/pandora_console/pandora_console_logrotate_suse /etc/logrotate.d/pandora_console
|
||||||
|
|
||||||
%preun
|
%preun
|
||||||
|
|
||||||
|
15
pandora_console/pandora_console_install
Normal file → Executable file
15
pandora_console/pandora_console_install
Normal file → Executable file
@ -183,7 +183,20 @@ install () {
|
|||||||
then
|
then
|
||||||
[ -d $DESTDIR/etc/logrotate.d ] && mkdir -p $DESTDIR/etc/logrotate.d
|
[ -d $DESTDIR/etc/logrotate.d ] && mkdir -p $DESTDIR/etc/logrotate.d
|
||||||
echo "Creating logrotate.d entry for Pandora FMS log management"
|
echo "Creating logrotate.d entry for Pandora FMS log management"
|
||||||
cp pandora_console_logrotate $DESTDIR/etc/logrotate.d/pandora_console
|
case $DISTRO in
|
||||||
|
SUSE)
|
||||||
|
cp pandora_console_logrotate_suse $DESTDIR/etc/logrotate.d/pandora_console
|
||||||
|
;;
|
||||||
|
UBUNTU|DEBIAN)
|
||||||
|
cp pandora_console_logrotate_ubuntu $DESTDIR/etc/logrotate.d/pandora_console
|
||||||
|
;;
|
||||||
|
FEDORA|RHEL_CENTOS|GENERIC)
|
||||||
|
cp pandora_console_logrotate_centos $DESTDIR/etc/logrotate.d/pandora_console
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Please add a log rotation schedule manually to your log rotation daemon (if any)"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
else
|
else
|
||||||
echo "Please add a log rotation schedule manually to your log rotation daemon (if any)"
|
echo "Please add a log rotation schedule manually to your log rotation daemon (if any)"
|
||||||
fi
|
fi
|
||||||
|
@ -1,35 +0,0 @@
|
|||||||
# DEBIAN / UBUNTU
|
|
||||||
/var/www/pandora_console/pandora_console.log {
|
|
||||||
weekly
|
|
||||||
missingok
|
|
||||||
size 100000
|
|
||||||
rotate 3
|
|
||||||
maxage 15
|
|
||||||
compress
|
|
||||||
notifempty
|
|
||||||
create 644 www-data www-data
|
|
||||||
}
|
|
||||||
|
|
||||||
# OpenSUSE, SLES
|
|
||||||
/srv/www/htdocs/pandora_console/pandora_console.log {
|
|
||||||
weekly
|
|
||||||
missingok
|
|
||||||
size 100000
|
|
||||||
rotate 3
|
|
||||||
maxage 15
|
|
||||||
compress
|
|
||||||
notifempty
|
|
||||||
create 644 wwwrun www
|
|
||||||
}
|
|
||||||
|
|
||||||
# Centos, Redhat, Fedora
|
|
||||||
/var/www/html/pandora_console/pandora_console.log {
|
|
||||||
weekly
|
|
||||||
missingok
|
|
||||||
size 100000
|
|
||||||
rotate 3
|
|
||||||
maxage 15
|
|
||||||
compress
|
|
||||||
notifempty
|
|
||||||
create 644 apache root
|
|
||||||
}
|
|
11
pandora_console/pandora_console_logrotate_centos
Normal file
11
pandora_console/pandora_console_logrotate_centos
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# Centos, Redhat, Fedora
|
||||||
|
/var/www/html/pandora_console/pandora_console.log {
|
||||||
|
weekly
|
||||||
|
missingok
|
||||||
|
size 100000
|
||||||
|
rotate 3
|
||||||
|
maxage 15
|
||||||
|
compress
|
||||||
|
notifempty
|
||||||
|
create 644 apache root
|
||||||
|
}
|
11
pandora_console/pandora_console_logrotate_suse
Normal file
11
pandora_console/pandora_console_logrotate_suse
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# OpenSUSE, SLES
|
||||||
|
/srv/www/htdocs/pandora_console/pandora_console.log {
|
||||||
|
weekly
|
||||||
|
missingok
|
||||||
|
size 100000
|
||||||
|
rotate 3
|
||||||
|
maxage 15
|
||||||
|
compress
|
||||||
|
notifempty
|
||||||
|
create 644 wwwrun www
|
||||||
|
}
|
11
pandora_console/pandora_console_logrotate_ubuntu
Normal file
11
pandora_console/pandora_console_logrotate_ubuntu
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# DEBIAN / UBUNTU
|
||||||
|
/var/www/pandora_console/pandora_console.log {
|
||||||
|
weekly
|
||||||
|
missingok
|
||||||
|
size 100000
|
||||||
|
rotate 3
|
||||||
|
maxage 15
|
||||||
|
compress
|
||||||
|
notifempty
|
||||||
|
create 644 www-data www-data
|
||||||
|
}
|
@ -17,6 +17,34 @@ fi
|
|||||||
MODE=$1
|
MODE=$1
|
||||||
|
|
||||||
pandora_upgrade () {
|
pandora_upgrade () {
|
||||||
|
|
||||||
|
case `uname -s` in
|
||||||
|
Linux)
|
||||||
|
# Get Linux Distro type and version
|
||||||
|
if [ -f "/etc/SuSE-release" ]
|
||||||
|
then
|
||||||
|
DISTRO=SUSE
|
||||||
|
elif [ -f "/etc/lsb-release" ] && [ ! -f "/etc/redhat-release" ]
|
||||||
|
then
|
||||||
|
DISTRO=UBUNTU
|
||||||
|
elif [ -f "/etc/debian_version" ]
|
||||||
|
then
|
||||||
|
DISTRO=DEBIAN
|
||||||
|
elif [ -f "/etc/fedora-release" ]
|
||||||
|
then
|
||||||
|
DISTRO=FEDORA
|
||||||
|
elif [ -f "/etc/redhat-release" ]
|
||||||
|
then
|
||||||
|
DISTRO=RHEL_CENTOS
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
FreeBSD)
|
||||||
|
DISTRO=FreeBSD
|
||||||
|
;;
|
||||||
|
NetBSD)
|
||||||
|
DISTRO=NetBSD
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
if [ ! -e "$PANDORAPATH/index.php" ]
|
if [ ! -e "$PANDORAPATH/index.php" ]
|
||||||
then
|
then
|
||||||
@ -80,7 +108,20 @@ pandora_upgrade () {
|
|||||||
|
|
||||||
if [ -d /etc/logrotate.d ]; then
|
if [ -d /etc/logrotate.d ]; then
|
||||||
echo "Creating logrotate.d entry for Pandora FMS log management"
|
echo "Creating logrotate.d entry for Pandora FMS log management"
|
||||||
cp pandora_console_logrotate /etc/logrotate.d/pandora_console
|
case $DISTRO in
|
||||||
|
SUSE)
|
||||||
|
cp pandora_console_logrotate_suse $DESTDIR/etc/logrotate.d/pandora_console
|
||||||
|
;;
|
||||||
|
UBUNTU|DEBIAN)
|
||||||
|
cp pandora_console_logrotate_ubuntu $DESTDIR/etc/logrotate.d/pandora_console
|
||||||
|
;;
|
||||||
|
FEDORA|RHEL_CENTOS|GENERIC)
|
||||||
|
cp pandora_console_logrotate_centos $DESTDIR/etc/logrotate.d/pandora_console
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Please add a log rotation schedule manually to your log rotation daemon (if any)"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
else
|
else
|
||||||
echo "Please add a log rotation schedule manually to your log rotation daemon (if any)"
|
echo "Please add a log rotation schedule manually to your log rotation daemon (if any)"
|
||||||
fi
|
fi
|
||||||
|
@ -81,6 +81,7 @@ then
|
|||||||
mkdir -p temp_package/usr/share/pandora_server/conf/
|
mkdir -p temp_package/usr/share/pandora_server/conf/
|
||||||
mkdir -p temp_package/usr/lib/perl5/
|
mkdir -p temp_package/usr/lib/perl5/
|
||||||
mkdir -p temp_package/usr/share/man/man1/
|
mkdir -p temp_package/usr/share/man/man1/
|
||||||
|
mkdir -p temp_package/etc/logrotate.d/
|
||||||
|
|
||||||
cp -aRf bin/pandora_server temp_package/usr/bin/
|
cp -aRf bin/pandora_server temp_package/usr/bin/
|
||||||
cp -aRf bin/pandora_exec temp_package/usr/bin/pandora_exec.server
|
cp -aRf bin/pandora_exec temp_package/usr/bin/pandora_exec.server
|
||||||
@ -96,6 +97,8 @@ then
|
|||||||
|
|
||||||
cp -aRf man/man1/* temp_package/usr/share/man/man1/
|
cp -aRf man/man1/* temp_package/usr/share/man/man1/
|
||||||
|
|
||||||
|
cp -aRf util/pandora_server_logrotate temp_package/etc/logrotate.d/pandora_server
|
||||||
|
|
||||||
rm -f temp_package/usr/share/pandora_server/util/PandoraFMS
|
rm -f temp_package/usr/share/pandora_server/util/PandoraFMS
|
||||||
rm -f temp_package/usr/share/pandora_server/bin/PandoraFMS
|
rm -f temp_package/usr/share/pandora_server/bin/PandoraFMS
|
||||||
rm -f temp_package/usr/share/pandora_server/util/recon_scripts/PandoraFMS
|
rm -f temp_package/usr/share/pandora_server/util/recon_scripts/PandoraFMS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user