Giter VIP home page Giter VIP logo

sensu-cli's Introduction

sensu-cli

#
# Welcome to the sensu-cli.
#          ______
#       .-'      '-.
#     .'     __     '.
#    /      /  \      \
#    ------------------
#            /\
#           '--'
#          SENSU
#

A sensu-cli for interacting with the sensu api.

What is Sensu? http://sensuapp.org/

Features

  • API interaction with info, health, stashes, events, clients, aggregates and checks
  • Resolve Events
  • Silence clients and checks
  • Get Requests (get clients, stashes, events, etc.)
  • Delete Requests (delete clients, stashes, aggregates and events)

Usage and Configuration

  • gem install sensu-cli

  • There is one settings file for host, port and ssl that lives in your user directory ~/.sensu/settings.rb. You can alternatively place this in /etc/sensu/sensu-cli/settings.rb.

host  "127.0.0.1"
port  "4567"
ssl   false

This format was chosen so you can do some ENV magic via your profile and setting up an alias. For details see the wiki

  • If your Sensu API has basic auth, add the parameters to the config.
host  "127.0.0.1"
port  "4567"
ssl   false
user "some_user"
password "some_secret_password"

Expire Silenced Hosts/Checks

I added an expires option to sensu silence to be used like sensu silence HOST -e 30 where -e denotes the number of minutes from now a host/checks silence should expire. This won't work by itself. We add a key to the silence stash with a time in the future. If you run check-stashes on your sensu-server it will check for expired stashes and delete them.

There is also a reason option -r available. Be nice and use it so your colleagues know what you're doing.

Examples

Available subcommands: (for details, sensu SUB-COMMAND --help)

** Aggregate Commands **
sensu aggregate list (OPTIONS)
sensu aggregate show CHECK (OPTIONS)
sensu aggregate delete CHECK

** Check Commands **
sensu check list
sensu check show CHECK
sensu check request CHECK SUB1,SUB2

** Client Commands **
sensu client list (OPTIONS)
sensu client show NODE
sensu client delete NODE
sensu client history NODE

** Event Commands **
sensu event list
sensu event show NODE (OPTIONS)
sensu event delete NODE CHECK

** Health Commands **
sensu health (OPTIONS)

** Info Commands **
sensu info

** Silence Commands **
sensu silence NODE (OPTIONS)

** Stash Commands **
sensu stash list (OPTIONS)
sensu stash show STASHPATH
sensu stash delete STASHPATH

** Resolve Commands **
sensu resolve NODE CHECK

  --version, -v:   Print version and exit
     --help, -h:   Show this message

Contributions

Please provide a pull request. I'm an ops guy, not a developer, so if you're submitting code cleanup, all I ask is that you explain the improvement so I can learn.

TODO

  • cleanup the cli
  • Once complete api support is implemented I'll add other features like filtering or issuing a event.

License and Author

I'm releasing this under the MIT or Apache 2.0 license. You pick.

Author:: Bryan Brandau [email protected]

Copyright:: 2013, Bryan Brandau

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

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.