TRUE)) - display for devices down * * Another statuses: * devices, uptime, ports, errors, services, bgp * * @param array $options * @return none * */ function print_status_old($options) { global $config; $max_interval = filter_var($options['max']['interval'], FILTER_VALIDATE_INT, array('options' => array('default' => 24, 'min_range' => 1))); $max_count = filter_var($options['max']['count'], FILTER_VALIDATE_INT, array('options' => array('default' => 200, 'min_range' => 1))); $string = '
Device | ' . PHP_EOL; $string .= 'Type | ' . PHP_EOL; $string .= 'Status | ' . PHP_EOL; $string .= 'Entity | ' . PHP_EOL; // $string .= 'Location | ' . PHP_EOL; $string .= 'Information | ' . PHP_EOL; $string .= '
---|---|---|---|---|---|
' . generate_device_link_short($device) . ' | ' . PHP_EOL; // $string .= 'Device | ' . PHP_EOL; $string .= 'Device Down | ' . PHP_EOL; $string .= '' . generate_device_link_short($device) . ' | ' . PHP_EOL; // $string .= '' . escape_html(truncate($device['location'], 30)) . ' | ' . PHP_EOL; $string .= '' . deviceUptime($device, 'short') . ' | ' . PHP_EOL; $string .= '
' . generate_device_link_short($device) . ' | ' . PHP_EOL; // $string .= 'Device | ' . PHP_EOL; $string .= 'Device Rebooted | ' . PHP_EOL; $string .= '' . generate_device_link_short($device) . ' | ' . PHP_EOL; // $string .= '' . escape_html(truncate($device['location'], 30)) . ' | ' . PHP_EOL; $string .= 'Uptime ' . format_uptime($device['uptime'], 'short') . ' | ' . PHP_EOL; $string .= '
Port | '; $string .= 'Port Down | '; $string .= 'Too many ports down. See All DOWN ports. | |||
' . generate_device_link_short($port) . ' | ' . PHP_EOL; // $string .= 'Port | ' . PHP_EOL; $string .= 'Port Down | ' . PHP_EOL; $string .= '' . get_icon('port') . ' ' . generate_port_link_short($port) . ' | ' . PHP_EOL; // $string .= '' . escape_html(truncate($port['location'], 30)) . ' | ' . PHP_EOL; $string .= 'Down for ' . format_uptime($config['time']['now'] - strtotime($port['ifLastChange']), 'short'); // This is like deviceUptime() if ($options['links']) { $string .= ' ('.nicecase($port['protocol']).': ' .$port['remote_hostname'].' / ' .$port['remote_port'] .')'; } $string .= ' | ' . PHP_EOL; $string .= '
' . generate_device_link_short($port) . ' | ' . PHP_EOL; // $string .= 'Port | ' . PHP_EOL; $string .= 'Port Errors | ' . PHP_EOL; $string .= '' . get_icon('port') . ' ' . generate_port_link_short($port, NULL, 'port_errors') . ' | ' . PHP_EOL; // $string .= '' . escape_html(truncate($port['location'], 30)) . ' | ' . PHP_EOL; $string .= 'Errors '; if ($port['ifInErrors_delta']) { $string .= 'In: ' . $port['ifInErrors_delta']; } if ($port['ifInErrors_delta'] && $port['ifOutErrors_delta']) { $string .= ', '; } if ($port['ifOutErrors_delta']) { $string .= 'Out: ' . $port['ifOutErrors_delta']; } $string .= ' | ' . PHP_EOL; $string .= '
' . generate_device_link_short($peer, [ 'tab' => 'routing', 'proto' => 'bgp' ]) . ' | ' . PHP_EOL; // $string .= 'BGP | ' . PHP_EOL; $string .= 'BGP ' . nicecase($peer['bgpPeerState']) . ' | ' . PHP_EOL; $string .= '' . $peer_ip . ' | ' . PHP_EOL; // $string .= '' . escape_html(truncate($peer['location'], 30)) . ' | ' . PHP_EOL; $string .= 'AS' . $peer['human_remote_as'] . ' : ' . $peer['astext'] . ' | ' . PHP_EOL; $string .= '
'); echo '
'; $string .= ' | ' . $entry['device_link'] . ' | ' . PHP_EOL; $string .= ''.$entry['class'].' '.$entry['event'].' | ' . PHP_EOL; $string .= ''. $entry['icon_tag'] . ($entry['entity_link'] ? $entry['entity_link'] : $entry['device_link']) . ' | ' . PHP_EOL; $string .= '' . $entry['time'] . ' | ' . PHP_EOL; $string .= '