/go/bottop finds and blocks bots that you have marked as bad. It reads the server's access log for the last hour, picks out requests whose user agent (the name a visitor's software reports) matches a bot flagged for blocking, and ranks the IP addresses that sent the most of them. It has two modes: Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.
Quick start
# See the top bot IPs of the last hour without blocking anything
/go/bottop
Options
| Argument | Required | Notes |
|---|---|---|
block |
No | Turns on blocking. Without it the command only reports. |
--more |
No | Counts each IP together with its user agent and shows the user agent text with the IP. Use it only for looking: the IP column then holds more than the address, so the country and company lookups and the blocking don’t work properly with it. |
Examples
# Report only
/go/bottop
# Report and block (this is what the hourly cron job runs)
/go/bottop block
# See which IPs were blocked for one bot
cat /var/log/go/bottop/SemrushBot.log
Output
The command prints one table, then, if it blocked anything, sends the alerts. The table has one row for each IP, most visits first.
IP VISITS Bot Name COUNTRY CITY COMPANY
-- ------ -------- ------- ---- -------
203.0.113.50 412 SemrushBot US Dallas Example Hosting LLC
| Column | Meaning |
|---|---|
IP |
The visitor’s IP address. If the log records a real client address behind a proxy, that address is used. |
VISITS |
Matching requests from that IP in the last hour. |
Bot Name |
The first bot name found in the IP’s first log entry. It can be blank. |
COUNTRY, CITY |
Where the IP is located. In a normal terminal they come from a location lookup. In a scheduled run they come from the WHOIS record and can be blank. |
COMPANY |
The organization that owns the IP, from WHOIS. |
The server’s own IP addresses and 127.0.0.1 never appear in the table.
| Message | Meaning |
|---|---|
Instance (<name>) already running. |
In block mode, another blocking command is running. Exit status 1. See Troubleshooting. |
Alerts
When block blocks at least one IP, the administrator receives an email and a WhatsApp message titled Bad Bot Activity Blocked (<n> IPs). It lists each blocked IP, its bot name, visit count, country, and company.
Logs
| Log | Contents |
|---|---|
/var/log/go/bottop.log |
One line for each run. |
/var/log/go/bottop/<BotName>.log |
In block mode, one line for each IP blocked for that bot, with date and time, IP, visit count, country, and company. Written only when the bot name is known. |
[Nov 21 12:00:00]# bottop block
See the full reference at /go/bottop and the GoAdmio command index.
GoAdmio is free and open source, with no license fees and no account limits. Read the GoAdmio docs, or see why it is a free cPanel alternative at goadmio.com.
