1<?php
2
3require 'includes/html/graphs/common.inc.php';
4
5$rrd_filename = Rrd::name($device['hostname'], ['app', 'mysql', $app['app_id'], 'status']);
6
7$array = [
8    'State_closing_tables'       => 'd2',
9    'State_copying_to_tmp_table' => 'd3',
10    'State_end'                  => 'd4',
11    'State_freeing_items'        => 'd5',
12    'State_init'                 => 'd6',
13    'State_locked'               => 'd7',
14    'State_login'                => 'd8',
15    'State_preparing'            => 'd9',
16    'State_reading_from_net'     => 'da',
17    'State_sending_data'         => 'db',
18    'State_sorting_result'       => 'dc',
19    'State_statistics'           => 'dd',
20    'State_updating'             => 'de',
21    'State_writing_to_net'       => 'df',
22    'State_none'                 => 'dg',
23    'State_other'                => 'dh',
24];
25
26$i = 0;
27if (Rrd::checkRrdExists($rrd_filename)) {
28    foreach ($array as $var => $ds) {
29        $rrd_list[$i]['filename'] = $rrd_filename;
30        if (is_array($var)) {
31            $rrd_list[$i]['descr'] = $var['descr'];
32        } else {
33            $rrd_list[$i]['descr'] = $var;
34        }
35
36        $rrd_list[$i]['descr'] = str_replace('_', ' ', $rrd_list[$i]['descr']);
37        $rrd_list[$i]['descr'] = str_replace('State ', '', $rrd_list[$i]['descr']);
38        $rrd_list[$i]['ds'] = $ds;
39        $i++;
40    }
41} else {
42    echo "file missing: $file";
43}
44
45$colours = 'mixed';
46$nototal = 1;
47$unit_text = 'activity';
48
49require 'includes/html/graphs/generic_multi_simplex_seperated.inc.php';
50