question

Dimitris P. avatar image
Dimitris P. asked ·

Linux Apache - chroot

A customer runs Apache on a linux host in a chroot directory. What's the best practice for monitoring the Apache process in this case?

apache
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

Julius L. avatar image
Julius L. answered ·

I think it depends on the actual situation.
If the Apache is the only process to be monitored on the host and the full stack agent does not work in your case, you can use the PaaS agent

However, I think with proper settings and mapping oneagent directories into the chroot and setting the LD_PRELOAD you should be able to use the full stack oneagent on your host in the chroot environment.

2 comments Share
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

Thank you Julius for your answer.

Can you provide some more info on how to deploy the PaaS agent? I find documentation for Azure WebApps, Cloud Foundry, Openshift and Kubernetes platforms.

What steps should i follow in this case?

If not using the PaaS installer,

would the following settings solve my issue?

#!/bin/bash

CHROOT=/new/root/directory
mkdir -p $CHROOT/var/lib/dynatrace
mount -o bind /var/lib/dynatrace/ $CHROOT/var/lib/dynatrace/

mkdir -p $CHROOT/opt/dynatrace
mount -o bind /opt/dynatrace/ $CHROOT/opt/dynatrace

mount -o bind /dev/ $CHROOT/dev
cp /etc/resolv.conf $CHROOT/etc/resolv.conf

Please advise also where to set the LD_PRELOAD variable.

Thank you

0 Likes 0 · ·

The LD_PRELOAD is typically set from /etc/ld.so.preload and typically is set to /lib/x86_64-linux-gnu/liboneagentproc.so

So you need to either add /lib/x86_64-linux-gnu/liboneagentproc.so to the chroot and set the LD_PRELOAD correctly or you can try to point it to /opt/dynatrace/oneagent/agent/lib64/liboneagentproc.so (I did not try - it may not work).

The PaaS agent can be downloaded from this URL (replace tenant and api token)
<tenant>/api/v1/deployment/installer/agent/unix/paas/latest?Api-Token=<api token>&arch=x86&flavor=default

But don't forget you have to manually upgrade the PaaS agent. For usage of PaaS agent, I'd recommend seeing the docs for Solaris OneAgent as it only exists as PaaS. (There are no docs about PaaS agent on Linux, since typically you install the full-stack agent).

0 Likes 0 · ·
David N. avatar image
David N. answered ·

Hello Dimitris,

If Dynatrace does not detect you process automatically you can use a process detection rule and add the executable path so that Dynatrace can be pointed directly to the Apache process.

To do that go to settings -> processes and containers -> process group detection -> custom process group detection rule.

Thanks,
David Nicholls

Share
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

Space Topics

mobile monitoring dotnet synthetic monitoring reports iis chat kubernetes servicenow amazon web services mysql mainframe rest api errors cassandra dashboard oneagent sdk cmc application monitoring openkit smartscape request attributes monitoring developer community user tagging log monitoring services ufo syntheticadvisory activegate ip addresses auto-detection high five award oracle hyperion webserver uem usql iib test automation license web performance monitoring ios news migration management zones index ibm mq web services custom event alerts notifications sso host monitoring knowledge sharing reports browser monitors java hybris sap vmware maintenance window user action naming javascript appmon ai synthetic classic availability tipstricks automation extensions session replay diagnostic tools permissions davis assistant faq documentation problem detection http monitors server easytravel apdex aws-quickstart network docker tags and metadata cloud foundry google cloud platform synthetic monitoring process groups account usability dynatrace saas gui paas openshift key user actions administration user actions postgresql synthetic locations oneagent security Dynatrace Managed user management custom python technologies mongodb openstack user session monitoring continuous delivery citrix configuration alerting NGINX action naming linux nam installation masking error reporting database mission control jmeter recorder apache mobileapp RUM php threshold azure purepath davis scripting agent aix nodejs android