Git Product home page Git Product logo

hipchat-cli's Introduction

hipchat-cli

Some command line scripts for performing HipChat API calls.

./hipchat_room_message

Used to send a message to a room.

$ cat message.txt | ./hipchat_room_message -t <token> -r 1234 -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.

OPTIONS:
   -h             Show this message
   -t <token>     API token
   -r <room id>   Room ID
   -f <from name> From name
   -c <color>     Message color (yellow, red, green, purple or random - default: yellow)
   -m <format>    Message format (html or text - default: html)
   -i <input>     Message to send to room, allows you to specify input via command line instead of stdin
   -l <level>     Nagios message level (critical, warning, unknown, ok, down, up). Will override color.
   -n             Trigger notification for people in the room (default: 0)
   -o             API host (api.hipchat.com)
   -v <version>   API version (default: v1)

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 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 (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

powdahound avatar estahn avatar ekristen avatar c3w avatar graffic avatar eirc avatar jparise avatar withinfocus avatar kaorimatz avatar

Watchers

 avatar James Cloos 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.