Poller doesn't run automatically

Hi,

in the past I downloaded the virtual machine template of Librenms and tried some testing with it. Everything worked okay and a few days ago I decided to give the manual installation a try but I can’t seem to:
a) generate any graphs
b) poll automatically since I constantly get the yellow alert box that some devices (which turned out to be all of them) haven’t polled in 15 minutes.

I have added the same devices to the template as well as to the manual installation. I have used the same credentials and snmp version etc. I think that these problems are related but I’m not sure. Note: the polling of the devices works under 300 seconds when I run the poller on all the devices (about 30).

Also, maybe worth noting is that I get randomly too many SQL connections error

Run ./validate.php and post the results please.

./validate.php
==========================================================
Component | Version
--------- | -------
LibreNMS  | 5a46e9e34ae7e4a4532f9d6ed6824ae1a5d60e77
DB Schema | 185
PHP       | 5.5.9-1ubuntu4.21
MySQL     | 10.0.30-MariaDB-1~trusty
RRDTool   | 1.4.7
SNMP      | NET-SNMP 5.7.2
==========================================================

[WARN]  Your install is out of date, last update: Tue, 18 Apr 2017 06:15:34 +0000
[FAIL]  We have found some files that are owned by a different user than librenms, this will stop you updating automatically and / or rrd files being updated causing graphs to fail.
        [FIX] chown -R librenms:librenms /home/app/librenms
	 /home/app/librenms/rrd/localhost
	 /home/app/librenms/rrd/localhost/ping-perf.rrd
	 /home/app/librenms/rrd/localhost/hr_processes.rrd
	 /home/app/librenms/rrd/localhost/poller-perf-netstats.rrd
	 /home/app/librenms/rrd/localhost/poller-perf-ucd-diskio.rrd
	 /home/app/librenms/rrd/localhost/uptime.rrd
	 /home/app/librenms/rrd/localhost/poller-perf-hr-mib.rrd
	 /home/app/librenms/rrd/localhost/poller-perf-ntp.rrd
	 /home/app/librenms/rrd/localhost/poller-perf-processors.rrd
	 /home/app/librenms/rrd/localhost/hr_users.rrd
	  and 107 more...
