deadbok/ansible-librenms

Fix "Error Drawing Graph"

deadbok opened this issue · 5 comments

The error in LibreNMS looks like this:

error_drawing_graph

With debugging the following is revealed:

librenms_graph_error

It seems to be missing its data file. There are 3 files containing *poller.* files in the root. It seems both Python files invoke poller.php to do the actual polling that should generate the data file.

More debugging, could not help myself:

librenms@srv-librenms:~$ ./poller.php
LibreNMS Poller
-h <device id> | <device hostname wildcard>  Poll single device
-h odd                                       Poll odd numbered devices  (same as -i 2 -n 0)
-h even                                      Poll even numbered devices (same as -i 2 -n 1)
-h all                                       Poll all devices

-i <instances> -n <number>                   Poll as instance <number> of <instances>
                                             Instances start at 0. 0-3 for -n 4

Debugging and testing options:
-r                                           Do not create or update RRDs
-f                                           Do not insert data into InfluxDB
-d                                           Enable debugging output
-v                                           Enable verbose debugging output
-m                                           Specify module(s) to be run

No polling type specified!
librenms@srv-librenms:~$ ./poller.php -h localhost
LibreNMS Poller
Starting polling run:

Hostname: localhost
Device ID: 1
OS: linux (unix)

SNMP Unreachable#### Start Alerts ####
#### End Alerts ####
SNMP: Get[2/12.14s] Walk [0/0.00s]
MySQL: Cell[1/0.00s] Row[0/-0.00s] Rows[5/0.00s] Column[2/0.00s] Update[0/0.00s] Insert[2/0.00s] Delete[0/0.00s]
librenms@srv-librenms:~$ ls rrd/localhost/ -la

SNMP Unreachable. So something SNMP related ;-)?

I agree

Current guess is that it relates to the community string or the version

Ran the command with verbose output and you are right, community is public:


./poller.php -h localhost -v
LibreNMS Poller
fatal: No names found, cannot describe anything.
===================================
Version info:
Commit SHA: e3ba04237970f34851637981f67ae6a9c194b712
Commit Date: 1510000753
DB Schema: 215
PHP: 7.0.19-1
MySQL: 10.1.26-MariaDB-0+deb9u1
RRDTool: 1.6.0
SNMP: NET-SNMP 5.7.3
==================================DEBUG!
Starting polling run:

SQL[SELECT * FROM `devices` WHERE `disabled` = 0 AND `hostname` = 'localhost' ORDER BY `device_id` ASC] 
SQL[SELECT * FROM devices_attribs WHERE `device_id` = '1'] 
Hostname: localhost
Device ID: 1
OS: linux (unix)

SQL[INSERT INTO `device_perf` (`xmt`,`rcv`,`loss`,`min`,`max`,`avg`,`device_id`,`timestamp`)  VALUES ('3','3','0','0.04','0.14','0.09','1',NOW())] 
Timeout: No Response from udp:localhost:161.
SNMP Check response code: 1
SNMP[/usr/bin/snmpget -v2c -c 'public' -Oqv -m SNMPv2-MIB -M /opt/librenms/mibs:/opt/librenms/mibs/supermicro:/opt/librenms/mibs/dell udp:localhost:161 sysObjectID.0]
Timeout: No Response from udp:localhost:161.

SNMP Unreachable#### Start Alerts ####
SQL[SELECT `device_group_id` FROM `device_group_device` WHERE `device_id`='1'] 
SQL[SELECT alert_schedule.schedule_id FROM alert_schedule LEFT JOIN alert_schedule_items ON alert_schedule.schedule_id=alert_schedule_items.schedule_id WHERE ( alert_schedule_items.target = '1' ) && ((alert_schedule.recurring = 0 AND (NOW() BETWEEN alert_schedule.start AND alert_schedule.end)) OR (alert_schedule.recurring = 1 AND (alert_schedule.start_recurring_dt <= date_format(NOW(), '--%d') AND (end_recurring_dt >= date_format(NOW(), '--%d') OR end_recurring_dt is NULL OR end_recurring_dt = '0000-00-00' OR end_recurring_dt = '')) AND (date_format(now(), '%H:%i:%s') BETWEEN `start_recurring_hr` AND end_recurring_hr) AND (recurring_day LIKE CONCAT('%',date_format(now(), ''),'%') OR recurring_day is null or recurring_day = ''))) LIMIT 1] 
SQL[SELECT `device_group_id` FROM `device_group_device` WHERE `device_id`='1'] 
SQL[SELECT alert_rules.* FROM alert_rules LEFT JOIN alert_map ON alert_rules.id=alert_map.rule WHERE alert_rules.disabled = 0 && ( (alert_rules.device_id = -1 || alert_rules.device_id = '1' ) || alert_map.target = '1'  )] 
#### End Alerts ####
SQL[INSERT INTO `perf_times` (`type`,`doing`,`start`,`duration`,`devices`,`poller`)  VALUES ('poll','localhost','1510003407.5007','12.73','1','srv-librenms')] 
./poller.php localhost 2017-11-06 22:23:40 - 1 devices polled in 12.73 secs
SNMP: Get[2/12.24s] Walk [0/0.00s]
MySQL: Cell[3/0.00s] Row[0/-0.00s] Rows[5/0.00s] Column[2/0.00s] Update[0/0.00s] Insert[2/0.04s] Delete[0/0.00s]

SNMP[/usr/bin/snmpget -v2c -c 'public' -Oqv -m SNMPv2-MIB -M /opt/librenms/mibs:/opt/librenms/mibs/supermicro:/opt/librenms/mibs/dell udp:localhost:161 sysObjectID.0]

It might have worked from the beginning except for issues related to localhost.

After working my way through the system, I discovered multiple issues (which I will create in a moment), but also added a secondary host for testing. That showed librenms to be functioning properly.

merge is coming soon.