Generated rrd file after adding a new deivce is owned by root

From some time to now when i add a new device to librenms the generated rrd file to store its graphs is owned by root instead of librenms user.

I have to manually change the ownership of the rrd file to librenms to start graphing. What am i doing wrong? Any advice?

====================================

Component Version
LibreNMS 1.64.1-39-gdb38c27
DB Schema 2020_05_24_212054_poller_cluster_settings (166)
PHP 7.2.27
Python 3.6.8
MySQL 5.5.65-MariaDB
RRDTool 1.4.8
SNMP NET-SNMP 5.7.2

====================================

[OK] Composer Version: 1.10.7
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct
[WARN] Your local git contains modified files, this could prevent automatic updates.
[FIX]:
You can fix this with ./scripts/github-remove
Modified Files:
bootstrap/cache/.gitignore
logs/.gitignore
rrd/.gitignore
storage/app/.gitignore
storage/app/public/.gitignore
storage/framework/sessions/.gitignore
storage/framework/testing/.gitignore
storage/framework/views/.gitignore
storage/logs/.gitignore
[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]:
sudo chown -R librenms:librenms /opt/librenms
sudo setfacl -d -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
sudo chmod -R ug=rwX /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
Files:
/opt/librenms/rrd/new_device

The /opt/librenms folder is owned by librenms:

drwxr-xr-x 31 librenms librenms 4096 Jun 12 12:55 librenms

And all previously generated rrd files inside and the rrd folder also are owned by librenms user

drwxrwxr-x+ 1459 librenms librenms 126976 Jun 12 12:40 rrd

Hi,

How are you adding the device?

From the top menu

Devices -> + Add Device

Sorry, newly created by the rrd are owned by nginx:apache instead of librenms:librenms

drwxrwxr-x+ 2 librenms librenms 12288 Jul 10 10:00 ssw00010003.xxx
drwxrwxr-x+ 2 librenms librenms 4096 Jul 10 11:55 swc00010002.xxx
drwxrwxr-x+ 2 nginx apache 4096 Jul 12 04:02 sro00010006.xxx

@rokkhan you wouldn’t happen to be going into the Capture screen and be clicking poll would you?

do you mean to debug the poller output?

LibreNMS Poller

Version info:
Commit SHA: 0e96589879b791fe3b02f161ffce52485a8cadd5
Commit Date: 1594817109
DB Schema: 2020_06_23_00522_alter_availability_perc_column (170)
PHP: 7.2.27
MySQL: 5.5.65-MariaDB
RRDTool: 1.4.8
SNMP: NET-SNMP 5.7.2
==================================DEBUG!

Warning: file_put_contents(/opt/librenms/cache/os_defs.cache): failed to open stream: Permission denied in /opt/librenms/LibreNMS/Util/OS.php on line 109
Starting polling run:

Hostname: ksw70000001.xxx.xxx
Device ID: 4438
OS: generic
Resolved IP: 10.49.151.1

Load poller module core

SNMP[‘/usr/bin/snmpget’ ‘-v2c’ ‘-c’ ‘COMMUNITY’ ‘-OQnUt’ ‘-m’ ‘SNMPv2-MIB’ ‘-M’ ‘/opt/librenms/mibs’ ‘udp:HOSTNAME:161’ ‘sysUpTime.0’ ‘sysContact.0’ ‘sysName.0’ ‘sysObjectID.0’ ‘sysDescr.0’]
SNMP[‘/usr/bin/snmpget’ ‘-v2c’ ‘-c’ ‘COMMUNITY’ ‘-OQnUst’ ‘-m’ ‘HOST-RESOURCES-MIB:SNMP-FRAMEWORK-MIB’ ‘-M’ ‘/opt/librenms/mibs’ ‘udp:HOSTNAME:161’ ‘snmpEngineTime.0’ ‘hrSystemUptime.0’]
Uptime: 12 days 2 hours 5 minutes 59 seconds

Runtime for poller module ‘core’: 0.0665 seconds with 25536 bytes
SNMP: [2/0.07s] MySQL: [0/0.00s]