[OK]    Database connection successful
[FAIL]  Database: missing table (bgpPeers)
[FAIL]  Database: missing table (bgpPeers_cbgp)
[FAIL]  Database: missing table (ciscoASA)
[FAIL]  Database: missing table (dbSchema)
[FAIL]  Database: missing table (entPhysical)
[FAIL]  Database: missing table (entPhysical_state)
[FAIL]  Database: missing table (hrDevice)
[FAIL]  Database: missing table (juniAtmVp)
[FAIL]  Database: extra table (bgppeers)
[FAIL]  Database: extra table (bgppeers_cbgp)
[FAIL]  Database: extra table (ciscoasa)
[FAIL]  Database: extra table (dbschema)
[FAIL]  Database: extra table (entphysical)
[FAIL]  Database: extra table (entphysical_state)
[FAIL]  Database: extra table (hrdevice)
[FAIL]  Database: extra table (juniatmvp)
[FAIL]  We have detected that your database schema may be wrong, please report the following to us on IRC or the community site (https://t.libren.ms/5gscd):
	 CREATE TABLE `bgpPeers` (`astext` varchar(64) NOT NULL, `bgpLocalAddr` text NOT NULL, `bgpPeerAdminStatus` text NOT NULL, `bgpPeerFsmEstablishedTime` int(11) NOT NULL, `bgpPeerIdentifier` text NOT NULL, `bgpPeerInTotalMessages` int(11) NOT NULL, `bgpPeerInUpdateElapsedTime` int(11) NOT NULL, `bgpPeerInUpdates` int(11) NOT NULL, `bgpPeerOutTotalMessages` int(11) NOT NULL, `bgpPeerOutUpdates` int(11) NOT NULL, `bgpPeerRemoteAddr` text NOT NULL, `bgpPeerRemoteAs` bigint(20) NOT NULL, `bgpPeerState` text NOT NULL, `bgpPeer_id` int(11) NOT NULL  auto_increment, `context_name` varchar(128) NULL, `device_id` int(11) NOT NULL, PRIMARY KEY (`bgpPeer_id`), INDEX `device_id` (`device_id`));
	 CREATE TABLE `bgpPeers_cbgp` (`AcceptedPrefixes` int(11) NOT NULL, `AcceptedPrefixes_delta` int(11) NOT NULL, `AcceptedPrefixes_prev` int(11) NOT NULL, `AdvertisedPrefixes` int(11) NOT NULL, `AdvertisedPrefixes_delta` int(11) NOT NULL, `AdvertisedPrefixes_prev` int(11) NOT NULL, `afi` varchar(16) NOT NULL, `bgpPeerIdentifier` varchar(64) NOT NULL, `context_name` varchar(128) NULL, `DeniedPrefixes` int(11) NOT NULL, `DeniedPrefixes_delta` int(11) NOT NULL, `DeniedPrefixes_prev` int(11) NOT NULL, `device_id` int(11) NOT NULL, `PrefixAdminLimit` int(11) NOT NULL, `PrefixClearThreshold` int(11) NOT NULL, `PrefixThreshold` int(11) NOT NULL, `safi` varchar(16) NOT NULL, `SuppressedPrefixes` int(11) NOT NULL, `SuppressedPrefixes_delta` int(11) NOT NULL, `SuppressedPrefixes_prev` int(11) NOT NULL, `WithdrawnPrefixes` int(11) NOT NULL, `WithdrawnPrefixes_delta` int(11) NOT NULL, `WithdrawnPrefixes_prev` int(11) NOT NULL, UNIQUE `unique_index` (`device_id`,`bgpPeerIdentifier`,`afi`,`safi`), INDEX `device_id` (`device_id`,`bgpPeerIdentifier`));
	 CREATE TABLE `ciscoASA` (`ciscoASA_id` int(11) NOT NULL  auto_increment, `data` bigint(20) NOT NULL, `device_id` int(11) NOT NULL, `disabled` tinyint(4) NOT NULL DEFAULT '0', `high_alert` bigint(20) NOT NULL, `low_alert` bigint(20) NOT NULL, `oid` varchar(255) NOT NULL, PRIMARY KEY (`ciscoASA_id`), INDEX `device_id` (`device_id`));
	 CREATE TABLE `dbSchema` (`version` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`version`));
	 CREATE TABLE `entPhysical` (`device_id` int(11) NOT NULL, `entPhysicalAlias` varchar(32) NULL, `entPhysicalAssetID` varchar(32) NULL, `entPhysicalClass` text NOT NULL, `entPhysicalContainedIn` int(11) NOT NULL, `entPhysicalDescr` text NOT NULL, `entPhysicalFirmwareRev` varchar(64) NULL, `entPhysicalHardwareRev` varchar(64) NULL, `entPhysicalIndex` int(11) NOT NULL, `entPhysicalIsFRU` varchar(8) NULL, `entPhysicalMfgName` text NOT NULL, `entPhysicalModelName` text NOT NULL, `entPhysicalName` text NOT NULL, `entPhysicalParentRelPos` int(11) NOT NULL, `entPhysicalSerialNum` text NOT NULL, `entPhysicalSoftwareRev` varchar(64) NULL, `entPhysicalVendorType` text NULL, `entPhysical_id` int(11) NOT NULL  auto_increment, `ifIndex` int(11) NULL, PRIMARY KEY (`entPhysical_id`), INDEX `device_id` (`device_id`));
	 CREATE TABLE `entPhysical_state` (`device_id` int(11) NOT NULL, `entPhysicalIndex` varchar(64) NOT NULL, `group` varchar(64) NOT NULL, `key` varchar(64) NOT NULL, `subindex` varchar(64) NULL, `value` varchar(255) NOT NULL, INDEX `device_id_index` (`device_id`,`entPhysicalIndex`));
	 CREATE TABLE `hrDevice` (`device_id` int(11) NOT NULL, `hrDeviceDescr` text NOT NULL, `hrDeviceErrors` int(11) NOT NULL DEFAULT '0', `hrDeviceIndex` int(11) NOT NULL, `hrDeviceStatus` text NOT NULL, `hrDeviceType` text NOT NULL, `hrDevice_id` int(11) NOT NULL  auto_increment, `hrProcessorLoad` tinyint(4) NULL, PRIMARY KEY (`hrDevice_id`), INDEX `device_id` (`device_id`));
	 CREATE TABLE `juniAtmVp` (`juniAtmVp_id` int(11) NOT NULL, `port_id` int(11) NOT NULL, `vp_descr` varchar(32) NOT NULL, `vp_id` int(11) NOT NULL, INDEX `port_id` (`port_id`));
	 DROP TABLE `bgppeers`;
	 DROP TABLE `bgppeers_cbgp`;
	 DROP TABLE `ciscoasa`;
	 DROP TABLE `dbschema`;
	 DROP TABLE `entphysical`;
	 DROP TABLE `entphysical_state`;
	 DROP TABLE `hrdevice`;
	 DROP TABLE `juniatmvp`;
