Warning: Use of undefined constant data - assumed 'data'

I have a Linux NTP server which I would like to monitor, with Apps -> NTP Server. All graphs a re showing up empty with ‘-nan’ reported for values. Apparently the data comes back from the query but does not get inserted into the RRD file (see step 4). The rest of the graphs for this server look OK.

I have in this order

  1. deleted the device and re-added it
  2. git pull and ./daily.sh
  3. php validate.php then gives me

-bash-4.2$ php validate.php

Component Version
LibreNMS 1.60-48-g6a897b5
DB Schema 2020_02_10_223323_create_alert_location_map_table (159)
PHP 7.2.24
MySQL 5.5.64-MariaDB
RRDTool 1.4.8


[OK] Composer Version: 1.9.3
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct

  1. output from command (hostname obfuscated)

-bash-4.2$ ./poller.php -d -h time1-location.example.com -m applications 2>&1


Load poller module applications

SQL[ESC[1;33mSELECT * FROM applications WHERE device_id = ? ESC[0;33m[27]ESC[0m 0.5ms]

ntp-serverSNMP[ESC[0;36m’/usr/bin/snmpget’ ‘-v2c’ ‘-c’ ‘COMMUNITY’ ‘-Oqv’ ‘-m’ ‘NET-SNMP-EXTEND-MIB’ ‘-M’ ‘/opt/librenms/mibs:/opt/librenms/mibs/supermicro:/opt/librenms/mibs/dell’ ‘udp:HOSTNAME:161’ 'nsExtendOutputFull.’ESC[0m]
ntpd 4.2.6p5

Warning: Use of undefined constant data - assumed ‘data’ (this will throw an Error in a future version of PHP) in /opt/librenms/includes/polling/applications/ntp-server.inc.php on line 19
RRD[ESC[0;32mupdate /opt/librenms/rrd/time1-location.example.com/app-ntp-server-4.rrd N:U:U:U:U:U:U:U:U:U:U:U:U:U:UESC[0m]
SQL[ESC[1;33mUPDATE applications set app_state=?,app_status=?,timestamp=NOW() WHERE app_id = ? ESC[0;33m[“OK”,"",4]ESC[0m 7.03ms]

SQL[ESC[1;33mSELECT * FROM application_metrics WHERE app_id=? ESC[0;33m[4]ESC[0m 0.48ms]

: …

Runtime for poller module ‘applications’: 0.1100 seconds with 22328 bytes
SNMP: [1/0.10s] MySQL: [3/0.01s] RRD: [2/0.00s]

Unload poller module applications


I can locally modify the offending line 19 in the script /opt/librenms/includes/polling/applications/ntp-server.inc.php to read ‘data’ or $data to clear the error when running poller.php, but that leads to errors on next run of 'php validate.php complaining that local code is modified compared to the git repo.

I can make additional debug output available here.

Any advice how to proceed from here and make NTP Server monitoring work?

Try running manually the snmpget command

And check the output

The output of that command was already part of my original problem description submission, but here it is again. To me it looks the values are correctly retrieved from the NTP server, but when you look at the RRD line it inserts no values into the rrd file, possibly due to the fact that the data variable structure isn’t holding the data in between when they are retrieved and when they need to be handed to RRD.

-bash-4.2$ /usr/bin/snmpget -v2c -c REDACTED -Oqv -m NET-SNMP-EXTEND-MIB -M ‘/opt/librenms/mibs:/opt/librenms/mibs/supermicro:/opt/librenms/mibs/dell’ udp:time1-location.example.com:161 nsExtendOutputFull.

ntpd 4.2.6p5