Newrelic server monitoring on RancherOS

Hi guys,

Is there a way to monitor RancherOS host using newrelic? I saw some talks about it, and newrelic actually posted about CoreOS monitoring from a docker container ( Well… it doesn’t work very well. It only monitors the given resources and utilization of the container, and not from the host server, so I believe the same could happen with RancherOS if I use this ‘newrelic’ container.

Did you guys have any monitoring solution to the host server? Or, Is there a way to use newrelic directly from the top of the server? I really appreciate if it could be possible.

Thank you!


@fwynyk We have been doing some work for our new infrastructure with this since we use New Relic for our application currently.

The APM/Servers portion of New Relic integrates with Docker quite well. You need the New Relic Agent to be installed, configured, and running on the Docker Host (in this case, the RancherOS host). The details I’ve received when talking with New Relic is that they need the Agent to be installed on a supported Linux OS which does not include RancherOS at this time.

Sysdig appears to possibly get this done for you as this runs a container just for the sysdig agent and that monitors container and host. The application profiling doesn’t appear to be there right now though.

Hope this helped!

This is how I got newrelic working with Rancher:


  • path: /etc/rc.local
    permissions: "0755"
    owner: root
    content: |
    touch /var/log/nr_bootstrap.log
    echo “executing docker new relic bootstrap script” >> /var/log/nr_bootstrap.log
    echo “newrelic:x:83:1101:newrelic:/opt/newrelic:/sbin/nologin” >> /etc/passwd
    echo “newrelic:x:83:” >> /etc/group
    sed -i ‘s/docker:x:1101:rancher/docker:x:1101:rancher,newrelic/’ /etc/group
    mkdir -p /etc/newrelic
    mkdir -p /var/log/newrelic
    chown newrelic:newrelic /etc/newrelic/
    chown newrelic:newrelic /var/log/newrelic
    chmod 600 /etc/newrelic/
    echo “running docker aws-cli-docker:helper” >> /var/log/nr_bootstrap.log
    which docker >> /var/log/nr_bootstrap.log
    docker info >> /var/log/nr_bootstrap.log
    export result=$?
    echo “docker info result: ${result}” >> /var/log/nr_bootstrap.log
    while [ $result == 1 ]; do
    docker info >> /var/log/nr_bootstrap.log
    echo “docker info result: ${result}” >> /var/log/nr_bootstrap.log
    sleep 60
    docker pull redacted/aws-cli-docker:helper >> /var/log/nr_bootstrap.log 2>&1
    docker run -v $(pwd):/artifacts/ -i redacted/aws-cli-docker:helper --recursive s3 cp s3://redacted-devops/newrelic . >> /var/log/nr_bootstrap.log 2>&1
    echo “result $?” >> /var/log/nr_bootstrap.log
    echo $? >> /var/log/nr_bootstrap.log
    export HOSTNAME=cat /etc/hostname
    echo $HOSTNAME >> /var/log/nr_bootstrap.log
    cp nrsysmond.cfg /etc/newrelic/nrsysmond.cfg
    sed -i “s/HOSTNAME/${HOSTNAME}/g” /etc/newrelic/nrsysmond.cfg
    mkdir -p /usr/local/sbin
    chmod -R 0755 /usr/local
    chmod 600 /etc/newrelic/nrsysmond.cfg
    cp dockerbeta_v2.1.0.116/nrsysmond /usr/local/sbin/
    chmod 755 /usr/local/sbin/nrsysmond
    /usr/local/sbin/nrsysmond -c /etc/newrelic/nrsysmond.cfg

All the redacted/aws-cli-docker:helper container / tag does is run aws commands. I previously uploaded a custom-configured nrsysmond.cfg file and the dockerbeta nrsysmond binary to an s3 bucket as seen.

The nrsysmond.cfg also contains our new relic key.

Hello John_John.
Did you try to set up APM monitoring for applications, running on rancher in containers?


 You can setup APM monitoring through New Relic Docker, and at the same

time you can get exceptions by installing the application specific gems,
modules, etc, as you would before. Then you get a container view from the
hosts perspective as well as individual application perspective which shows
you any exceptions being thrown…

I was looking for a solution to get newrelic server monitoring running inside RancherOS.
I managed to get this done by adding as custom system service.

Works well, but the docker integration of newrelic is not working.
I am getting errors like this the following, but cgroups seem to be mounted correctly.

error: Cannot access cgroup for 1 containers

Any ideas anyone?

I’m new here, but it seems your question wasn’t answered. I hope you have been able to figure it out or that you got some help.

If not - Docker Performance Monitoring | Container Monitoring Solutions

Try the URL above.

Hopefully that will help.

Please add any feedback you might have.