Skip to content

matsumotory/mruby-zabbix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Zabbix 2.0 API client for mruby

require mruby-httprequest mruby-json

install by mrbgems

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

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:

About

zabbix 2.0 API client for mruby using mruby-httprequest.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages