Exemplo n.º 1
0
<?php

include dirname(__FILE__) . '/../inc/init.php';
fAuthorization::requireLoggedIn();
header('Cache-Control: no-cache, must-revalidate');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
$debug = fRequest::get('debug', 'boolean');
if (!$debug) {
    header('Content-type: application/json');
}
$check_id = fRequest::get('check_id', 'integer');
$check = new Check($check_id);
$url = GRAPHITE_URL . '/graphlot/rawdata?&from=-24hour&until=-0hour' . '&target=' . $check->prepareTarget() . '&target=keepLastValue(threshold(' . $check->prepareWarn() . '))';
//       '&target=threshold(' . $check->prepareError() . ')';
$contents = file_get_contents($url);
//$contents = file_get_contents(GRAPHITE_URL . '/graphlot/rawdata?&from=-24hour&until=-0hour&target=' . $check->prepareTarget() . '&target=' . $check->prepareWarn() . '&target=' . $check->prepareError());
print $contents;
Exemplo n.º 2
0
        ?>
        <tr>
        <td><?php 
        echo $status_array[$check_result->prepareStatus()];
        ?>
</td>
        <td><?php 
        echo $check_result->prepareValue();
        ?>
</td>
        <td><?php 
        echo $check->prepareError();
        ?>
</td>
        <td><?php 
        echo $check->prepareWarn();
        ?>
</td>
        <td><?php 
        echo $check_result->prepareState();
        ?>
</td>
        <td><?php 
        echo $check_result->prepareTimestamp('Y-m-d H:i:s');
        ?>
</td>
        </tr>
    <?php 
    }
    ?>
    </table></div>
    <th>Value</th>
    <th>Error</th>
    <th>Warn</th>
    <th>State</th>
    <th>Time</th>
       </tr>    
	<?php
	$first = TRUE;
	foreach ($check_results as $check_result) {
        $check = new Check($check_result->getCheck_Id());
		?>
    	<tr>
        <td><?php echo ($check_result->prepareStatus() == 2 ? 'Warning' : 'Error'); ?></td>
        <td><?php echo $check_result->prepareValue() ?></td>
        <td><?php echo $check->prepareError() ?></td>
        <td><?php echo $check->prepareWarn() ?></td>
        <td><?php echo $check_result->prepareState() ?></td>
        <td><?php echo $check_result->prepareTimestamp('Y-m-d H:i:s'); ?></td>
        <?php /*<div id="graphite-event-modal_<?php echo $check_result->getResult_Id(); ?>" class="modal hide fade">
            <div class="modal-header">
              <a href="#" class="close">&times;</a>
              <h3>view Event</h3>
            </div>
            <div class="modal-body">
              Event Details
            </div>
          </div>*/ ?>
        </tr>
    <?php } ?>
    </table></div>
    <?
    <th>Value</th>
    <th>Error</th>
    <th>Warn</th>
    <th>State</th>
    <th>Time</th>
       </tr>    
	<?php
	$first = TRUE;
	foreach ($check_results as $check_result) {
        $check = new Check($check_result->getCheck_Id());
	?>
    	<tr>
        <td><?=($check_result->prepareStatus() == 2 ? 'Warning' : 'Error'); ?></td>
        <td><?=$check_result->prepareValue(); ?></td>
        <td><?=$check->prepareError(); ?></td>
        <td><?=$check->prepareWarn(); ?></td>
        <td><?=$check_result->prepareState(); ?></td>
        <td><?=$check_result->prepareTimestamp('Y-m-d H:i:s'); ?></td>
        </tr>
    <?php } ?>
    </table></div>
    <?
    //check to see if paging is needed
    $total_pages = ceil($check_results->count(TRUE) / $GLOBALS['PAGE_SIZE']);
    if ($total_pages > 1) {
      $prev_class = 'previous';
      $current_link = fURL::get() . "?action=$action&check_id=$check_id";
      $prev_link = $current_link . '&page=' . ($page_num - 1);
      $next_class = 'next';
      $next_link = $current_link . '&page=' . ($page_num + 1);
      if ($page_num == 1) {