diff --git a/alerts.php b/alerts.php index 9d6defca5..6d791d213 100755 --- a/alerts.php +++ b/alerts.php @@ -28,6 +28,8 @@ require_once 'includes/defaults.inc.php'; require_once 'config.php'; +$options = getopt('d::'); + $lock = false; if (file_exists($config['install_dir'].'/.alerts.lock')) { $pids = explode("\n", trim(`ps -e | grep php | awk '{print $1}'`)); @@ -48,6 +50,22 @@ require_once $config['install_dir'].'/includes/definitions.inc.php'; require_once $config['install_dir'].'/includes/functions.php'; require_once $config['install_dir'].'/includes/alerts.inc.php'; +if (isset($options['d'])) { + echo "DEBUG!\n"; + $debug = true; + ini_set('display_errors', 1); + ini_set('display_startup_errors', 1); + ini_set('log_errors', 1); + ini_set('error_reporting', 1); +} +else { + $debug = false; + // ini_set('display_errors', 0); + ini_set('display_startup_errors', 0); + ini_set('log_errors', 0); + // ini_set('error_reporting', 0); +} + if (!defined('TEST') && $config['alert']['disable'] != 'true') { echo 'Start: '.date('r')."\r\n"; echo "RunFollowUp():\r\n"; diff --git a/build.sql b/build.sql index 9f4526069..8a03c7e98 100644 --- a/build.sql +++ b/build.sql @@ -51,7 +51,6 @@ CREATE TABLE IF NOT EXISTS `users` ( `user_id` int(11) NOT NULL AUTO_INCREMENT, CREATE TABLE IF NOT EXISTS `users_prefs` ( `user_id` int(16) NOT NULL, `pref` varchar(32) NOT NULL, `value` varchar(128) NOT NULL, PRIMARY KEY (`user_id`), UNIQUE KEY `user_id.pref` (`user_id`,`pref`), KEY `pref` (`pref`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `vlans` ( `vlan_id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) DEFAULT NULL, `vlan_vlan` int(11) DEFAULT NULL, `vlan_domain` text, `vlan_descr` text, PRIMARY KEY (`vlan_id`), KEY `device_id` (`device_id`,`vlan_vlan`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `vminfo` ( `id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `vm_type` varchar(16) NOT NULL DEFAULT 'vmware', `vmwVmVMID` int(11) NOT NULL, `vmwVmDisplayName` varchar(128) NOT NULL, `vmwVmGuestOS` varchar(128) NOT NULL, `vmwVmMemSize` int(11) NOT NULL, `vmwVmCpus` int(11) NOT NULL, `vmwVmState` varchar(128) NOT NULL, PRIMARY KEY (`id`), KEY `device_id` (`device_id`), KEY `vmwVmVMID` (`vmwVmVMID`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `vmware_vminfo` ( `id` int(11) NOT NULL AUTO_INCREMENT, `device_id` int(11) NOT NULL, `vmwVmVMID` int(11) NOT NULL, `vmwVmDisplayName` varchar(128) NOT NULL, `vmwVmGuestOS` varchar(128) NOT NULL, `vmwVmMemSize` int(11) NOT NULL, `vmwVmCpus` int(11) NOT NULL, `vmwVmState` varchar(128) NOT NULL, PRIMARY KEY (`id`), KEY `device_id` (`device_id`), KEY `vmwVmVMID` (`vmwVmVMID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `vrfs` ( `vrf_id` int(11) NOT NULL AUTO_INCREMENT, `vrf_oid` varchar(256) NOT NULL, `vrf_name` varchar(128) DEFAULT NULL, `mplsVpnVrfRouteDistinguisher` varchar(128) DEFAULT NULL, `mplsVpnVrfDescription` text NOT NULL, `device_id` int(11) NOT NULL, PRIMARY KEY (`vrf_id`), KEY `device_id` (`device_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `bill_history` ( `bill_hist_id` int(11) NOT NULL AUTO_INCREMENT, `bill_id` int(11) NOT NULL, `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `bill_datefrom` datetime NOT NULL, `bill_dateto` datetime NOT NULL, `bill_type` text NOT NULL, `bill_allowed` bigint(20) NOT NULL, `bill_used` bigint(20) NOT NULL, `bill_overuse` bigint(20) NOT NULL, `bill_percent` decimal(10,2) NOT NULL, `rate_95th_in` bigint(20) NOT NULL, `rate_95th_out` bigint(20) NOT NULL, `rate_95th` bigint(20) NOT NULL, `dir_95th` varchar(3) NOT NULL, `rate_average` bigint(20) NOT NULL, `rate_average_in` bigint(20) NOT NULL, `rate_average_out` bigint(20) NOT NULL, `traf_in` bigint(20) NOT NULL, `traf_out` bigint(20) NOT NULL, `traf_total` bigint(20) NOT NULL, `pdf` longblob, PRIMARY KEY (`bill_hist_id`), UNIQUE KEY `unique_index` (`bill_id`,`bill_datefrom`,`bill_dateto`), KEY `bill_id` (`bill_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ; CREATE TABLE IF NOT EXISTS `entPhysical_state` ( `device_id` int(11) NOT NULL, `entPhysicalIndex` varchar(64) NOT NULL, `subindex` varchar(64) DEFAULT NULL, `group` varchar(64) NOT NULL, `key` varchar(64) NOT NULL, `value` varchar(255) NOT NULL, KEY `device_id_index` (`device_id`,`entPhysicalIndex`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/daily.sh b/daily.sh index 795311e90..17591fa8f 100755 --- a/daily.sh +++ b/daily.sh @@ -42,7 +42,7 @@ if [ -z "$arg" ]; then fi cnf=$(echo $(grep '\[.distributed_poller.\]' config.php | egrep -v -e '^//' -e '^#' | cut -d = -f 2 | sed 's/;//g')) - cnd=${cnf,,} + cnf=${cnf,,} if [ -z "$cnf" ] || [ "$cnf" == "0" ] || [ "$cnf" == "false" ]; then # Call ourself again in case above pull changed or added something to daily.sh $0 post-pull diff --git a/discovery.php b/discovery.php index 5dc6ff8de..289e92109 100755 --- a/discovery.php +++ b/discovery.php @@ -23,7 +23,7 @@ require 'includes/discovery/functions.inc.php'; $start = microtime(true); $runtime_stats = array(); $sqlparams = array(); -$options = getopt('h:m:i:n:d::a::q',array('os:','type:')); +$options = getopt('h:m:i:n:d::v::a::q',array('os:','type:')); if (!isset($options['q'])) { echo $config['project_name_version']." Discovery\n"; @@ -82,8 +82,11 @@ if (isset($options['i']) && $options['i'] && isset($options['n'])) { $doing = $options['n'].'/'.$options['i']; } -if (isset($options['d'])) { +if (isset($options['d']) || isset($options['v'])) { echo "DEBUG!\n"; + if (isset($options['v'])) { + $vdebug = true; + } $debug = true; ini_set('display_errors', 1); ini_set('display_startup_errors', 1); @@ -111,6 +114,7 @@ if (!$where) { echo "\n"; echo "Debugging and testing options:\n"; echo "-d Enable debugging output\n"; + echo "-v Enable verbose debugging output\n"; echo "-m Specify single module to be run\n"; echo "\n"; echo "Invalid arguments!\n"; diff --git a/doc/General/Changelog.md b/doc/General/Changelog.md index b206a59fd..67d4e2bf0 100644 --- a/doc/General/Changelog.md +++ b/doc/General/Changelog.md @@ -3,16 +3,58 @@ #### Bug fixes - Discovery / Polling: - Ignore HC Broadcast and Multicast counters for Cisco SB (PR2552) + - Fix Cisco temperature discovery (PR2765) + - WebUI: + - Fix ajax_search.php returning null instead of [] (PR2695) + - Fix notification links (PR2721) + - Fix wrong suggestion to install PEAR in Web installer (PR2727) + - Fixed mysqli support for Web installer (PR2730) + - Misc: + - Fix deleting device_perf entries (PR2755) + - Fix for schema updates to device table when poller is running (PR2825) #### Improvements - WebUI: - Converted arp pages to use bootgrid (PR2669) - Updated VMWare listing page (PR2684) + - Updated typeahead.js (PR2698) + - Added ability to set notes for ports (PR2688) + - Use browser width to scale CPU and Bandwidth graphs (PR2537, PR2633) + - Removed onClick from ports list (PR2744) + - Added support for showing sysName when hostname is IP (PR2796) + - Updated rancid support for different hostnames (PR2807) + - Added combined HTTP Auth and LDAP Auth authentication module (PR2835) + - Added ability to filter alerts using widgets (PR2834) + - Discovery / Polling: + - Print runtime info per poller/discovery modules (PR2713) + - Improved polling/discovery vmware module performance (PR2696) + - Added STP/RSTP support (PR2690) + - Moved system poller module to core module (PR2637) + - Added lookup of IP for devices with hostname (PR2798) + - Centralised sensors module file structure (PR2794) + - Graph poller module run times (PR2849) + - Updated vlan support using IEEE8021-Q-BRIDGE-MIB (PR2851) - Added detection for: - Added support for Samsung printers (PR2680) - Added support for Canon printers (PR2687) + - Added support for Sub10 support (PR2469) + - Added support for Zyxel GS range (PR2729) + - Added support for HWGroup Poseidon (PR2742) + - Added support for Samsung SCX printers (PR2760) + - Added additional support for HP MSM (PR2766, PR2768) + - Added additional support for Cisco ASA and RouterOS (PR2784) + - Added support for Lenovo EMC Nas (PR2795) + - Added support for Infoblox (PR2801) + - API: + - Added support for Oxidized groups (PR2745) - Misc: - Added option to specify Smokeping ping value (PR2676) + - Added backend support for InfluxDB (PR2208) + - Alpha2 release of MIB Polling released (PR2536, PR2763) + - Centralised version info (PR2697) + - Added username support for libvirt over SSH (PR2728) + - Added Oxidized reload call when adding device (PR2792) + - Added components system to centralize data in MySQL (PR2623) ### December 2015 diff --git a/doc/Installation/Installation-(Debian-Ubuntu).md b/doc/Installation/Installation-(Debian-Ubuntu).md index bda460578..e07ac9bd2 100644 --- a/doc/Installation/Installation-(Debian-Ubuntu).md +++ b/doc/Installation/Installation-(Debian-Ubuntu).md @@ -107,7 +107,6 @@ First, create and chown the `rrd` directory and create the `logs` directory: mkdir rrd logs chown -R librenms:librenms /opt/librenms - chown www-data:www-data logs chmod 775 rrd > NOTE: If you're not running Ubuntu or Debian, you will need to change `www-data` to the user and group which run the Apache web server. diff --git a/doc/Installation/Installation-(RHEL-CentOS).md b/doc/Installation/Installation-(RHEL-CentOS).md index 366bfd61f..b899aa242 100644 --- a/doc/Installation/Installation-(RHEL-CentOS).md +++ b/doc/Installation/Installation-(RHEL-CentOS).md @@ -265,12 +265,6 @@ First, create and chown the `rrd` directory and create the `logs` directory mkdir rrd logs chown -R librenms:librenms /opt/librenms chmod 775 rrd - - # For HTTPd (Apache): - chown apache:apache logs - - # For Nginx: - chown nginx:nginx logs ``` > If you're planing on running rrdcached, make sure that the path is also chmod'ed to 775 and chown'ed to librenms:librenms. diff --git a/doc/Installation/Installation-Lighttpd-(Debian-Ubuntu).md b/doc/Installation/Installation-Lighttpd-(Debian-Ubuntu).md index b1150b05f..ed4889813 100644 --- a/doc/Installation/Installation-Lighttpd-(Debian-Ubuntu).md +++ b/doc/Installation/Installation-Lighttpd-(Debian-Ubuntu).md @@ -108,7 +108,6 @@ First, create and chown the `rrd` directory and create the `logs` directory mkdir rrd logs chown -R librenms:librenms /opt/librenms - chown www-data:www-data logs chmod 775 rrd > NOTE: If you're planing on running rrdcached, make sure that the path is also chmod'ed to 775 and chown'ed to librenms:librenms. diff --git a/html/images/os/lexmark.png b/html/images/os/lexmark.png new file mode 100644 index 000000000..d1614ee0f Binary files /dev/null and b/html/images/os/lexmark.png differ diff --git a/html/includes/authentication/active_directory.inc.php b/html/includes/authentication/active_directory.inc.php index 9df49bacc..d936b44c8 100644 --- a/html/includes/authentication/active_directory.inc.php +++ b/html/includes/authentication/active_directory.inc.php @@ -18,9 +18,9 @@ ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); function authenticate($username, $password) { global $config, $ds; - if ($username && $ds) { + if ($ds) { // bind with sAMAccountName instead of full LDAP DN - if (ldap_bind($ds, "{$username}@{$config['auth_ad_domain']}", $password)) { + if ($username && ldap_bind($ds, "{$username}@{$config['auth_ad_domain']}", $password)) { // group membership in one of the configured groups is required if (isset($config['auth_ad_require_groupmembership']) && $config['auth_ad_require_groupmembership'] > 0) { diff --git a/html/includes/device-header.inc.php b/html/includes/device-header.inc.php index 456646f8d..a3a2f11c2 100644 --- a/html/includes/device-header.inc.php +++ b/html/includes/device-header.inc.php @@ -21,11 +21,20 @@ if ($device['disabled'] == '1') { $type = strtolower($device['os']); $image = getImage($device); +$host_id = dbFetchCell("SELECT `device_id` FROM `vminfo` WHERE `vmwVmDisplayName` = ? OR `vmwVmDisplayName` = ?", array($device['hostname'],$device['hostname'].'.'.$config['mydomain'])); echo '