This is a proposed patch, altering the install and uninstall script for 'monit'.
It alters '/srv/web/ipfire/cgi-bin/logs.cgi/log.dat', so that all 'monit' log entries can be seen through the web gui under "System Logs".
Perhaps a bit rough, if someone has a better/easier solution, feel free to jump in.
Signed-off-by: Matthias Fischer matthias.fischer@ipfire.org --- src/paks/monit/install.sh | 32 ++++++++++++++++++++++++++++++++ src/paks/monit/uninstall.sh | 31 +++++++++++++++++++++++++++++++ src/paks/monit/update.sh | 27 +++++++++++++++++++++++++++ 3 files changed, 90 insertions(+) create mode 100644 src/paks/monit/install.sh create mode 100644 src/paks/monit/uninstall.sh create mode 100644 src/paks/monit/update.sh
diff --git a/src/paks/monit/install.sh b/src/paks/monit/install.sh new file mode 100644 index 000000000..8a2823ba5 --- /dev/null +++ b/src/paks/monit/install.sh @@ -0,0 +1,32 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire 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. # +# # +# You should have received a copy of the GNU General Public License # +# along with IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007 IPFire-Team info@ipfire.org. # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +extract_files +restore_backup ${NAME} + +# Patch '/srv/web/ipfire/cgi-bin/logs.cgi/log.dat' to show monit entries +sed -i "/.*'kernel' => '(kernel: (?!DROP_))',/a \ 'monit' => '(monit[.*]: )'," /srv/web/ipfire/cgi-bin/logs.cgi/log.dat +sed -i "/.*'kernel' => "$Lang::tr{'kernel'}",/a \ 'monit' => 'Monit'," /srv/web/ipfire/cgi-bin/logs.cgi/log.dat + +start_service --background ${NAME} diff --git a/src/paks/monit/uninstall.sh b/src/paks/monit/uninstall.sh new file mode 100644 index 000000000..8431d4a39 --- /dev/null +++ b/src/paks/monit/uninstall.sh @@ -0,0 +1,31 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire 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. # +# # +# You should have received a copy of the GNU General Public License # +# along with IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007 IPFire-Team info@ipfire.org. # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +stop_service ${NAME} +make_backup ${NAME} + +# Remove monit entries from '/srv/web/ipfire/cgi-bin/logs.cgi/log.dat' +sed -i "/'monit'/d" /srv/web/ipfire/cgi-bin/logs.cgi/log.dat + +remove_files diff --git a/src/paks/monit/update.sh b/src/paks/monit/update.sh new file mode 100644 index 000000000..99776659c --- /dev/null +++ b/src/paks/monit/update.sh @@ -0,0 +1,27 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire 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. # +# # +# You should have received a copy of the GNU General Public License # +# along with IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007-2020 IPFire-Team info@ipfire.org. # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +extract_backup_includes +./uninstall.sh +./install.sh