Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kkirsche/bark
Bark: A Gem For Use By Individuals Looking to Retrieve Data From a Monit Server
https://github.com/kkirsche/bark
Last synced: about 1 month ago
JSON representation
Bark: A Gem For Use By Individuals Looking to Retrieve Data From a Monit Server
- Host: GitHub
- URL: https://github.com/kkirsche/bark
- Owner: kkirsche
- License: apache-2.0
- Created: 2015-10-01T16:07:34.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-12-21T17:49:22.000Z (about 7 years ago)
- Last Synced: 2024-11-08T18:04:21.661Z (about 2 months ago)
- Language: Ruby
- Homepage: kkirsche.github.io/Bark
- Size: 1.11 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Gem Version](https://badge.fury.io/rb/barking.svg)](http://badge.fury.io/rb/barking)
# Bark
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/bark`. To experiment with that code, run `bin/console` for an interactive prompt.
TODO: Delete this and the text above, and describe your gem
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'bark'
```And then execute:
$ bundle
Or install it yourself as:
$ gem install bark
## Usage
Require Bark:
```ruby
require 'barking'
```Create a Bark client:
```ruby
client = Bark::Client.new
=> #"Hurley v0.2"}>,
@request_options=
#,
@ssl_options=
#,
@url=#>,
@host="localhost",
@password="monit",
@port="2812",
@user="admin">
```Use the Bark client:
```ruby
client = Bark::Client.new
client.status.current
=> {:monit=>
{:server=>
{:id=>"4674ff31c162bba574525571642b67fd",
:incarnation=>"1443740471",
:version=>"5.14",
:uptime=>"16012",
:poll=>"30",
:startdelay=>"0",
:localhostname=>"JohnDoe-Laptop.com",
:controlfile=>"/Users/jdoe/.monitrc",
:httpd=>{:address=>"localhost", :port=>"2812", :ssl=>"0"}},
:platform=>
{:name=>"Darwin",
:release=>"15.0.0",
:version=>
"Darwin Kernel Version 15.0.0: Wed Aug 26 16:57:32 PDT 2015; root:xnu-3247.1.106~1/RELEASE_X86_64",
:machine=>"x86_64",
:cpu=>"4",
:memory=>"16777216",
:swap=>"0"},
:service=>
{:type=>"5",
:name=>"JohnDoe-Laptop.com",
:collected_sec=>"1443756456",
:collected_usec=>"430689",
:status=>"0",
:status_hint=>"0",
:monitor=>"1",
:monitormode=>"0",
:pendingaction=>"0",
:system=>
{:load=>{:avg01=>"2.16", :avg05=>"1.87", :avg15=>"1.81"},
:cpu=>{:user=>"10.9", :system=>"5.0"},
:memory=>{:percent=>"54.1", :kilobyte=>"9080656"},
:swap=>{:percent=>"0.0", :kilobyte=>"0"}}}}}
```## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
## Contributing
Questions, comments, bug reports, and pull requests are all welcomed on Github at https://github.com/kkirsche/bark.
## Authors
* [Kevin Kirsche](https://github.com/kkirsche)