[FAIL]  You have no timezone set for php. [FIX] http://php.net/manual/en/datetime.configuration.php#ini.date.timezone
[WARN]  Some devices have not been polled in the last 5 minutes.
        You may have performance issues. Check your poll log and see: http://docs.librenms.org/Support/Performance/
	 192.168.xxx.yy
	 192.168.xxx.yy
	 192.168.xxx.yy
	 192.168.xxx.yy
	  and 5 more...
[WARN]  Your local git contains modified files, this could prevent automatic updates.
Modified files:
	 html/.htaccess

The .htaccess is used for a rewrite to ip/librenms and there is a symbolic link between /home/app and /opt

First of all, fix your permissions.
Secondly, not sure how your tables got that way, but you need to fix the names by running:

RENAME TABLE `bgppeers` TO `bgpPeers`;

For example.

Then run ./validate.php again.

It seems there is something wrong with case (in)sensitive:
MariaDB [librenms]> RENAME TABLE bgppeers TO bgpPeers;
ERROR 1050 (42S01): Table ‘bgppeers’ already exists

Hmm, looks like the fix would be to rename it twice then.

RENAME TABLE `bgppeers` TO `_bgppeers`;
RENAME TABLE `_bgppeers` TO `bgpPeers`;

Tried that already, it seems that the mysql database just places everything in lower cases:
MariaDB [librenms]> RENAME TABLE bgppeers TO _bgppeers;
Query OK, 0 rows affected (0.13 sec)

MariaDB [librenms]> RENAME TABLE `_bgppeers` TO `bgpPeers`;
Query OK, 0 rows affected (0.01 sec)

MariaDB [librenms]> show tables ;
+--------------------------+
| Tables_in_librenms       |
+--------------------------+
| access_points            |
| alert_log                |
| alert_map                |
| alert_rules              |
| alert_schedule           |
| alert_schedule_items     |
| alert_template_map       |
| alert_templates          |
| alerts                   |
| api_tokens               |
| applications             |
| authlog                  |
| bgppeers                 |
| bgppeers_cbgp            |
| bill_data                |
| bill_history             |
| bill_perms               |
| bill_port_counters       |
| bill_ports               |
| bills                    |
| callback                 |
| cef_switching            |
| ciscoasa                 |
| component                |
| component_prefs          |
| component_statuslog      |
| config                   |
| customers                |
| dashboards               |
| dbschema                 |
| device_graphs            |
| device_group_device      |
| device_groups            |
| device_mibs              |
| device_oids              |
| device_perf              |
| devices                  |
| devices_attribs          |
| devices_perms            |
| entphysical              |
| entphysical_state        |
| eventlog                 |
| graph_types              |
| graph_types_dead         |
| hrdevice                 |
| ipsec_tunnels            |
| ipv4_addresses           |
| ipv4_mac                 |
| ipv4_networks            |
| ipv6_addresses           |
| ipv6_networks            |
| juniatmvp                |
| links                    |
| loadbalancer_rservers    |
| loadbalancer_vservers    |
| locations                |
| mac_accounting           |
| mefinfo                  |
| mempools                 |
| mibdefs                  |
| munin_plugins            |
| munin_plugins_ds         |
| netscaler_vservers       |
| notifications            |
| notifications_attribs    |
| ospf_areas               |
| ospf_instances           |
| ospf_nbrs                |
| ospf_ports               |
| packages                 |
| pdb_ix                   |
| pdb_ix_peers             |
| perf_times               |
| plugins                  |
| poller_groups            |
| pollers                  |
| port_association_mode    |
| ports                    |
| ports_adsl               |
| ports_perms              |
| ports_stack              |
| ports_statistics         |
| ports_stp                |
| ports_vlans              |
| processes                |
| processors               |
| proxmox                  |
| proxmox_ports            |
| pseudowires              |
| route                    |
| sensors                  |
| sensors_to_state_indexes |
| services                 |
| session                  |
| slas                     |
| state_indexes            |
| state_translations       |
| storage                  |
| stp                      |
| syslog                   |
| tnmsneinfo               |
| toner                    |
| ucd_diskio               |
| users                    |
| users_prefs              |
| users_widgets            |
| vlans                    |
| vminfo                   |
| vrf_lite_cisco           |
| vrfs                     |
| widgets                  |
+--------------------------+
111 rows in set (0.01 sec)

MariaDB [librenms]>

You must have lower_case_table_names set.

https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_lower_case_table_names

I’m not sure if/how that will affect LibreNMS.

I do indeed have that set, but as far as my knowledge of these things goes, that shouldn’t be an issue? Problem is that if I try to change it, I’m afaid it will break more than it will fix…

You will need to ignore the output of validate then, we could I guess add support for lowercase names.