Installing newrelic-sysmond on vanilla CoreOS stable (633.1.0)

While trying to install the agent to one of our servers running vanilla CoreOS stable (633.1.0), we’ve encountered some issues.

We tried following this document:
https://docs.newrelic.com/docs/servers/new-relic-servers-linux/installation-configuration/servers-installation-other-linux

In Copy program files we’ve encountered the following issue:

cp -f newrelic-sysmond-2.0.3.113-linux/daemon/nrsysmond.x64 /usr/local/sbin/nrsysmond
returns:
cp: cannot create regular file ‘/usr/local/sbin/nrsysmond’: Read-only file system

Seems that /usr/ is read-only by default (see here: https://coreos.com/blog/new-filesystem-btrfs-cloud-config/).

One solution would be to automate everything during installation of CoreOS by modifying the cloud-config file. In another thread we can read about users following this path, but all our attempts were not successful:

We’d love to get this working on CoreOS, and we will continue experimenting and updating this thread as we gain more insight on how to set everything up properly.

3 Likes

Hi @camillo

A read only locale in your operating system is not an issue provided that you have root or super user access, and are willing to change permissions. Please note, although root access is not required for the agent to run, root access is required to install the agent.

If a folder is not writable, then you can modify it’s permissions to allow writing or executing.

CoreOS is based on Gentoo, and in the past I have personally configured Gentoo to work with the Linux server monitor, however we do not test against this variant, and I do not have specific instructions for you in this matter.

The read-only-ness of the system is due to the filesystem being mounted readonly, not the specific folder permissions.

Another user of the beta was able to get it working on CoreOS by putting the agent into a different folder: https://discuss.newrelic.com/t/how-to-try-out-the-docker-beta/19478/3?u=ericbetts

1 Like

As an aside this goes against the design methodology of CoreOS, which is to say, run everything in a container, not on the operating system. I run NewRelic on CoreOS as a systemd service using a systemd-nspawn container.
The POC repo is here, if you want to see how I did it: https://github.com/mivtachyahu/coreos-newrelic

If anyone is using fleetctl for managing their CoreOS cluster, could I possibly trouble you to try the following service file and see if it works for you? Much appreciated! We do not have a coreos cluster readily available for testing and would appreciate the assistance from those that do.

[Unit]
Description=New Relic System Monitor (nrsysmond)
After=docker.service
Requires=docker.service

[Service]
TimeoutStartSec=10m
ExecStartPre=-/usr/bin/docker kill nrsysmond
ExecStartPre=-/usr/bin/docker rm nrsysmond
ExecStartPre=/usr/bin/docker pull newrelic/nrsysmond:latest
ExecStart=/usr/bin/docker run --name nrsysmond --rm \
  -v /proc:/proc -v /sys:/sys -v /dev:/dev --privileged=true --net=host \
  -e NRSYSMOND_license_key="REPLACE_WITH_YOUR_REAL_KEY" \
  -e NRSYSMOND_loglevel=info \
  -e NRSYSMOND_hostname=%H \ 
  newrelic/nrsysmond:latest
ExecStop=/usr/bin/docker stop -t 30 nrsysmond
    
[Install]
WantedBy=multi-user.target

[X-Fleet]
Global=true
1 Like

I was able to get this working by removing the quotes around the license key. I’m not sure if that was a copy-paste issue or something that simply won’t work, but it fixed it in any case.

I also removed the --rm flag for good measure since it causes ExecStop to fail.

Hey @brodkin , @matthew_brown , and @camillo ,

I just wanted to reach out and let you know that we’ve started to formalize our guidance around CoreOS (apologies for the delay!) Please let me know if you find this useful or if there is more we can do to help you out!

https://discuss.newrelic.com/t/using-server-monitoring-on-coreos/24852

Regards,

Adam

Thank you so much for the feedback @brodkin! I am surprised to hear that the quotes around the license key caused trouble but single it is a single string with no magic characters the quotes are of course optional. Just habit :slight_smile: Of course any argument that did have special characters or spaces would need to be quoted somehow, so I suspect that there was a copy/paste error. If you have time and inclination to do so, it would be cool to verify that.

Hi there, Did anyone figure out how to change the read only permission for CoreOs ? I am trying to install new relic agent on CoreOs instance, with admin level access, but still can’t seem to do cp scripts/nrsysmond-config /usr/local/bin

Your help is much appreciated :slight_smile: