Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matsumotory/mruby-zabbix
zabbix 2.0 API client for mruby using mruby-httprequest.
https://github.com/matsumotory/mruby-zabbix
Last synced: about 2 months ago
JSON representation
zabbix 2.0 API client for mruby using mruby-httprequest.
- Host: GitHub
- URL: https://github.com/matsumotory/mruby-zabbix
- Owner: matsumotory
- Created: 2012-12-19T04:46:04.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2013-01-04T10:20:43.000Z (about 12 years ago)
- Last Synced: 2024-10-18T18:17:14.625Z (3 months ago)
- Language: Ruby
- Size: 141 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-mruby - mruby-zabbix - Zabbix 2.0 API Client for MRuby. (APIs)
README
# Zabbix 2.0 API client for mruby
require mruby-httprequest mruby-json
## install by mrbgems
```bash
git clone git://github.com/matsumoto-r/mruby-zabbix.git
cp -pr mruby-zabbix ${MRUBY_ROOT}/mrbgems/g/.
echo mruby-zabbix >> ${MRUBY_ROOT}/mrbgems/GEMS.active
cd ${MRUBY_ROOT}
make
./bin/mruby ${MRUBY_ROOT}/mrbgems/g/mruby-zabbix/example/zabbix-api-cient.rb
```## example
```ruby
config = {
:url => "http://127.0.0.1/zabbix/api_jsonrpc.php",
:ua => "mruby-zabbix",
:user => "api-admin",
:pass => "api-admin",
}z = Zabbix::Client.new(config)
data = {
:method => "get",
:object => "host",
:params => {
:output => "extend",
:filter => {
:host => "example.com",
},
},
}puts "request: #{JSON::stringify(data)}"
puts "response: #{z.post(data)["body"]}"
```# License
under the MIT License:* http://www.opensource.org/licenses/mit-license.php