Unload poller module core

Module [ unix-agent ] disabled globally.

Load poller module availability

Availability:
1 day : 100%
7 days : 100%
30 days : 100%
365 days : 100%

Runtime for poller module ‘availability’: 0.1221 seconds with 40152 bytes
SNMP: [0/0.00s] MySQL: [5/0.12s]

Unload poller module availability

Load poller module os

Generic :frowning:
SNMP[‘/usr/bin/snmpget’ ‘-v2c’ ‘-c’ ‘COMMUNITY’ ‘-Ovq’ ‘-m’ ‘SNMPv2-MIB’ ‘-M’ ‘/opt/librenms/mibs’ ‘udp:HOSTNAME:161’ ‘sysLocation.0’]
Location:
Hardware:
OS Version:
OS Features:
Serial:

Runtime for poller module ‘os’: 0.0350 seconds with 194336 bytes
SNMP: [1/0.03s] MySQL: [0/0.00s]

Unload poller module os

Module [ ipmi ] disabled globally.

Module [ sensors ] disabled globally.

Module [ processors ] disabled globally.

Module [ mempools ] disabled globally.

Module [ storage ] disabled globally.

Module [ netstats ] disabled globally.

Module [ hr-mib ] disabled globally.

Module [ ucd-mib ] disabled globally.

Module [ ipSystemStats ] disabled globally.

Module [ ports ] disabled globally.

Load poller module customoid

Runtime for poller module ‘customoid’: 0.0009 seconds with 824 bytes
SNMP: [0/0.00s] MySQL: [1/0.00s]

Unload poller module customoid

Module [ bgp-peers ] disabled globally.

Module [ junose-atm-vp ] disabled globally.

Module [ toner ] disabled globally.

Module [ ucd-diskio ] disabled globally.

Module [ wifi ] disabled globally.

Module [ wireless ] disabled globally.

Module [ ospf ] disabled globally.

Module [ cisco-ipsec-flow-monitor ] disabled globally.

Module [ cisco-remote-access-monitor ] disabled globally.

Module [ cisco-cef ] disabled globally.

Module [ cisco-sla ] disabled globally.

Module [ cisco-mac-accounting ] disabled globally.

Module [ cipsec-tunnels ] disabled globally.

Module [ cisco-ace-loadbalancer ] disabled globally.

Module [ cisco-ace-serverfarms ] disabled globally.

Module [ cisco-asa-firewall ] disabled globally.

Module [ cisco-voice ] disabled globally.

Module [ cisco-cbqos ] disabled globally.

Module [ cisco-otv ] disabled globally.

Module [ cisco-qfp ] disabled globally.

Module [ cisco-vpdn ] disabled globally.

Module [ nac ] disabled globally.

Module [ netscaler-vsvr ] disabled globally.

Module [ aruba-controller ] disabled globally.

Module [ entity-physical ] disabled globally.

Module [ entity-state ] disabled globally.

Module [ applications ] disabled globally.

Module [ mib ] disabled globally.

Module [ stp ] disabled globally.

Module [ ntp ] disabled globally.

Module [ loadbalancers ] disabled globally.

Module [ mef ] disabled globally.

Load poller module mpls

Runtime for poller module ‘mpls’: 0.0005 seconds with 28032 bytes
SNMP: [0/0.00s] MySQL: [0/0.00s]

Unload poller module mpls

Module [ services ] disabled globally.

Enabling graphs:

Polled in 2.337 seconds

Start Device Groups

End Device Groups, runtime: 0.023s

Start Alerts

End Alerts

SNMP [4/0.14s]: Get[4/0.14s] Getnext[0/0.00s] Walk[0/0.00s]
MySQL [12/0.16s]: Cell[1/0.00s] Row[-1/-0.00s] Rows[3/0.00s] Column[1/0.00s] Update[6/0.14s] Insert[2/0.01s] Delete[0/0.00s]

Yes, I mean when you do that it can cause issues.