array( 'title' => translate('Events'), 'filter' => array( 'Query' => array( 'terms' => array() ) ), 'totalevents' => 0, 'totaldiskspace' => 0, ), 'Hour'=>array( 'title' => translate('Hour'), 'filter' => array( 'Query' => array( 'terms' => array( array( 'attr' => 'StartDateTime', 'op' => '>=', 'val' => '-1 hour' ), ) ) ), 'totalevents' => 0, 'totaldiskspace' => 0, ), 'Day'=>array( 'title' => translate('Day'), 'filter' => array( 'Query' => array( 'terms' => array( array( 'attr' => 'StartDateTime', 'op' => '>=', 'val' => '-1 day' ), ) ) ), 'totalevents' => 0, 'totaldiskspace' => 0, ), 'Week'=>array( 'title' => translate('Week'), 'filter' => array( 'Query' => array( 'terms' => array( array( 'attr' => 'StartDateTime', 'op' => '>=', 'val' => '-7 day' ), ) ) ), 'totalevents' => 0, 'totaldiskspace' => 0, ), 'Month'=>array( 'title' => translate('Month'), 'filter' => array( 'Query' => array( 'terms' => array( array( 'attr' => 'StartDateTime', 'op' => '>=', 'val' => '-1 month' ), ) ) ), 'totalevents' => 0, 'totaldiskspace' => 0, ), 'Archived'=>array( 'title' => translate('Archived'), 'filter' => array( 'Query' => array( 'terms' => array( array( 'attr' => 'Archived', 'op' => '=', 'val' => '1' ), ) ) ), 'totalevents' => 0, 'totaldiskspace' => 0, ), ); $navbar = getNavBarHTML(); ob_start(); include('_monitor_filters.php'); $filterbar = ob_get_contents(); ob_end_clean(); $show_storage_areas = count($storage_areas) > 1 and canEdit( 'System' ) ? 1 : 0; $maxWidth = 0; $maxHeight = 0; $zoneCount = 0; $total_capturing_bandwidth=0; $status_counts = array(); for ( $i = 0; $i < count($displayMonitors); $i++ ) { $monitor = &$displayMonitors[$i]; if ( ! $monitor['Status'] ) { if ( $monitor['Type'] == 'WebSite' ) $monitor['Status'] = 'Running'; else $monitor['Status'] = 'NotRunning'; } if ( !isset($status_counts[$monitor['Status']]) ) $status_counts[$monitor['Status']] = 0; $status_counts[$monitor['Status']] += 1; if ( $monitor['Function'] != 'None' ) { $scaleWidth = reScale( $monitor['Width'], $monitor['DefaultScale'], ZM_WEB_DEFAULT_SCALE ); $scaleHeight = reScale( $monitor['Height'], $monitor['DefaultScale'], ZM_WEB_DEFAULT_SCALE ); if ( $maxWidth < $scaleWidth ) $maxWidth = $scaleWidth; if ( $maxHeight < $scaleHeight ) $maxHeight = $scaleHeight; } #$monitor['zmc'] = zmcStatus( $monitor ); #$monitor['zma'] = zmaStatus( $monitor ); $zoneCount += $monitor['ZoneCount']; $counts = array(); foreach ( array_keys( $eventCounts ) as $j ) { $filter = addFilterTerm( $eventCounts[$j]['filter'], count($eventCounts[$j]['filter']['Query']['terms']), array( 'cnj' => 'and', 'attr' => 'MonitorId', 'op' => '=', 'val' => $monitor['Id'] ) ); parseFilter( $filter ); #$counts[] = 'count(if(1'.$filter['sql'].",1,NULL)) AS EventCount$j, SUM(if(1".$filter['sql'].",DiskSpace,NULL)) As DiskSpace$j"; $monitor['eventCounts'][$j]['filter'] = $filter; $eventCounts[$j]['totalevents'] += $monitor[$j.'Events']; $eventCounts[$j]['totaldiskspace'] += $monitor[$j.'EventDiskSpace']; } unset($monitor); } // end foreach display monitor $cycleWidth = $maxWidth; $cycleHeight = $maxHeight; noCacheHeaders(); $eventsWindow = 'zm'.ucfirst(ZM_WEB_EVENTS_VIEW); $left_columns = 3; if ( count($servers) ) $left_columns += 1; if ( ZM_WEB_ID_ON_CONSOLE ) $left_columns += 1; if ( $show_storage_areas ) $left_columns += 1; xhtmlHeaders( __FILE__, translate('Console') ); getBodyTopHTML(); ?>
'.round(100*($status_counts[$status]/count($displayMonitors)),1).'%'; } echo $html; ?>
'. $j .''; } ?> '; echo $table_head; } # monitor_i % 100 ?> '. makePopupLink( '?view=monitor&mid='.$monitor['Id'], 'zmMonitor'.$monitor['Id'], 'monitor', ''.$Monitor->Source().'', canEdit('Monitors') ).''; if ( $show_storage_areas ) { ?>
videocam  settings 
' : '>') . $monitor['Id'] ?> ' : '>') . $monitor['Name'] ?>
', array_map(function($group_id){ $Group = Group::find_one(array('Id'=>$group_id)); if ( $Group ) { $Groups = $Group->Parents(); array_push( $Groups, $Group ); } return implode(' > ', array_map(function($Group){ return ''.$Group->Name().''; }, $Groups )); }, $Monitor->GroupIds() ) ); ?>
'.translate('Fn'.$monitor['Function']).( empty($monitor['Enabled']) ? ', disabled' : '' ) .'', canEdit('Monitors') ) ?>

Name(); ?> Name(); } ?> ' : '') . $monitor[$i.'Events'] . '
' . human_filesize($monitor[$i.'EventDiskSpace']) ?>
disabled="disabled"/>
' : '') . $eventCounts[$i]['totalevents'].'
'.'
'.human_filesize($eventCounts[$i]['totaldiskspace']) ?>