return $volumes;
} // end function GetVolumeList()
+ public function CountJobsbyLevel( $delay = LAST_DAY, $level = 'F' )
+ {
+ $end_date = mktime();
+ $start_date = $end_date - $delay;
+
+ $start_date = date( "Y-m-d H:i:s", $start_date );
+ $end_date = date( "Y-m-d H:i:s", $end_date );
+
+ $query = "SELECT COUNT(JobId) as jobs FROM Job ";
+ $query .= "WHERE (EndTime BETWEEN '$start_date' AND '$end_date') AND ";
+ $query .= "Level = '$level' ";
+
+ $result = $this->db_link->query( $query );
+
+ if (PEAR::isError( $result ) ) {
+ die( "Unable to get number of jobs with $level status from catalog <br />" . $result->getMessage() );
+ }else {
+ $jobs = $result->fetchRow( DB_FETCHMODE_ASSOC );
+ return $jobs['jobs'];
+ }
+
+ }
+
public function CountJobs( $delay = LAST_DAY, $status = 'any' )
{
$query = "SELECT COUNT(JobId) AS job_nb FROM Job ";
$smarty->debugging = false;
$smarty->force_compile = true;
-$smarty->template_dir = "./templates";
-$smarty->compile_dir = "./templates_c";
+$smarty->template_dir = "./templates";
+$smarty->compile_dir = "./templates_c";
$smarty->config_dir = "./configs";
/*
-$smarty->config_load("bacula.conf"); // Load config file
+$smarty->config_load("bacula.conf"); // Load config file
$mode = $smarty->get_config_vars("mode");
*/ // Lite o Extend?
// Last 24 hours elapsed time (last_run_report.tpl)
//$smarty->assign( 'elapsed_jobs', $dbSql->Get_ElapsedTime_Job() );
+// Last 24 hours Job Levels
+$smarty->assign( 'incr_jobs', $dbSql->CountJobsbyLevel( LAST_DAY, 'I') );
+$smarty->assign( 'diff_jobs', $dbSql->CountJobsbyLevel( LAST_DAY, 'D') );
+$smarty->assign( 'full_jobs', $dbSql->CountJobsbyLevel( LAST_DAY, 'F') );
+
// Last 24 hours Job status graph
$data = array();
$status = array( 'completed', 'terminated_errors', 'failed', 'waiting', 'created', 'running', 'error' );
<tr>
<td colspan="2" class="label"><hr></td>
</tr>
+ <tr>
+ <td class="label">Job Level (Incr / Diff / Full)</td>
+ <td class="info">{$incr_jobs} / {$diff_jobs} / {$full_jobs}</td>
+ </tr>
+ <tr>
+ <td colspan="2" class="label"><hr></td>
+ </tr>
<tr>
<td class="label">Transferred Bytes</td>
<td class="info">{$bytes_last}</td>