Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
Open sidebar
Guilherme Filippo
ISPConfig 3
Commits
ad935665
Commit
ad935665
authored
Mar 04, 2009
by
tbrehm
Browse files
Added log paths for redhat based distributions to the monitor module.
parent
fe98c110
Changes
2
Hide whitespace changes
Inline
Side-by-side
install/tpl/server.ini.master
View file @
ad935665
...
...
@@ -46,4 +46,4 @@ fastcgi_bin=/usr/bin/php-cgi
[jailkit]
jailkit_chroot_home=/home/[username]
jailkit_chroot_app_sections=basicshell editors extendedshell netutils ssh sftp scp groups jk_lsh
jailkit_chroot_app_programs=/usr/bin/groups /usr/bin/id /usr/bin/dircolors /usr/bin/lesspipe /usr/bin/basename /usr/bin/dirname /usr/bin/nano /usr/bin/pico
jailkit_chroot_app_programs=/usr/bin/groups /usr/bin/id /usr/bin/dircolors /usr/bin/lesspipe /usr/bin/basename /usr/bin/dirname /usr/bin/nano /usr/bin/pico
\ No newline at end of file
server/mods-available/monitor_core_module.inc.php
View file @
ad935665
...
...
@@ -1174,33 +1174,49 @@ class monitor_core_module {
function
_getLogData
(
$log
){
switch
(
$log
)
{
$dist
=
''
;
$logfile
=
''
;
if
(
@
is_file
(
'/etc/debian_version'
))
$dist
=
'debian'
;
if
(
@
is_file
(
'/etc/redhat-release'
))
$dist
=
'redhat'
;
switch
(
$log
)
{
case
'log_mail'
:
$logfile
=
'/var/log/mail.log'
;
if
(
$dist
==
'debian'
)
$logfile
=
'/var/log/mail.log'
;
if
(
$dist
==
'redhat'
)
$logfile
=
'/var/log/maillog'
;
break
;
case
'log_mail_warn'
:
$logfile
=
'/var/log/mail.warn'
;
if
(
$dist
==
'debian'
)
$logfile
=
'/var/log/mail.warn'
;
if
(
$dist
==
'redhat'
)
$logfile
=
'/var/log/maillog'
;
break
;
case
'log_mail_err'
:
$logfile
=
'/var/log/mail.err'
;
if
(
$dist
==
'debian'
)
$logfile
=
'/var/log/mail.err'
;
if
(
$dist
==
'redhat'
)
$logfile
=
'/var/log/maillog'
;
break
;
case
'log_messages'
:
$logfile
=
'/var/log/messages'
;
if
(
$dist
==
'debian'
)
$logfile
=
'/var/log/messages'
;
if
(
$dist
==
'redhat'
)
$logfile
=
'/var/log/messages'
;
break
;
case
'log_ispc_cron'
:
$logfile
=
'/var/log/ispconfig/cron.log'
;
if
(
$dist
==
'debian'
)
$logfile
=
'/var/log/ispconfig/cron.log'
;
if
(
$dist
==
'redhat'
)
$logfile
=
'/var/log/ispconfig/cron.log'
;
break
;
case
'log_freshclam'
:
$logfile
=
'/var/log/clamav/freshclam.log'
;
if
(
$dist
==
'debian'
)
$logfile
=
'/var/log/clamav/freshclam.log'
;
if
(
$dist
==
'redhat'
)
$logfile
=
'/var/log/freshclam.log'
;
break
;
case
'log_clamav'
:
$logfile
=
'/var/log/clamav/clamav.log'
;
if
(
$dist
==
'debian'
)
$logfile
=
'/var/log/clamav/clamav.log'
;
if
(
$dist
==
'redhat'
)
$logfile
=
'/var/log/maillog'
;
break
;
case
'log_fail2ban'
:
$logfile
=
'/var/log/fail2ban.log'
;
if
(
$dist
==
'debian'
)
$logfile
=
'/var/log/fail2ban.log'
;
if
(
$dist
==
'redhat'
)
$logfile
=
'/var/log/fail2ban.log'
;
break
;
case
'log_ispconfig'
:
$logfile
=
'/var/log/ispconfig/ispconfig.log'
;
if
(
$dist
==
'debian'
)
$logfile
=
'/var/log/ispconfig/ispconfig.log'
;
if
(
$dist
==
'redhat'
)
$logfile
=
'/var/log/ispconfig/ispconfig.log'
;
break
;
default
:
$logfile
=
''
;
...
...
@@ -1210,7 +1226,7 @@ class monitor_core_module {
// Getting the logfile content
if
(
$logfile
!=
''
)
{
$logfile
=
escapeshellcmd
(
$logfile
);
if
(
stristr
(
$logfile
,
';'
))
{
if
(
stristr
(
$logfile
,
';'
)
or
substr
(
$logfile
,
0
,
9
)
!=
'/var/log/'
or
(
stristr
(
$logfile
,
'..'
)
)
{
$log
=
'Logfile path error.'
;
}
else
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment