How can I check the number of api hits per day from Linux.
Scenario : I need to hit my client’s api to fetch data.
The api is hit using the cron job and through Linux wget command.
Client is complaining that he receives huge number of hits from my IP.
So, how can I find the number of times the api is hit/day from linux command.
Please help.
Its urgent!!
If you are sure, that wget to your client’s api is only invoked by a cron job, you can look at your crontab with the following command:
In the most cases you have to call crontab with root rights to see the system wide crontab. You will get something like this:
This means, wget is scheduled to request the example api every monday at 01:10am. You can interpret the output of crontab like this:
More likely for your case is an output like this:
this means, wget is called every fifth minute (288 hits per day).
If cron is not calling wget directly but a script, you will have to analyse that script to say how often wget is called. An alternative solution in that case would be to set a firewall rule to log every request to the client’s api server.