Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ##|+PRIV
- ##|*IDENT=page-diagnostics-system-activity
- ##|*NAME=Diagnostics: System Activity
- ##|*DESCR=Allows access to the 'Diagnostics: System Activity' page
- ##|*MATCH=diag_system_activity.php*
- ##|-PRIV
- require_once("guiconfig.inc");
- $tg_backgroundupdate = 'true';
- if ($_REQUEST['getactivity']) {
- $text = `/usr/bin/top -aHS | /usr/bin/cut -c1-105`;
- echo $text;
- exit;
- }
- if ($input_errors) {
- print_input_errors($input_errors);
- }
- ?>
- <script type="text/javascript">
- //<![CDATA[
- events.push(function() {
- ajaxbusy = false;
- function getcpuactivity() {
- if (ajaxbusy) {
- return;
- }
- ajaxbusy = true;
- ajaxRequest = $.ajax(
- {
- url: '/diag_system_activity.php',
- type: 'post',
- data: {
- getactivity: 'yes'
- },
- dataType: "html",
- }
- );
- // Deal with the results of the above ajax call
- ajaxRequest.done(function (response, textStatus, jqXHR) {
- $('#xhrOutput').html(response);
- ajaxbusy = false;
- });
- setTimeout(getcpuactivity, 5000);
- };
- getcpuactivity();
- });
- //]]>
- </script>
- <div class="panel panel-default">
- <div class="panel-heading"><h2 class="panel-title"><?=gettext('CPU Activity')?></h2></div>
- <div class="panel panel-body">
- <pre id="xhrOutput"><?=gettext("Gathering CPU activity, please wait...")?></pre>
- </div>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement