Skip to content

Commit

Permalink
sort log files by severity in churn page; test cluster db with custom…
Browse files Browse the repository at this point in the history
… class names; better storage log msg if no data found
  • Loading branch information
gggeek committed Feb 20, 2022
1 parent a1ed8e0 commit 18a82a5
Show file tree
Hide file tree
Showing 34 changed files with 82 additions and 48 deletions.
4 changes: 2 additions & 2 deletions classes/ezsysinfoclustermanager.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static public function clusterDBHandler()
{
return eZClusterFileHandler::instance();
}
else if ( $handler == 'eZDFSFileHandler' )
else if ( $handler == 'eZDFSFileHandler' || strpos( $handler, 'DFSFileHandler' ) !== false )
{
// This is even worse: we have no right to know if db connection is ok.
// So we replicate some code here...
Expand All @@ -50,7 +50,7 @@ static public function clusterFileStorageDir()
{
$ini = eZINI::instance( 'file.ini' );
$handler = $ini->variable( 'ClusteringSettings', 'FileHandler' );
if ( $handler == 'eZDFSFileHandler' )
if ( $handler == 'eZDFSFileHandler' || strpos( $handler, 'DFSFileHandler' ) !== false )
{
return $ini->variable( 'eZDFSClusteringSettings', 'MountPointPath' );
}
Expand Down
3 changes: 1 addition & 2 deletions classes/inichecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,8 @@ static function checkFileNames()

// starting with version 4.4, it is not necessary to have exactly one .ini
// file (and optionally many .ini.append.php)
if ( version_compare( '4.4', eZPublishSDK::version() ) <= 0 )
if ( version_compare( '4.4', eZPublishSDK::version() ) >= 0 )
{

// .ini files in extensions that have same name as std files, no .ini (master) file for new ones
$newinis = array();
$changedinis = array();
Expand Down
1 change: 1 addition & 0 deletions classes/statustests/sysinfotests.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public static function runTests()
}

$clusterDBHandler = ezSysinfoClusterManager::clusterDBHandler();

if ( $clusterDBHandler instanceof eZDBFileHandler )
{
// warning - we dig into the private parts of the cluster file handler,
Expand Down
2 changes: 1 addition & 1 deletion design/standard/templates/sysinfo/cachesearch.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
{* DESIGN: Control bar END *}</div></div></div></div></div></div>
</div>

<hr>
<hr/>
{def $timestamp=currentdate()}
Host: {$hostname|wash}; date: {$timestamp|l10n( 'shortdatetime' )}
</div>
Expand Down
3 changes: 2 additions & 1 deletion design/standard/templates/sysinfo/cachestats.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@

<p><b>NB:</b> {'Symfony cache stats are reliable only when using a standard configuration'|i18n( 'SysInfo' )}</p>

{* @todo add support for customized dfs class names *}
{if eq( ezini( 'ClusteringSettings', 'FileHandler', 'file.ini' ), 'eZDFSFileHandler')}
<p><b>NB:</b> {'"DFS://" stats refer to files found on the shared storage, not to what is recorded in the cluster database'|i18n( 'SysInfo' )}</p>
{/if}
Expand Down Expand Up @@ -103,7 +104,7 @@
{* DESIGN: Control bar END *}</div></div></div></div></div></div>
</div>

<hr>
<hr/>
{def $timestamp=currentdate()}
Host: {$hostname|wash}; date: {$timestamp|l10n( 'shortdatetime' )}
</div>
Expand Down
2 changes: 1 addition & 1 deletion design/standard/templates/sysinfo/classesreport.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
</div>
</div>

<hr>
<hr/>
{def $timestamp=currentdate()}
Host: {$hostname|wash}; date: {$timestamp|l10n( 'shortdatetime' )}
</div>
2 changes: 1 addition & 1 deletion design/standard/templates/sysinfo/clustermasterview.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
{* DESIGN: Control bar END *}</div></div></div></div></div></div>
</div>
<hr>
<hr/>
{def $timestamp=currentdate()}
Host: {$hostname|wash}; date: {$timestamp|l10n( 'shortdatetime' )}
</div>
2 changes: 1 addition & 1 deletion design/standard/templates/sysinfo/contentstats.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
{* DESIGN: Control bar END *}</div></div></div></div></div></div>
</div>

<hr>
<hr/>
{def $timestamp=currentdate()}
Host: {$hostname|wash}; date: {$timestamp|l10n( 'shortdatetime' )}
</div>
Expand Down
3 changes: 2 additions & 1 deletion design/standard/templates/sysinfo/databaseqa.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@

</div>

<hr/>
See also the <a href={'setup/systemupgrade'|ezurl}>Database Consistency Check</a> page for more tests

{* DESIGN: Content END *}</div></div></div></div></div></div>

<hr>
<hr/>
{def $timestamp=currentdate()}
Host: {$hostname|wash}; date: {$timestamp|l10n( 'shortdatetime' )}
</div>
2 changes: 1 addition & 1 deletion design/standard/templates/sysinfo/eventtypelist.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
{* DESIGN: Control bar END *}</div></div></div></div></div></div>
</div>

<hr>
<hr/>
{def $timestamp=currentdate()}
Host: {$hostname|wash}; date: {$timestamp|l10n( 'shortdatetime' )}
</div>
Expand Down
2 changes: 1 addition & 1 deletion design/standard/templates/sysinfo/fetchlist.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
{* DESIGN: Control bar END *}</div></div></div></div></div></div>
</div>

<hr>
<hr/>
{def $timestamp=currentdate()}
Host: {$hostname|wash}; date: {$timestamp|l10n( 'shortdatetime' )}
</div>
Expand Down
2 changes: 1 addition & 1 deletion design/standard/templates/sysinfo/info.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

{* DESIGN: Control bar END *}</div></div></div></div></div></div>

<hr>
<hr/>
{def $timestamp=currentdate()}
Host: {$hostname|wash}; date: {$timestamp|l10n( 'shortdatetime' )}
</div>
2 changes: 1 addition & 1 deletion design/standard/templates/sysinfo/inireport.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
</div>
</div>

<hr>
<hr/>
{def $timestamp=currentdate()}
Host: {$hostname|wash}; date: {$timestamp|l10n( 'shortdatetime' )}
</div>
2 changes: 1 addition & 1 deletion design/standard/templates/sysinfo/logchurn.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
{* DESIGN: Content END *}</div></div></div></div></div></div>
{* DESIGN: Content END *}{*</div></div></div>*}

<hr>
<hr/>
{def $timestamp=currentdate()}
Host: {$hostname|wash}; date: {$timestamp|l10n( 'shortdatetime' )}
</div>
2 changes: 1 addition & 1 deletion design/standard/templates/sysinfo/logstats.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
{* DESIGN: Control bar END *}</div></div></div></div></div></div>
</div>

<hr>
<hr/>
{def $timestamp=currentdate()}
Host: {$hostname|wash}; date: {$timestamp|l10n( 'shortdatetime' )}
</div>
Expand Down
2 changes: 1 addition & 1 deletion design/standard/templates/sysinfo/logview.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
{* DESIGN: Control bar END *}</div></div></div></div></div></div>
</div>

<hr>
<hr/>
{def $timestamp=currentdate()}
Host: {$hostname|wash}; date: {$timestamp|l10n( 'shortdatetime' )}
</div>
Expand Down
2 changes: 1 addition & 1 deletion design/standard/templates/sysinfo/modulelist.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
{* DESIGN: Control bar END *}</div></div></div></div></div></div>
</div>

<hr>
<hr/>
{def $timestamp=currentdate()}
Host: {$hostname|wash}; date: {$timestamp|l10n( 'shortdatetime' )}
</div>
Expand Down
2 changes: 1 addition & 1 deletion design/standard/templates/sysinfo/mysqli.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

{* DESIGN: Control bar END *}</div></div></div></div></div></div>

<hr>
<hr/>
{def $timestamp=currentdate()}
Host: {$hostname|wash}; date: {$timestamp|l10n( 'shortdatetime' )}
</div>
2 changes: 1 addition & 1 deletion design/standard/templates/sysinfo/operationlist.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
{* DESIGN: Control bar END *}</div></div></div></div></div></div>
</div>

<hr>
<hr/>
{def $timestamp=currentdate()}
Host: {$hostname|wash}; date: {$timestamp|l10n( 'shortdatetime' )}
</div>
Expand Down
2 changes: 1 addition & 1 deletion design/standard/templates/sysinfo/operatorlist.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
{* DESIGN: Control bar END *}</div></div></div></div></div></div>
</div>

<hr>
<hr/>
{def $timestamp=currentdate()}
Host: {$hostname|wash}; date: {$timestamp|l10n( 'shortdatetime' )}
</div>
Expand Down
2 changes: 1 addition & 1 deletion design/standard/templates/sysinfo/policiesreport.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
</div>
</div>

<hr>
<hr/>
{def $timestamp=currentdate()}
Host: {$hostname|wash}; date: {$timestamp|l10n( 'shortdatetime' )}
</div>
2 changes: 1 addition & 1 deletion design/standard/templates/sysinfo/policylist.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
{* DESIGN: Control bar END *}</div></div></div></div></div></div>
</div>

<hr>
<hr/>
{def $timestamp=currentdate()}
Host: {$hostname|wash}; date: {$timestamp|l10n( 'shortdatetime' )}
</div>
Expand Down
2 changes: 1 addition & 1 deletion design/standard/templates/sysinfo/realpath.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
{* DESIGN: Control bar END *}</div></div></div></div></div></div>
</div>

<hr>
<hr/>
{def $timestamp=currentdate()}
Host: {$hostname|wash}; date: {$timestamp|l10n( 'shortdatetime' )}
</div>
2 changes: 1 addition & 1 deletion design/standard/templates/sysinfo/secinfo.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
{* DESIGN: Control bar END *}</div></div></div></div></div></div>
</div>

<hr>
<hr/>
{def $timestamp=currentdate()}
Host: {$hostname|wash}; date: {$timestamp|l10n( 'shortdatetime' )}
</div>
Expand Down
2 changes: 1 addition & 1 deletion design/standard/templates/sysinfo/solrdetails.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
{* DESIGN: Control bar END *}</div></div></div></div></div></div>
</div>

<hr>
<hr/>
{def $timestamp=currentdate()}
Host: {$hostname|wash}; date: {$timestamp|l10n( 'shortdatetime' )}
</div>
Expand Down
2 changes: 1 addition & 1 deletion design/standard/templates/sysinfo/sourcerevision.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

{* DESIGN: Content END *}</div></div></div></div></div></div>

<hr>
<hr/>
{def $timestamp=currentdate()}
Host: {$hostname|wash}; date: {$timestamp|l10n( 'shortdatetime' )}
</div>
4 changes: 2 additions & 2 deletions design/standard/templates/sysinfo/storagechurn.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
{$errormsg}
{else}
<div class="block">
<img src="{concat(ezroot('no'),$graphsource)}" alt="{$title|i18n('SysInfo')}" />
<img src="{concat(ezroot('no'),$graphsource)}" alt="{$title|i18n('SysInfo')}" />
</div>
{/if}

{* DESIGN: Content END *}</div></div></div>

<hr>
<hr/>
{def $timestamp=currentdate()}
Host: {$hostname|wash}; date: {$timestamp|l10n( 'shortdatetime' )}
</div>
2 changes: 1 addition & 1 deletion design/standard/templates/sysinfo/systemcheck.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

{* DESIGN: Content END *}</div></div></div></div></div></div>

<hr>
<hr/>
{def $timestamp=currentdate()}
Host: {$hostname|wash}; date: {$timestamp|l10n( 'shortdatetime' )}
</div>
3 changes: 2 additions & 1 deletion design/standard/templates/sysinfo/systemstatus.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
{/foreach}
</table>

<hr/>
{if $ezsnmpd_available}
See also the <a href={'snmp/mib/html'|ezurl}>eZSNMPd extension</a> for more status tests
{else}
Expand Down Expand Up @@ -107,7 +108,7 @@
{* DESIGN: Control bar END *}</div></div></div></div></div></div>
</div>

<hr>
<hr/>
{def $timestamp=currentdate()}
Host: {$hostname|wash}; date: {$timestamp|l10n( 'shortdatetime' )}
</div>
Expand Down
2 changes: 1 addition & 1 deletion design/standard/templates/sysinfo/table.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

{* DESIGN: Control bar END *}</div></div></div></div></div></div>

<hr>
<hr/>
{def $timestamp=currentdate()}
Host: {$hostname|wash}; date: {$timestamp|l10n( 'shortdatetime' )}
</div>
22 changes: 22 additions & 0 deletions doc/changelogs/CHANGELOG-0.9.17-to-0.10.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Changes from 0.9.17 to 0.10.0 - released 2022-2-20

Improved: current hostname and date are displayed at the bottom of every page, helping especially in case of cluster setups

New: its is now possible to specify the size for churn graphs (Height, Width) via ini settings

Improved: the churn graphs do display dates in X axis for long time spans instead of just times

Improved: the `Log churn` file list logs by decreasing severity

Improved: the churn graphs are cached separately for each server when running in cluster mode and no having set up
the bundle for cluster configuration

Improved: cluster db connection is now tested if the FileHandler in ClusteringSettings was changed, and its name contains the string `DFSFileHandler`

Improved: in the security checks, recommend php version 7.4 instead of 5.6

Improved: in the ini files checks, do not verify for one .ini and many .ini.append.php for eZP > 4.4

Fixed: clearing the churn graphs when clearing eZ caches did not work

Fixed: do not report mysql utf8mb4 tables as having a bad character set
2 changes: 1 addition & 1 deletion modules/sysinfo/lib/PhpSecInfo/Test/Core/php_version.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class PhpSecInfo_Test_Core_Php_Version extends PhpSecInfo_Test_Core
function _retrieveCurrentValue() {
$this->current_value = PHP_VERSION;

$url = 'http://php.net/releases/?serialize=1&version=5';
$url = 'http://php.net/releases/?serialize=1&version=7';
try {
$latestVersion = eZHTTPTool::getDataByURL( $url );
$versionInfo = unserialize( $latestVersion );
Expand Down
12 changes: 10 additions & 2 deletions modules/sysinfo/logchurn.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
* @todo add support for a fixed timespan, eg 'last N seconds'
* @todo support coarser intervals than 60 secs
* @todo add support for not showing older (rotated) logs
* @todo sort logs by severity
* @todo use a line graph and coalesce logs together
*/

Expand Down Expand Up @@ -38,10 +37,19 @@

// nb: this dir is calculated the same way as ezlog does
$debug = eZDebug::instance();
$logfiles = $debug->logFiles();

// sort logfiles according to severity
$logfiles = array( 'error.log' => null, 'warning.log' => null, 'debug.log' => null, 'notice.log' => null, 'strict.log' => null);
foreach( $debug->logFiles() as $item ) {
$logfiles[$item[1]] = $item;
}

foreach( $logfiles as $level => $file )
{
if ($file == null) {
continue;
}

$logfile = $file[0] . $file[1];
$logname = str_replace( '.log', '', $file[1] );
$cachefiles[$logname] = false;
Expand Down
Loading

0 comments on commit 18a82a5

Please sign in to comment.