ZenossApi
Command line interface abstraction of zenoss api method calls.
Installation
Not currently published to rubygems.org, see Development
Add this line to your application's Gemfile:
gem 'zenoss_api'
And then execute:
$ bundle
Or install it yourself as:
$ gem install zenoss_api
Usage
Get all device classes:
zenapi -m getDevices -p name:admin01.ctl.gdl.englab.netapp.com | jq '.devices[]'
Get all groups:
zenapi -m getGroups | jq '.groups[] | .name'
Get devices in device class, limit to 30:
zenapi --uid '/Devices/Server/Linux/CTL' --limit 30 | jq '.devices[] | .name'
Get device by name:
zenapi -m getDevices -a name:admin01.ctl.gdl.englab.netapp.com
Get most recent events, limit to 10:
zenapi -m query -r EventsRouter --limit 10 | jq '.events[] | .device | .text'
Get event detail:
zenapi -r EventsRouter -m detail -a evid:0025b520-10e1-bfad-11e6-9abe93a9a0ae | jq '.'
Get all routers:
zenapi -r IntrospectionRouter -m getAllRouters | jq '.result | .data[] | .name'
Introspect router methods:
zenapi -r IntrospectionRouter -m getRouterMethods -a router:DeviceRouter | jq '.result | .data'
Development
After checking out the repo, run bin/setup
to install dependencies. 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.
Contributing
Bug reports and pull requests are welcome on GitLab at http://https://gitlab.com/twstoll/zenoss_api This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
License
The gem is available as open source under the terms of the MIT License.