diff --git a/AUTHORS.md b/AUTHORS.md index c81e1a7da..ad60a7f79 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -19,6 +19,7 @@ Contributors to LibreNMS: - Alan Gregory (alangregory) - Joubert RedRat (joubertredrat) - Len Lin (Ultra2D) +- Christopher Freas (nwautomator) [1]: http://observium.org/ "Observium web site" diff --git a/Makefile b/Makefile index f7894ab81..986e4d8e3 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ push-dev: push-personal pp: $(GIT) push personal -push-testing: +push-testing pt: $(GIT) push testing update-subtrees: datetime-subtree moment-subtree font-awesome vis diff --git a/callback.php b/callback.php index bbfe57260..2c82b3ef9 100644 --- a/callback.php +++ b/callback.php @@ -16,7 +16,7 @@ $enabled = dbFetchCell("SELECT `value` FROM `callback` WHERE `name` = 'enabled'" if ($enabled == 1) { if (dbFetchCell("SELECT `value` FROM `callback` WHERE `name` = 'uuid'") == '') { - dbInsert(array('name'=>'uuid','value'=>guidv4(openssl_random_pseudo_bytes(16))),'callback'); + dbInsert(array('name'=>'uuid','value'=>guidv4(openssl_random_pseudo_bytes(16))), 'callback'); } $uuid = dbFetchCell("SELECT `value` FROM `callback` WHERE `name` = 'uuid'"); @@ -72,12 +72,13 @@ if ($enabled == 1) { $submit = array('data'=>$data); $fields = ''; - foreach($submit as $key => $value) { - $fields .= $key . '=' . $value . '&'; + foreach ($submit as $key => $value) { + $fields .= $key . '=' . $value . '&'; } rtrim($fields, '&'); $post = curl_init(); + set_curl_proxy($post); curl_setopt($post, CURLOPT_URL, $config['callback_post']); curl_setopt($post, CURLOPT_POST, count($submit)); curl_setopt($post, CURLOPT_POSTFIELDS, $fields); @@ -89,12 +90,13 @@ if ($enabled == 1) { $fields = "uuid=$uuid"; $clear = curl_init(); + set_curl_proxy($clear); curl_setopt($clear, CURLOPT_URL, $config['callback_clear']); curl_setopt($clear, CURLOPT_POST, count($clear)); curl_setopt($clear, CURLOPT_POSTFIELDS, $fields); curl_setopt($clear, CURLOPT_RETURNTRANSFER, 1); $result = curl_exec($clear); - dbDelete('callback','`name`="uuid"',array()); + dbDelete('callback', '`name`="uuid"', array()); dbUpdate(array('value' => '0'), 'callback', '`name` = "enabled"', array()); } diff --git a/config.php.default b/config.php.default index c98b8677b..479482113 100755 --- a/config.php.default +++ b/config.php.default @@ -41,3 +41,6 @@ $config['auth_mechanism'] = "mysql"; # default, other options: ldap, http-auth $config['poller-wrapper']['alerter'] = FALSE; # Uncomment the next line to disable daily updates #$config['update'] = 0; + +# Uncomment to submit callback stats via proxy +#$config['callback_proxy'] = "hostname:port"; diff --git a/doc/General/Changelog.md b/doc/General/Changelog.md index cc025fef6..4233ecd17 100644 --- a/doc/General/Changelog.md +++ b/doc/General/Changelog.md @@ -3,6 +3,11 @@ ####Bug fixes - Fixed ack of worse/better alerts (PR720) - Fixed ORIG_PATH_INFO warnings (PR727) + - Added missing CPU id for Cisco SB (PR744) + - Changed Processors table name to lower case in processors discovery (PR751) + - Fixed alerts path issue (PR756, PR760) + - Supress further port alerts when interface goes down (PR745) + - Fixed login so redirects via 303 when POST data sent (PR775) ####Improvements - New theme support added (light,dark and mono) (PR682,PR683,PR701) @@ -13,6 +18,15 @@ - Update to Foritgate support (PR709) - Added support for UBNT AirOS and AirFibre (PR721,PR730,PR731) - Added support device groups + alerts to be mapped to devices or groups (PR722) + - Added basic Cambium support (PR738) + - Added basic F5 support (PR670) + - Shorten interface names on map (PR752) + - Added PowerCode support (PR762) + - Added Autodiscovery via OSPF (PR772) + - Added visual graph of alert log (PR777) + - Added Callback system to send anonymous stats (PR768) + - More tables converted to use bootgrid (PR729, PR761) + - New Global Cache to store common queries added (PR780) ### Mar 2015 diff --git a/doc/Installation/Installation-(Debian-Ubuntu).md b/doc/Installation/Installation-(Debian-Ubuntu).md index 4df0bfee4..e7a56447c 100644 --- a/doc/Installation/Installation-(Debian-Ubuntu).md +++ b/doc/Installation/Installation-(Debian-Ubuntu).md @@ -182,6 +182,8 @@ so that it looks like this: That's it! You now should be able to log in to http://librenms.example.com/. Please note that we have not covered HTTPS setup in this example, so your LibreNMS install is not secure by default. Please do not expose it to the public Internet unless you have configured HTTPS and taken appropriate web server hardening steps. +It would be great if you would consider opting into the stats system we have, please see [this page](http://docs.librenms.org/General/Callback-Stats-and-Privacy/) on what it is and how to enable it. + [1]: https://github.com/Atrato/observium-poller-wrapper [2]: http://git-scm.com/book [3]: http://gitready.com/ diff --git a/doc/Installation/Installation-(RHEL-CentOS).md b/doc/Installation/Installation-(RHEL-CentOS).md index e8a17014d..e7b3d4998 100644 --- a/doc/Installation/Installation-(RHEL-CentOS).md +++ b/doc/Installation/Installation-(RHEL-CentOS).md @@ -216,3 +216,5 @@ so that it looks like this: ### Install complete ### That's it! You now should be able to log in to http://librenms.example.com/. Please note that we have not covered HTTPS setup in this example, so your LibreNMS install is not secure by default. Please do not expose it to the public Internet unless you have configured HTTPS and taken appropriate web server hardening steps. + +It would be great if you would consider opting into the stats system we have, please see [this page](http://docs.librenms.org/General/Callback-Stats-and-Privacy/) on what it is and how to enable it. diff --git a/doc/Installation/Installation-Lighttpd-(Debian-Ubuntu).md b/doc/Installation/Installation-Lighttpd-(Debian-Ubuntu).md index 196654283..3d95a539a 100644 --- a/doc/Installation/Installation-Lighttpd-(Debian-Ubuntu).md +++ b/doc/Installation/Installation-Lighttpd-(Debian-Ubuntu).md @@ -158,3 +158,5 @@ so that it looks like this: ### Install complete ### That's it! You now should be able to log in to http://librenms.example.com/. Please note that we have not covered HTTPS setup in this example, so your LibreNMS install is not secure by default. Please do not expose it to the public Internet unless you have configured HTTPS and taken appropriate web server hardening steps. + +It would be great if you would consider opting into the stats system we have, please see [this page](http://docs.librenms.org/General/Callback-Stats-and-Privacy/) on what it is and how to enable it. diff --git a/html/css/styles.css b/html/css/styles.css index 8bfce8f92..61a546dfb 100644 --- a/html/css/styles.css +++ b/html/css/styles.css @@ -1606,7 +1606,7 @@ tr.search:nth-child(odd) { height: 600px; } -.75pc-width { +.threeqtr-width { display:block; width: 75%; } diff --git a/html/csv.php b/html/csv.php new file mode 100644 index 000000000..1f9dee0ca --- /dev/null +++ b/html/csv.php @@ -0,0 +1,52 @@ + + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. Please see LICENSE.txt at the top level of + * the source code distribution for details. + */ + +if (strpos($_SERVER['PATH_INFO'], "debug")) +{ + $debug = "1"; + ini_set('display_errors', 1); + ini_set('display_startup_errors', 1); + ini_set('log_errors', 1); + ini_set('error_reporting', E_ALL); +} else { + $debug = FALSE; + ini_set('display_errors', 0); + ini_set('display_startup_errors', 0); + ini_set('log_errors', 0); + ini_set('error_reporting', 0); +} + +include "../includes/defaults.inc.php"; +include "../config.php"; +include_once "../includes/definitions.inc.php"; +include "../includes/functions.php"; +include "includes/functions.inc.php"; +include "includes/vars.inc.php"; +include "includes/authenticate.inc.php"; + +$report = mres($vars['report']); +if( !empty($report) && file_exists("includes/reports/$report.csv.inc.php")) { + if( $debug == false ) { + header("Content-Type: text/csv"); + header('Content-Disposition: attachment; filename="'.$report.'-'.date('Ymd').'.csv"'); + } + $csv = array(); + include_once "includes/reports/$report.csv.inc.php"; + foreach( $csv as $line ) { + echo implode(',',$line)."\n"; + } +} else { + echo "Report not found.\n"; +} +?> diff --git a/html/images/os/datacom.png b/html/images/os/datacom.png new file mode 100644 index 000000000..e4108d8aa Binary files /dev/null and b/html/images/os/datacom.png differ diff --git a/html/includes/functions.inc.php b/html/includes/functions.inc.php index b11033b78..48295cd3e 100644 --- a/html/includes/functions.inc.php +++ b/html/includes/functions.inc.php @@ -122,7 +122,7 @@ function generate_device_url($device, $vars=array()) return generate_url(array('page' => 'device', 'device' => $device['device_id']), $vars); } -function generate_device_link($device, $text=NULL, $vars=array(), $start=0, $end=0, $escape_text=1) +function generate_device_link($device, $text=NULL, $vars=array(), $start=0, $end=0, $escape_text=1, $overlib=1) { global $config; @@ -168,7 +168,11 @@ function generate_device_link($device, $text=NULL, $vars=array(), $start=0, $end } if ($escape_text) { $text = htmlentities($text); } - $link = overlib_link($url, $text, escape_quotes($contents), $class); + if ($overlib == 0) { + $link = $contents; + } else { + $link = overlib_link($url, $text, escape_quotes($contents), $class); + } if (device_permitted($device['device_id'])) { @@ -404,7 +408,7 @@ function generate_entity_link($type, $entity, $text = NULL, $graph_type=NULL) } -function generate_port_link($port, $text = NULL, $type = NULL) +function generate_port_link($port, $text = NULL, $type = NULL, $overlib = 1, $single_graph = 0) { global $config; @@ -429,17 +433,21 @@ function generate_port_link($port, $text = NULL, $type = NULL) $graph_array['from'] = $config['time']['day']; $graph_array['id'] = $port['port_id']; $content .= generate_graph_tag($graph_array); - $graph_array['from'] = $config['time']['week']; - $content .= generate_graph_tag($graph_array); - $graph_array['from'] = $config['time']['month']; - $content .= generate_graph_tag($graph_array); - $graph_array['from'] = $config['time']['year']; - $content .= generate_graph_tag($graph_array); + if ($single_graph == 0) { + $graph_array['from'] = $config['time']['week']; + $content .= generate_graph_tag($graph_array); + $graph_array['from'] = $config['time']['month']; + $content .= generate_graph_tag($graph_array); + $graph_array['from'] = $config['time']['year']; + $content .= generate_graph_tag($graph_array); + } $content .= ""; $url = generate_port_url($port); - if (port_permitted($port['port_id'], $port['device_id'])) { + if ($overlib == 0) { + return $content; + } elseif (port_permitted($port['port_id'], $port['device_id'])) { return overlib_link($url, $text, $content, $class); } else { return fixifName($text); @@ -744,4 +752,12 @@ function shorten_interface_type($string) { ); } +function clean_bootgrid($string) { + + $output = str_replace(array("\r","\n"), "", $string); + $output = addslashes($output); + return $output; + +} + ?> diff --git a/html/includes/graphs/device/ucd_cpu.inc.php b/html/includes/graphs/device/ucd_cpu.inc.php index 49af3fba0..3068bba69 100644 --- a/html/includes/graphs/device/ucd_cpu.inc.php +++ b/html/includes/graphs/device/ucd_cpu.inc.php @@ -25,7 +25,7 @@ $rrd_options .= " AREA:system_perc#ea8f00:system:STACK"; $rrd_options .= " GPRINT:system_perc:LAST:' %5.2lf%%'"; $rrd_options .= " GPRINT:system_perc:AVERAGE:' %5.2lf%%'"; $rrd_options .= " GPRINT:system_perc:MAX:' %5.2lf%%\\n'"; -$rrd_options .= " AREA:idle_perc#f5f5e5:idle:STACK"; +$rrd_options .= " AREA:idle_perc#f8f8f3:idle:STACK"; $rrd_options .= " GPRINT:idle_perc:LAST:' %5.2lf%%'"; $rrd_options .= " GPRINT:idle_perc:AVERAGE:' %5.2lf%%'"; $rrd_options .= " GPRINT:idle_perc:MAX:' %5.2lf%%\\n'"; diff --git a/html/includes/graphs/generic_data.inc.php b/html/includes/graphs/generic_data.inc.php index 861868ab1..63cc15ceb 100644 --- a/html/includes/graphs/generic_data.inc.php +++ b/html/includes/graphs/generic_data.inc.php @@ -93,16 +93,18 @@ if($format == "octets" || $format == "bytes") $rrd_options .= " COMMENT:'bps Now Ave Max 95th %\\n'"; -$rrd_options .= " AREA:in".$format."_max#aDEB7B:"; -$rrd_options .= " AREA:in".$format."#91B13C:'In '"; +$rrd_options .= " AREA:in".$format."_max#D7FFC7:"; +$rrd_options .= " AREA:in".$format."#90B040:'In '"; +$rrd_options .= " LINE:in".$format."#608720:'In '"; #$rrd_options .= " LINE1.25:in".$format."#006600:'In '"; $rrd_options .= " GPRINT:in".$format.":LAST:%6.2lf%s"; $rrd_options .= " GPRINT:in".$format.":AVERAGE:%6.2lf%s"; $rrd_options .= " GPRINT:in".$format."_max:MAX:%6.2lf%s"; $rrd_options .= " GPRINT:95thin:%6.2lf%s\\\\n"; -$rrd_options .= " AREA:dout".$format."_max#a3b9FF:"; -$rrd_options .= " AREA:dout".$format."#8080BD:'Out'"; +$rrd_options .= " AREA:dout".$format."_max#E0E0FF:"; +$rrd_options .= " AREA:dout".$format."#8080C0:"; +$rrd_options .= " LINE:dout".$format."#606090:'Out'"; #$rrd_options .= " LINE1.25:dout".$format."#000099:Out"; $rrd_options .= " GPRINT:out".$format.":LAST:%6.2lf%s"; $rrd_options .= " GPRINT:out".$format.":AVERAGE:%6.2lf%s"; diff --git a/html/includes/print-debug.php b/html/includes/print-debug.php index 5c23a3536..f35cd05bf 100644 --- a/html/includes/print-debug.php +++ b/html/includes/print-debug.php @@ -47,7 +47,7 @@ foreach ($sql_debug as $sql_error) {