* [ADDED] new monitoring method : endCronjob * [IMPROVED] Use newly added error codes * [ADDED] mail notifications, enabled by default * [ADDED] cron disable on fatal errors with exit code != 0 * [ADDED] Command line swtich: -f = Force running crons even if disabled * [ADDED] Disabled status in monitoring site This will improve error handling in our cronjobs. Fatal errors now require manual intervention by explicityly running crons with the force option (`-f`). Until they are forced to run, crons will stay disabled. Fixes #773 once merged
45 lines
1.4 KiB
PHP
45 lines
1.4 KiB
PHP
<?php
|
|
|
|
// Make sure we are called from index.php
|
|
if (!defined('SECURITY')) die('Hacking attempt');
|
|
|
|
// Check user to ensure they are admin
|
|
if (!$user->isAuthenticated() || !$user->isAdmin($_SESSION['USERDATA']['id'])) {
|
|
header("HTTP/1.1 404 Page not found");
|
|
die("404 Page not found");
|
|
}
|
|
|
|
// Default crons to monitor
|
|
$aCrons = array('statistics','auto_payout','manual_payout','archive_cleanup','blockupdate','findblock','notifications','tickerupdate');
|
|
|
|
// Special cases, only add them if activated
|
|
switch ($config['payout_system']) {
|
|
case 'pplns':
|
|
$aCrons[] = $config['payout_system'] . '_payout';
|
|
break;
|
|
case 'pps':
|
|
$aCrons[] = $config['payout_system'] . '_payout';
|
|
break;
|
|
case 'prop':
|
|
$aCrons[] = 'proportional_payout';
|
|
break;
|
|
}
|
|
|
|
// Data array for template
|
|
foreach ($aCrons as $strCron) {
|
|
$aCronStatus[$strCron] = array(
|
|
'disabled' => $monitoring->getStatus($strCron . '_disabled'),
|
|
'exit' => $monitoring->getStatus($strCron . '_status'),
|
|
'active' => $monitoring->getStatus($strCron . '_active'),
|
|
'runtime' => $monitoring->getStatus($strCron . '_runtime'),
|
|
'starttime' => $monitoring->getStatus($strCron . '_starttime'),
|
|
'endtime' => $monitoring->getStatus($strCron . '_endtime'),
|
|
'message' => $monitoring->getStatus($strCron . '_message'),
|
|
);
|
|
}
|
|
$smarty->assign("CRONSTATUS", $aCronStatus);
|
|
|
|
// Tempalte specifics
|
|
$smarty->assign("CONTENT", "default.tpl");
|
|
?>
|