Git Product home page Git Product logo

hipchat-cli's Introduction

hipchat-cli

Some command line scripts for performing HipChat API calls. For details on how to obtain a token and room id, see the tutorial.

./hipchat_room_message

Used to send a message to a room.

$ cat message.txt | ./hipchat_room_message -t <token> -r <room> -f "System"

Configuration

hipchat-cli can be configured with one of the following options in a combination of those.

  • Command-line options
  • Environment variables
  • Configuration file

Command-line options

Command-line options are passed into hipchat-cli. A list of options is available by executing hipchat_room_message -h.

$ ./hipchat_room_message -h
Usage: ./hipchat_room_message -t <token> -r <room id> -f <from name>

This script will read from stdin and send the contents to the given room as
a system message. Or use -i message.

OPTIONS:
   -h             Show this message
   -t <token>     API token
   -r <room id>   Room ID
   -f <from name> From name (optional in v2 API)
   -c <color>     Message color (yellow, red, green, purple, gray
                                 or random - default: yellow)
   -m <format>    Message format (html or text - default: html)
   -i <input>     Optional: Input to send to room (default: stdin)
   -l <level>     Nagios message level (critical, warning, unknown,
                                        ok, down, up).  Will override color.
   -n             Trigger notification for people in the room
   -o             API host (api.hipchat.com)
   -v <version>   API version (default: v1)
   -k             Allow curl to make insecure SSL connections

Usage example:

$ ./hipchat_room_message -vv2 -t <TOKEN> -r <ROOM> -i "This is a message"

Environment variables

All options available as command-line options can be passed in as environment variables.

Environment variable Description
HIPCHAT_TOKEN API token
HIPCHAT_ROOM_ID Room ID
HIPCHAT_FROM From name
HIPCHAT_COLOR Message color (yellow, red, green, purple, gray or random - default: yellow)
HIPCHAT_FORMAT Message format (html or text - default: html)
HIPCHAT_NOTIFY Trigger notification for people in the room (default: 0)
HIPCHAT_HOST API host (default: api.hipchat.com)
HIPCHAT_LEVEL Message Level (targetting Nagios states, critical, warning, unknown, ok)
HIPCHAT_API API version (default: v1)

Usage example:

$ cat message.txt | HIPCHAT_TOKEN=<token> HIPCHAT_ROOM_ID=1234 ./hipchat_room_message -f "System"

Configuration file

All environment variables can be specified in a configuration file. The configuration file is /etc/hipchat.

Usage example:

Configuration in /etc/hipchat:

HIPCHAT_TOKEN=<token>
HIPCHAT_ROOM_ID=1234

Command-line:

$ cat message.txt | HIPCHAT_FROM="System" ./hipchat_room_message -c green

hipchat-cli's People

Contributors

c3w avatar datashaman avatar dentarg avatar dkolbly avatar dkolbly-team avatar eirc avatar ekristen avatar estahn avatar graffic avatar ilikepi avatar jimsmith avatar jparise avatar kaorimatz avatar onnodb avatar powdahound avatar rberrelleza avatar skahlhoefer avatar withinfocus avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.