hipcat is a command line tool that posts messages to Hipchat This tool was forked from slackcat to support Hipchat.
$ echo "hello" | hipcat
If you have a working Go installation run go get github.com/jburnham/hipcat
.
You need to create an API Token.
You can then configure hipcat through a config file and/or environment variables.
{
"api_token":"RK4U0ZmdsTkc4ap8tKY9qDe8Ps1lT38cBh2ohGaZ",
"hipchat_url":"https://api.hipchat.com",
"room":"MyRoom"
}
In /etc/hipcat.conf
, ~/.hipcat.conf
or ./hipcat.conf
See hipcat-example.conf
for
a full example.
$ export HIPCAT_API_TOKEN=RK4U0ZmdsTkc4ap8tKY9qDe8Ps1lT38cBh2ohGaZ
$ export HIPCAT_URL="https://api.hipchat.com"
$ export HIPCAT_ROOM="MyRoom"
Will override file config.
hipcat will take each line from stdin and post it as a message to Slack:
tail -F logfile | hipcat
Be aware that if a file outputs blank lines, this will result in a 400 error from Hipchat. You can remedy this using grep to filter out blank lines:
tail -F logfile | grep --line-buffered -v '^\s*$' | hipcat
If you'd prefer to provide a message on the command line, you can:
sleep 300; hipcat "done"
Default: None
echo "sudo make me a sandwich" | hipcat --room test