Scenario: a total of 10 web servers are provided by one F5. Each server is LNMP. When an exception is thrown for a function, an alert message is sent to several owners. Requirement Description: we want to add the IP address of the machine for which the request is processed in the alarm text message. But the problem... Scenario Description:
A total of 10 web servers are provided by one F5. Each server is LNMP. When an exception is thrown for a function, an alert message is sent to several owners.
Requirement Description:
We want to add the IP address of the machine before the request is processed in the alarm text message.
But the problem is to use exec/passthru. The command line is fine. When an http request is sent, the returned value is null, and the error code ID is 127. Colleagues, we also want to use the configuration file to express the local IP address, but this will cause unnecessary trouble to switch the data center and server in the future.
Please give us a solution.
Reply content:
Scenario Description:
A total of 10 web servers are provided by one F5. Each server is LNMP. When an exception is thrown for a function, an alert message is sent to several owners.
Requirement Description:
We want to add the IP address of the machine before the request is processed in the alarm text message.
But the problem is to use exec/passthru. The command line is fine. When an http request is sent, the returned value is null, and the error code ID is 127. Colleagues, we also want to use the configuration file to express the local IP address, but this will cause unnecessary trouble to switch the data center and server in the future.
Please give us a solution.
Isn't it a good idea to use a configuration file to record local IP addresses? Add a scheduled script or startup task to each server to regularly write the local IP address to the configuration file. Retrieving text messages from the configuration file will not have much impact on changing servers in the data center in the future.
$ _ SERVER ['server _ ADDR '] cannot meet your requirements?