From a1f9fe19faf38b395cdb9116fd299bd70a715993 Mon Sep 17 00:00:00 2001 From: f0o Date: Fri, 28 Aug 2015 09:24:08 +0100 Subject: [PATCH] Added option to display errored ports in device summary --- doc/Support/Configuration.md | 1 + html/includes/common/device-summary-horiz.inc.php | 4 ++++ html/includes/common/device-summary-vert.inc.php | 15 +++++++++++++++ includes/defaults.inc.php | 3 +++ 4 files changed, 23 insertions(+) diff --git a/doc/Support/Configuration.md b/doc/Support/Configuration.md index dfc2fd1432..e804239e60 100644 --- a/doc/Support/Configuration.md +++ b/doc/Support/Configuration.md @@ -143,6 +143,7 @@ $config['show_locations'] = 1; # Enable Locations on menu $config['show_locations_dropdown'] = 1; # Enable Locations dropdown on menu $config['show_services'] = 0; # Enable Services on menu $config['int_customers'] = 1; # Enable Customer Port Parsing +$config['summary_errors'] = 0; # Show Errored ports in summary boxes on the dashboard $config['customers_descr'] = 'cust'; // The description to look for in ifDescr. Can be an array as well array('cust','cid'); $config['transit_descr'] = ""; // Add custom transit descriptions (can be an array) $config['peering_descr'] = ""; // Add custom peering descriptions (can be an array) diff --git a/html/includes/common/device-summary-horiz.inc.php b/html/includes/common/device-summary-horiz.inc.php index 439234af46..f8b6b56bdf 100644 --- a/html/includes/common/device-summary-horiz.inc.php +++ b/html/includes/common/device-summary-horiz.inc.php @@ -12,6 +12,7 @@ $temp_output = ' Down Ignored Disabled + '.($config['summary_errors'] ? 'Errored' : '').' @@ -22,6 +23,7 @@ $temp_output = ' '.$devices['down'].' '.$devices['ignored'].' '.$devices['disabled'].' + '.($config['summary_errors'] ? '-' : '').' Ports @@ -30,6 +32,7 @@ $temp_output = ' '.$ports['down'].' '.$ports['ignored'].' '.$ports['shutdown'].' + '.($config['summary_errors'] ? ' '.$ports['errored'].'' : '').' '; if ($config['show_services']) { @@ -41,6 +44,7 @@ $temp_output .= ' '.$services['down'].' '.$services['ignored'].' '.$services['disabled'].' + '.($config['summary_errors'] ? '-' : '').' '; } $temp_output .= ' diff --git a/html/includes/common/device-summary-vert.inc.php b/html/includes/common/device-summary-vert.inc.php index e5d5706fe1..0676775042 100644 --- a/html/includes/common/device-summary-vert.inc.php +++ b/html/includes/common/device-summary-vert.inc.php @@ -83,6 +83,21 @@ if ($config['show_services']) { } +if ($config['summary_errors']) { + $temp_output .= ' + + + Errored + - + '.$ports['errored'].' +'; + if ($config['show_services']) { + $temp_output .= ' + - +'; + } +} + $temp_output .= ' diff --git a/includes/defaults.inc.php b/includes/defaults.inc.php index 66ca1fcea9..27d715d936 100644 --- a/includes/defaults.inc.php +++ b/includes/defaults.inc.php @@ -783,3 +783,6 @@ $config['gui']['network-map']['style'] = 'new';//old is also va // Navbar variables $config['navbar']['manage_groups']['hide'] = 0; + +// Show errored ports in the summary table on the dashboard +$config['summary_errors'] = 0;