Skip to content
Rob Sharp edited this page Dec 9, 2016 · 1 revision

Smith

Smith has three main components: the agency, agents and smithctl. The agency is used to manage running agents but can be restart without impacting the agents (unless an agent dies while the agency is down. The agents are the bits that do the actual work and smithctl is a command line tool that is used to control agents.

Kill all agents

For when you have to kill 'em all. My naive approach:

smithctl list -la | awk -F ' ' '{print $2}' | xargs smithctl kill $1

Commands

To find out the list of commands you can run smithctl commands, smithctl commands -l will give some details on what the command does.

For convenience here are some often used commands:

list

To list agents

smithctl list will list the uuids of all running agents.

smithctl list -l will list details of all running agents in the running state.

smithctl list -la will list details of all agents in any state (starting, stopping, dead, etc).

logger

To change the log level and any agent.

smithctl logger -l warn <uuid> change the log level of the specified agent.

smithctl logger -l warn $(smithctl list) change the log level of all agents.

smithctl logger -l warn $(smithctl list <agent name>) change the log level of all instances of the named agent.

pop

To look at a message[s] or remove a message[s] from a queue.

smithctl pop -jp <queue name> look at a single message in json format.

smithctl pop -n 20 -jp <queue name> look at a 20 messages in json format.

smithctl pop -r <queue name> remove a single message.

smithctl pop -r -n 20 <queue name> remove 20 messages.

smithctl pop -prj -n 20 <queue name> remove 20 messages and print them in json format.

push

To push a message onto a queue

smithctl push -t <type> -m <single line json>

For example:

smithctl push -t Smith::ACL::Customer -m '{"foo":"bar"}' xplatform.customer.match

you can also pipe a file into smithctl push with a message per line in JSON format.

cat <file> | smithctl push -t Smith::ACL::Customer xplatform.customer.match

group

To stop & start a group of agent smithctl stop -g <agent name> will stop all agents smithctl start -g <agent name> will start all agents

smithctl list -la will show you all the agents, so compare the number of agents to check whether all agents are started.

Clone this wiki locally