Skip to content

mahori/hostdb

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hostdb

License

ホストの情報(ホスト名,IPv4アドレス,IPv6アドレス,MACアドレス)をMongoDBデータベースで管理します.

必要なパッケージ

  • Ruby
  • mongo gem
  • (MongoDBサーバ)

データベースの設定

use hosts

db.createUser( { user:  "ユーザ名",
                 pwd:   "パスワード",
                 roles: [ "readWrite", "dbAdmin" ] } )

db.createCollection( "hosts" )

コマンド

データベースオプション

オプション 説明
-h MongoDBサーバのIPアドレスまたはホスト名
-P MongoDBサーバのポート
-u ユーザ名
-p パスワード
-d データベース名
-c コレクション名

サブコマンド

list

ホストをリスト

$ hostdb データベースオプション list

search

ホストの検索

$ hostdb データベースオプション search クエリ

$ hostdb データベースオプション search host01
$ hostdb データベースオプション search 192.0.2.2
$ hostdb データベースオプション search 2001:db8::2
$ hostdb データベースオプション search 01:23:45:67:89:ab

add

ホストの追加

$ hostdb データベースオプション add ホスト名 ...

$ hostdb データベースオプション add host01 192.0.2.2 2001:db8::2 01:23:45:67:89:ab

delete

ホストの削除

$ hostdb データベースオプション delete ホスト名

$ hostdb データベースオプション delete host01

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%