'Duration', 'header-border' => TRUE, 'padding' => TRUE, ]; $box_args['header-controls'] = ['controls' => ['perf' => ['text' => 'Performance Data', //'icon' => 'icon-trash', 'anchor' => TRUE, 'url' => generate_url(['page' => 'device', 'device' => $device['device_id'], 'tab' => 'perf']), ]]]; echo generate_box_open($box_args); $ptime = array_values($device['state']['poller_history'])[0]; // note for self: PHP 5.4+ $pstart = array_keys($device['state']['poller_history'])[0]; echo "Last Polled: " . format_unixtime($pstart) . ' (took ' . $ptime . 's) - Details'; $dtime = array_values($device['state']['discovery_history'])[0]; // note for self: PHP 5.4+ $dstart = array_keys($device['state']['discovery_history'])[0]; echo "

Last discovered: " . format_unixtime($dstart) . ' (took ' . $dtime . 's) - Details

'; echo generate_box_close(); $box_args = ['title' => 'RANCID', 'header-border' => TRUE, 'padding' => TRUE, ]; $box_args['header-controls'] = ['controls' => ['perf' => ['text' => 'Show Config', 'anchor' => TRUE, 'url' => generate_url(['page' => 'device', 'device' => $device['device_id'], 'tab' => 'showconfig']), ]]]; echo generate_box_open($box_args); if (safe_count($config['rancid_configs'])) { $device_config_file = get_rancid_filename($device['hostname'], 1); echo('

'); if ($device_config_file) { print_success("Configuration file for device was found; will be displayed to users with level 7 or higher."); } elseif (!isset($config['os'][$device['os']]['rancid'])) { print_warning("Configuration file for device was not found."); } else { print_warning("Os not supported by RANCID."); } } else { print_warning("No RANCID directories configured."); } echo generate_box_close(); $box_args = [ 'title' => 'UNIX Agent', 'header-border' => TRUE, 'padding' => TRUE, ]; // show for allowed module if (is_module_enabled($device, 'unix-agent', 'poller')) { $box_args['header-controls'] = [ 'controls' => [ 'perf' => ['text' => 'Show Applications', 'anchor' => TRUE, 'url' => generate_url(['page' => 'device', 'device' => $device['device_id'], 'tab' => 'apps'])] ] ]; echo generate_box_open($box_args); echo '

';
            if ($unixagent = get_dev_attrib($device, 'unixagent_raw')) {
                if ($tmp = str_decompress($unixagent)) {
                    // New compressed format
                    $unixagent = $tmp;
                    unset($tmp);
                }
                echo escape_html($unixagent);
            }
            echo '
'; } else { echo generate_box_open($box_args); print_warning("Unix-agent disabled for os."); } echo generate_box_close(); $box_args = ['title' => 'Smokeping', 'header-border' => TRUE, 'padding' => TRUE, ]; $box_args['header-controls'] = ['controls' => ['perf' => ['text' => 'Show Latency', 'anchor' => TRUE, 'url' => generate_url(['page' => 'device', 'device' => $device['device_id'], 'tab' => 'latency']), ]]]; echo generate_box_open($box_args); if (isset($config['smokeping']['dir']) && is_dir($config['smokeping']['dir'])) { $smokeping_files = get_smokeping_files(1); echo('

'); if ($smokeping_files['incoming'][$device['hostname']]) { print_success("RRD for incoming latency found."); } else { print_error("RRD for incoming latency not found."); } if ($smokeping_files['outgoing'][$device['hostname']]) { print_success("RRD for outgoing latency found."); } else { print_error("RRD for outgoing latency not found."); } } else { print_warning("No Smokeping directory configured."); } echo generate_box_close(); $box_args = ['title' => 'Device Graphs', 'header-border' => TRUE, //'padding' => TRUE, ]; $box_args['header-controls'] = ['controls' => ['perf' => ['text' => 'Show Graphs', 'anchor' => TRUE, 'url' => generate_url(['page' => 'device', 'device' => $device['device_id'], 'tab' => 'graphs']), ]]]; echo generate_box_open($box_args); echo(''); ?> '); if (is_file('includes/graphs/device/' . $graph_entry['graph'] . '.inc.php')) { echo(''); } else { echo(''); } if (is_array($config['graph_types']['device'][$graph_entry['graph']])) { echo(''); } else { echo(''); } if ($graph_entry['enabled']) { echo(''); } else { echo(''); } echo(''); echo(''); } ?>
Graph Type Has File Has Array Enabled
' . $graph_entry['graph'] . '' . print_r($config['graph_types']['device'][$graph_entry['graph']], TRUE) . '