/go/compare: compare from the Command Line

/go/compare asks each GoAdmio server you list how many requests it has served, adds the numbers together, and prints each server's percentage of the total. Use it to see whether traffic is spread evenly across servers, for example behind a load balancer or DNS round-robin. Only request counts are compared. The command doesn't report CPU, memory, or disk usage. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.

Quick start

# Compare two servers
/go/compare 203.0.113.10 203.0.113.11

Arguments

Argument Required Notes
<server> Yes, at least one The IP address or hostname of a GoAdmio server. Don’t include a port or http://.

Each argument is queried in turn, in the order given.

Examples

# Compare three servers
/go/compare 203.0.113.10 203.0.113.11 203.0.113.12

# Compare servers by hostname
/go/compare web1.example.com web2.example.com

# Check what a single server reports
wget -qO- "http://203.0.113.10:2020/file.php?Action=Requests"

Output

One line per server that answered, in the same order you listed them, showing the address and its share of the total requests with one decimal place:

203.0.113.10 42.3%
203.0.113.11 57.7%

Situation What you see
All servers answered A percentage line for each server.
Some servers didn’t answer Percentages for the servers that did. The others are left out without any message.
No server answered Nothing is printed and the command exits with status 1.
Every server reports 0 requests An awk division-by-zero error.

The percentages are rounded, so they may not add up to exactly 100.0%. Absolute request counts aren’t shown.

Every run is logged with its arguments and a timestamp, for example [Nov 20 09:15:02]# compare 203.0.113.10 203.0.113.11, to /var/log/go/compare.log.

See the full reference at /go/compare 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.

By:

Posted in:


Leave a Reply

Your email address will not be published. Required fields are marked *