For quick checking, I use this bash one-liner:
(echo status ; sleep 0.1) | netcat 127.0.0.1 4730
This opens a connection to a gearman instance running on localhost, and sends the status query. This contains the name and number of jobs on that instance. The information can then be processed with grep
/awk
/wc
etc. for reporting and alerting.
I also do the same with the workers query which shows all connected workers.
(echo workers ; sleep 0.1) | netcat 127.0.0.1 4730
The sleep is to keep the connection open long enough for the reply.
The full list of administrative commands, and what the output means is at http://gearman.org/protocol/. Just search for "Administrative Protocol".