0
I have a PHP file of a legacy system running perfectly on my server that checks this system and sends several emails with the alerts found. However, this file is executed through Cron Jobs, scheduled tasks, etc.
The problem is that I have no idea where this Cron Job is that is calling the file. But I know where the file is and can change it.
Is there any way to find out, through the file, who the client is doing this request?
It’s already spun one
crontab -l
on the server to see the list of scheduled tasks?– bfavaretto
@bfavaretto the problem is right there. It’s not on the server where the application is. It’s some other server. As we have many virtual machines in our datacenter, we can not see one by one.
– humungs
You said you have access to the script, right? Have the script save one
print_r($_SERVER)
in a log to find out who is calling you.– Rodrigo Rigotti
I did a little different. I added in the body of the email that is sent by the script another information:
<?php echo $_SERVER['REMOTE_HOST']; ?>
. Let’s see now if I now receive the email with the IP of the server that made the request.– humungs