Project

koma

0.01
No commit activity in last 3 years
No release in over 3 years
Koma is an inventory monitoring tool that doesn’t require agent installation on the sever side.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.9
>= 0
~> 10.0
>= 0

Runtime

~> 1.2
~> 2.59
>= 0
 Project Readme

Koma Gem Build Status

Koma is an inventory monitoring tool that doesn’t require agent installation on the sever side.

Installation

Add the following line to your application's Gemfile:

gem 'koma'

And then execute:

$ bundle

Or install it yourself as:

$ gem install koma

Usage

Gather remote host inventory

If you login remote server via ssh example.com, you can execute:

$ koma ssh example.com

And gather host inventory stdout like this.

Gather local host inventory

$ koma exec

Gather host inventory from multiple hosts

$ koma ssh example.com,example.jp
{
  "example.com": {
    ...
  },
  "example.jp": {
    ...
  }
}

Pro Tip: Gather host inventory from multiple hosts with ssh_config

$ cat <<EOF > ssh_config_tmp
Host example_com
  User k1low
  Hostname example.com
  PreferredAuthentications publickey
  IdentityFile /path/to/example_rsa

Host example_jp
  User someone
  Hostname example.jp
  PreferredAuthentications publickey
  IdentityFile /path/to/more/example_jp_rsa
EOF

$ cat ssh_config_tmp | koma ssh --key platform,platform_version

Use sconb to filter ~/.ssh/config.

$ sconb dump example_* | sconb restore | koma ssh --key platform,platform_version

Gather vagrant host inventory.

$ vagrant ssh-config | koma ssh --key cpu,kernel

Run command on remote hosts

$ koma run-command example.com,example.jp uptime
{
  "example.com": {
    "uptime": {
      "exit_signal": null,
      "exit_status": 0,
      "stderr": "",
      "stdout": " 00:18:10 up 337 days,  4:51,  1 user,  load average: 0.08, 0.02, 0.01\n"
    }
  },
  "example.jp": {
    "uptime": {
      "exit_signal": null,
      "exit_status": 0,
      "stderr": "",
      "stdout": " 00:10:09 up 182 days,  7:34,  1 user,  load average: 0.07, 0.03, 0.01\n"
    }
  }
}

Host inventory keys

$ koma keys
memory
ec2 (disabled)
hostname
domain
fqdn
platform
platform_version
filesystem
cpu
virtualization
kernel
block_device
package
user
group
service

Contribution

  1. Fork it ( https://github.com/k1LoW/koma/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request