AppD Archive

[PHP] Change configuration at runtime

CommunityUser
Splunk Employee
Splunk Employee

Hi,


I'm trying to use the AppDynamics agent on a DEV server where the PHP instance is running multiple applications. I get reports only from one application so the solution I'm trying is to add all the AppDynamics agent configurations to the php.ini file, all except the communication dir then I overwrite the communication dir from vhost and the result is that the LOCAL VALUE is a valid directory but the MASTER VALUE is an empty variable. The problem is that the agent doesn't care about the local value because it doesn't work. If I give a valid directory to the php.ini file and overwrite it with an empty string it still works. 

I attached a screenshot with a configuration that doesn't work.

Is there any chance to change the setting at runtime or the php.ini file is the only solution?

Thanks,

Lorand.

0 Karma

Piyush_Mundra
Communicator

Hi lorand.condrache,

Could you please provide us some more information in order to debug the issu. You mentioned that "DEV server where the PHP instance is running multiple applications" we assume that "multiple application" means multiple PHP applications.

Are all these PHP application are served from single web server OR there are multiple webserver?

Is there any application which is served only from CLI?

As you mentioned that "I get reports only from one application" that means agent installation succeeded and it is up and running. If these multiple applications are served under single web server can you try and configure them based on Virtual Host Naming Prefix. Below link will be helpful to do so.

http://docs.appdynamics.com/display/PRO14S/Configure+Transaction+Detection+for+PHP#ConfigureTransact...

Another point to check is if you have multiple PHP applications served under single web server then there may be a situation of BT overflow and BTs from other applications would be grouped in "All Other Traffic".

Please go through below link for more details.

http://docs.appdynamics.com/display/PRO14S/All+Other+Traffic+Business+Transaction 

Best Regards,

Piyush

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

Hi Piyush,

Thak you for your quick reply.

The DEV server is running multiple PHP applications under the same webserver, as you assumed. The webserver is apache with mod_php.

The application that I want to get reports from is using both WEB and CLI. I managed to get reports only from the CLI section of the app by adding a custom php.ini file with the "php -c" command (so when I'm running the CLI section of the app, the master value is correctly set) but I'm having problems dealing with the reports from the web section of the application.

If i'm not mistaken the first solution you proposed is to filter the reports on the controller side but I would rather prefer to filter them before sending to the controller.

My problem is that the PHP agent configuration can't be changed once the apache server is started.

As you see in the pattachement from the previous message, the local value from proxy_comm_dir is set, but the agent doesn't use it. (it uses the master value instead)

Best regards,

Lorand.

0 Karma

Piyush_Mundra
Communicator

Hi Lorand,

Sorry for the late reply.

As you mentioned that you want to instrument the PHP application which will have transactions from both WEB as well as CLI. To get this setup working correctly there are some steps to follow. Below I am sharing with you some of the documentation links which should help you in setting up the environment correctly.

http://docs.appdynamics.com/display/PRO14S/Install+the+App+Agent+for+PHP#InstalltheAppAgentforPHP-Sp...

and

http://docs.appdynamics.com/display/PRO14S/Running+the+PHP+Proxy+Daemon+Manually

Please feel free to reply in case you face any issue in getting this enviroment up and running.

Best Regards,

Piyush

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

Hi Piyush,

Thank you for the reply.

I already read the documentation and managed to have the proxy started manually.

As you know in Apache with mod_php you can't load an extension at runtime. So I can't load the agent at runtime in order to monitor only my PHP application. So I'm loading the agent for all the applications that are running on the DEV server.

To avoid receiveing reports from all other PHP applications that are running on the DEV server, I'm loading the agent without the communication dir variable defined. (in the php.ini file are all the settings but proxy_comm_dir).

In the vhost of my PHP application I'm setting the proxy_comm_dir using php_admin_value. So for my PHp application I have all the setting as they should be.

I'm guessing that if the local values from phpinfo are set correctly, the agent should load them and work correctly, but it doesn't. It only loads the settings from php.ini that were set at startup. (the settings changes made at runtime are not taken into consideration) (See attached image)

I hope that this explains a little my situation and help you understand better my problem wich is that the local settings are not taken into consideration.

Thank you very much for your time.

Lorand.

0 Karma

Piyush_Mundra
Communicator

Hi Lorand,

I understood what you are trying to achieve. Just to be on same page I am describing my understanding of the issue.

You have apache serving multiple PHP application but you want to instrument only one / some of them and alongwith this you also want to instrument CLI application.

One quick and simple solution here can be instrument all WEB applications alongwith CLI and use "Exclude Rules" to just ignore all the other PHP WEB application traffic. This way you don't have to tweak with the ini settings.

If the above solutions is not feasible then please provide me your php.ini, appdynamics_agent.ini (if any), virtual host entry snippet and command used to start proxy. Please also attach the runProxy script (only if modified). I will try to make it work in our lab and update you.

Best Regards,

Piyush

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

Hi Piyush,

The exclude rules are a good solution, but this solution is not feasible right now.

My team lider already talked with someone from AppDynamics and they said that your DEV team is looking into it.

I will return with an update when the problem is fixed and eventualy with the solution.

Thank you very much for your help.

Best regards,

Lorand.

0 Karma

Piyush_Mundra
Communicator

Hi Lorand,

Thanks for the update.

Best Regards,

Piyush

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

Hi Piyush,

First I want to thank you for your support.

It seems that the problem I had was fixed with the release 3.9.2.

When I tried to download the agent, there was a message that said: "Reminder: AppDynamics Agents are not backwards compatible across versions. Please ensure your AppDynamics Controller version is equal to or greater than the version of the AppDynamics Agent you are using.", and the SAAS contoller version is "3.8.5.1 build 12" so I'm guessing that the new agent and the controller are not compatible.

My questions:

Will the SAAS controller be updated to version 3.9?

If it won't, is there any workaround for this version incompatibility?

Best regards,

Lorand.

0 Karma

Piyush_Mundra
Communicator

Hi Lorand,

Glad to hear that the problem you had is fixed with the release 3.9.2. From my understanding your SAAS url is https://paravion.saas.appdynamics.com please confirm. Please find below the answers to you questions

Will the SAAS controller be updated to version 3.9?

Yes, but no confirmed date as of yet.

If it won't, is there any workaround for this version incompatibility?

Sorry to say this but there are no workaround for the version incompatibility. I would suggest to wait until your SAAS controller is upgraded and then try.

Best Regards,

Piyush

0 Karma

Piyush_Mundra
Communicator

Hi Lorand,

My sincere apologies for not addressing by your name in last post.

Thanks,

Piyush

0 Karma
Get Updates on the Splunk Community!

See just what you’ve been missing | Observability tracks at Splunk University

Looking to sharpen your observability skills so you can better understand how to collect and analyze data from ...

Weezer at .conf25? Say it ain’t so!

Hello Splunkers, The countdown to .conf25 is on-and we've just turned up the volume! We're thrilled to ...

How SC4S Makes Suricata Logs Ingestion Simple

Network security monitoring has become increasingly critical for organizations of all sizes. Splunk has ...