cfgmaker に関するメモ。
書式
cfgmaker [options] [community@]router [[options] [community@]router ...]
オプション
--output=file output filename (default is STDOUT)
cfgmaker の出力を指定されたファイル名に書き出しします。
複数回指定した場合は、最後に指定されたファイル名になります。
例:
cfgmaker --output=/etc/mrtg/mrtg.cfg 192.168.1.1
/etc/mrtg ディレクトリにファイル名 mrtg.cfg を出力する。
--global "x: a" add global config entries
生成した設定ファイルにグローバルオプションを追加するときに使用します。
例:
cfgmaker --output=/etc/mrtg/mrtg.cfg --global "WorkDir: /var/www/html" 192.168.1.1
EnablePv6: no
WorkDir: /var/www/html
cfgmaker --output=/etc/mrtg/mrtg.cfg --global "WorkDir: /var/www/html" --global "Options[_]: growright, bits" 192.168.1.1
EnablePv6: no
WorkDir: /var/www/html
Options[_]: growright, bits
cfgmaker --output=/etc/mrtg/mrtg.cfg --global "WorkDir: /var/www/html" 192.168.1.1 --global "Options[_]: growright, bits"
EnablePv6: no
WorkDir: /var/www/html
...
Options[_]: growright, bits
[EOF]
--ifref=nr Interface References by Interface Number (default)
--ifref=ip Interface References by IP Address
--ifref=eth Interface References by Ethernet Number
--ifref=descr Interface References by Interface Description
--ifref=name Interface References by Interface Name
--ifref=type Interface References by Interface Type
インタフェースの認識方法を指定します。
--ifref=nr
Target[192.168.1.1_2]: 2:public@192.168.1.1:
SetEnv[192.168.1.1_2]: MRTG_INT_IP="192.168.1.1" MRTG_INT_DESCR="eth0"
MaxBytes[192.168.1.1_2]: 1250000
Title[192.168.1.1_2]: Traffic Analysis for 2 -- localhost.localdomain
PageTop[192.168.1.1_2]:
Traffic Analysis for 2 -- localhost.localdomain
--ifref=ip
Target[192.168.1.1_192.168.1.1]: \192.168.1.1:public@192.168.1.1:
SetEnv[192.168.1.1_192.168.1.1]: MRTG_INT_IP="192.168.1.1" MRTG_INT_DESCR="eth0"
MaxBytes[192.168.1.1_192.168.1.1]: 1250000
Title[192.168.1.1_192.168.1.1]: Traffic Analysis for 192.168.1.1 -- localhost.localdomain
PageTop[192.168.1.1_192.168.1.1]: Traffic Analysis for 192.168.1.1 -- localhost.localdomain
--ifref=eth
Target[192.168.1.1_FF-FF-FF-FF-FF-FF]: !FF-FF-FF-FF-FF-FF:public@192.168.1.1:
SetEnv[192.168.1.1_FF-FF-FF-FF-FF-FF]: MRTG_INT_IP="192.168.1.1" MRTG_INT_DESCR="eth0"
MaxBytes[192.168.1.1_FF-FF-FF-FF-FF-FF]: 1250000
Title[192.168.1.1_FF-FF-FF-FF-FF-FF]: Traffic Analysis for FF-FF-FF-FF-FF-FF -- localhost.localdomain
PageTop[192.168.1.1_FF-FF-FF-FF-FF-FF]: Traffic Analysis for FF-FF-FF-FF-FF-FF -- localhost.localdomain
--ifref=descr
Target[192.168.1.1_eth0]: \eth0:public@192.168.1.1:
SetEnv[192.168.1.1_eth0]: MRTG_INT_IP="192.168.1.1" MRTG_INT_DESCR="eth0"
MaxBytes[192.168.1.1_eth0]: 1250000
Title[192.168.1.1_eth0]: Traffic Analysis for eth0 -- localhost.localdomain
PageTop[192.168.1.1_eth0]: Traffic Analysis for eth0 -- localhost.localdomain
--ifref=name
### * --ifref=name is not unique for this interface
--ifref=type
Target[192.168.1.1_6]: %6:public@192.168.1.1:
SetEnv[192.168.1.1_6]: MRTG_INT_IP="192.168.1.1" MRTG_INT_DESCR="eth0"
MaxBytes[192.168.1.1_6]: 1250000
Title[192.168.1.1_6]: Traffic Analysis for 6 -- localhost.localdomain
PageTop[192.168.1.1_6]: Traffic Analysis for 6 -- localhost.localdomain
--ifdesc=nr Interface Description uses Interface Number (default)
--ifdesc=ip Interface Description uses Ip Address
--ifdesc=eth Interface Description uses Ethernet Number
--ifdesc=descr Interface Description uses Interface Description
--ifdesc=name Interface Description uses Interface Name
--ifdesc=catname Interface Description uses CatOS Interface Name
--ifdesc=alias Interface Description uses Interface Alias
--ifdesc=type Interface Description uses Interface Type
インタフェースの説明に何を使うかを指定します。
--ifdesc=nr
Title[192.168.1.1_2]: Interface 2 -- localhost.localdomain
PageTop[192.168.1.1_2]: Interface 2 -- localhost.localdomain
--ifdesc=ip
Title[192.168.1.1_2]: 192.168.1.1 -- localhost.localdomain
PageTop[192.168.1.1_2]: 192.168.1.1 -- localhost.localdomain
--ifdesc=eth
Title[192.168.1.1_2]: FF-FF-FF-FF-FF-FF -- localhost.localdomain
PageTop[192.168.1.1_2]: FF-FF-FF-FF-FF-FF -- localhost.localdomain
--ifdesc=descr
Title[192.168.1.1_2]: eth0 -- localhost.localdomain
PageTop[192.168.1.1_2]: eth0 -- localhost.localdomain
--ifdesc=name
Title[192.168.1.1_2]: 2 -- localhost.localdomain
PageTop[192.168.1.1_2]: 2 -- localhost.localdomain
--ifdesc=alias
Title[192.168.1.1_2]: eth0 -- localhost.localdomain
PageTop[192.168.1.1_2]: eth0 -- localhost.localdomain
--ifdesc=type
Title[192.168.1.1_2]: %6 -- localhost.localdomain
PageTop[192.168.1.1_2]: %6 -- localhost.localdomain
--if-filter=f
フィルタ"f"で指定された値を使用して各インタフェースをテストし、
データの収集の対象にするかどうかを決定します。
--if-template=templatefile
--host-template=templatefile
--no-down
--show-op-down
--subdirs=format
Directory[]
--noreversedns
IPアドレスの逆引きを行わないようにします。
DNSを使わない環境では必須です。
--community=cmty
デフォルトのコミュニティ名"public"を"cmty"に変更します。
[community@]router
例:
cfgmaker --output=/etc/mrtg/mrtg.cfg --community=private router
cfgmaker --output=/etc/mrtg/mrtg.cfg private@router
--enable-ipv6
This option enables IPv6 support. It requires the appropriate perl modules; if they are not found then IPv6 is disabled (see the ipv6 documentation).
cfgmaker will use IPv6 or IPv4 depending on the target. If the target is a numeric address, the protocol depends on the type of address. If the target is a hostname, cfgmaker will try to resolve the name first to an IPv6 address then to an IPv4 address.
このオプションは IPv6 のサポートを有効にします。
有効にするには、perlモジュール(libsocket6-perl と libio-socket-inet6-perl)が必要です。
それらが見つからなかった場合は無効になります。以下のページを参考にしてください。
MRTG - mrtg-ipv6
http://oss.oetiker.ch/mrtg/doc/mrtg-ipv6.en.html
cfgmaker はターゲットに応じて IPv6 もしくは IPv4 を使用します。
もし、ターゲットが numeric address の場合、プロトコルはアドレスの種類によって異なります。
もし、ターゲットが hostname の場合、cfgmaker は最初に IPv6 アドレスの名前解決を試みてから IPv4 アドレスの名前解決を試みます。
IPv6 numeric addresses must be specified between square braces.
IPv6 の numeric addresses は、"["と"]"で囲まなければなりません。
例えば:
cfgmaker --enable-ipv6 [2001:760:4::1]:165:::2
If the target has both an IPv6 address and an IPv4 address with the same hostname, cfgmaker first queries the target using IPv6 and falls back to IPv4 if it fails. This is useful for targets which don't support SNMP over IPv6.
もし、同じ hostname に IPv6 アドレスと IPv4 アドレスが存在する場合、cfgmaker は最初に IPv6 でターゲットに問い合わせし、失敗した場合は IPv4 にバージョンを落として問い合わせを行います。
これは、ターゲットが IPv6 上で SNMP をサポートしていない場合に役立ちます。
--use-16bit
This option forces the use of 16bit SNMP request IDs. Some broken SNMP agents do not accept 32bit request IDs. Try to avoid this option as much as possible, complain to your agent vendor instead.
このオプションは 16bit の SNMP Request ID の使用を強制します。
欠陥のある SNMP エージェントは 32bit の Request ID に対応していません。
このオプションはできるだけ使用せずに、代わりにエージェント供給元に文句を言ってください。
--snmp-options=:[][:[][:[][:[][:]]]]
コマンドラインで指定する全てのルータにデフォルトのSNMPオプションを指定します。
router[:[port][:[timeout][:[retries][:[backoff][:version]]]]]
--dns-domain=domain
ルータ名のあとに付けるドメイン名を指定します。
--nointerfaces
インタフェースに関連する行を生成しないようにします。
--interfaces
インタフェースに関連する行を生成します(デフォルト)。
SNMP V3 Options
SNMP V3 のオプション
Cfgmaker supports SNMP V3. There are optional parameters affecting SNMP operation.
Cfgmaker は SNMP V3 をサポートしています。
SNMP の動作に影響する任意のパラメータがあります。
↓
CfgmakerはSNMP V3をサポートし、SNMPの動作を制御するパラメータを指定できます。
↓
Cfgmaker は SNMP V3 をサポートし、SNMP の動作を制御する任意のパラメータがあります。
SNMPv3 Arguments
SNMPv3 の引数
A SNMP context is a collection of management information accessible by a SNMP entity. An item of management information may exist in more than one context and a SNMP entity potentially has access to many contexts. The combination of a contextEngineID and a contextName unambiguously identifies a context within an administrative domain. In a SNMPv3 message, the contextEngineID and contextName are included as part of the scopedPDU. All methods that generate a SNMP message optionally take a --contextengineid and --contextname argument to configure these fields.
SNMPコンテキストはSNMPエンティティによってアクセス可能な管理情報の集まりです。
管理情報の項目は1つ以上のコンテキストに存在するかもしれません。また、
SNMPエンティティは多くのコンテキストにアクセスできる可能性を持っています。
↓
一つの管理情報が複数のコンテキストに存在することもありますし、
一つのSNMPエンティティが複数のコンテキストにアクセスしていることもあります
↓
ある管理情報の項目が1つ以上のコンテキストに存在するかもしれません、また、
場合によってはSNMPエンティティが複数のコンテキストにアクセスする可能性もあります。
contextEngineID と contextName の組み合わせは、コンテキストの管理領域の範囲を明確に識別します。
SNMPv3 のメッセージには、scopedPDU の一部として contextEngineID および contextName が含まれています。
SNMP メッセージを生成する全メソッドには、フィールドを形成するために --contextengineid と --contextname といった引数を任意に指定できます。
Context Engine ID
The --contextengineid argument expects a hexadecimal string representing the desired contextEngineID. The string must be 10 to 64 characters (5 to 32 octets) long and can be prefixed with an optional ``0x''. Once the --contextengineid is specified it stays with the object until it is changed again or reset to default by passing in the undefined value. By default, the contextEngineID is set to match the authoritativeEngineID of the authoritative SNMP engine.
--contextengineid 引数は、求めたい contextEngineID を意味する16進数の文字列を値にとります。
その文字列は、10 〜 64 文字(5 〜 32 オクテット)の長さで、なおかつ任意に"0x"を文字列の前に付けることができます。
いったん --contextengineid を指定すると、その値を再び変更するか、もしくは未定義の値を渡すことによってデフォルト値にリセットするまで、オブジェクトはその状態を維持し続けます。
デフォルトでは、その contextEngineID は信頼できる SNMP エンジンの authoritativeEngineID に合うように設定されています。
Context Name
The contextName is passed as a string which must be 0 to 32 octets in length using the --contextname argument. The contextName stays with the object until it is changed. The contextName defaults to an empty string which represents the ``default'' context.
contextName は --contextname 引数を使用し、文字列として渡されます。その文字列は 0 〜 32 オクテットの長さでなければなりません。
↓
contextName は --contextname 引数を使用して文字列として渡され、その長さは 0 〜 32 オクテットでなければなりません。
contextName は設定が変更されるまで、そのオブジェクトの状態を維持し続けます。
contextName のデフォルトは、"default"コンテキストを意味する空文字列です。
User-based Security Model Arguments
ユーザベースセキュリティモデルの引数
The User-based Security Model (USM) used by SNMPv3 requires that a securityName be specified using the --username argument. The creation of a Net::SNMP object with the version set to SNMPv3 will fail if the --username argument is not present. The --username argument expects a string 1 to 32 octets in length.
SNMPv3 で使用されるユーザベースセキュリティモデル(USM)は、--username 引数に securityName を指定する必要があります。
もし、--username 引数が存在しない場合、SNMPv3 をバージョンとして指定した Net::SNMP オブジェクトの生成は失敗します。
--username 引数は、1 〜 32 オクテット長の文字列を値にとります。
Different levels of security are allowed by the User-based Security Model which address authentication and privacy concerns. A SNMPv3 target will derive the security level (securityLevel) based on which of the following arguments are specified.
セキュリティレベルの違いは、アドレス認証とプライバシーに対する懸念において、ユーザベースセキュリティモデルが許可できる範囲で認められています。
SNMPv3 のターゲットは、次の中からどの引数を指定するかによって、セキュリティレベル(securityLevel)を得ます。
By default a securityLevel of 'noAuthNoPriv' is assumed. If the --authkey or --authpassword arguments are specified, the securityLevel becomes 'authNoPriv'. The --authpassword argument expects a string which is at least 1 octet in length. Optionally, the --authkey argument can be used so that a plain text password does not have to be specified in a script. The --authkey argument expects a hexadecimal string produced by localizing the password with the authoritativeEngineID for the specific destination device. The snmpkey utility included with the Net::SNMP distribution can be used to create the hexadecimal string (see snmpkey).
デフォルトでは、'noAuthNoPriv' が securityLevel に仮の値として設定されています。
もし、--authkey もしくは --authpassword 引数が指定されると、securityLevel は 'authNoPriv' になります。
--authpassword 引数は、少なくとも 1 オクテット長の文字列を値にとります。
オプションに、プレーンテキストのパスワードをスクリプト内に指定する必要をなくために --authkey 引数を使用することができます。
--authkey 引数は、具体的な宛先デバイスのために authoritativeEngineID でパスワードを局所化することによって生成される16進数の文字列を値にとります。
Net::SNMP ディストリビューションに含まれている snmpkey ユーティリティを使用することで、16進数の文字列を生成することができます。(snmpkey を参照してください)
Two different hash algorithms are defined by SNMPv3 which can be used by the Security Model for authentication. These algorithms are HMAC-MD5-96 ``MD5'' (RFC 1321) and HMAC-SHA-96 ``SHA-1'' (NIST FIPS PUB 180-1). The default algorithm used by the module is HMAC-MD5-96. This behavior can be changed by using the --authprotocol argument. This argument expects either the string 'md5' or 'sha' to be passed to modify the hash algorithm.
2 つの異なるハッシュアルゴリズムは、認証用にセキュリティモデルで使用できる SNMPv3 によって定義されます。
これらのアルゴリズムは HMAC-MD5-96 "MD5" (RFC 1321) と HMAC-SHA-96 "SHA-1" (NIST FIPS PUB 180-1) です。
モジュールで使用されるデフォルトのアルゴリズムは、HMAC-MD5-96 です。
その動作は、引数に --authprotocol を使用することによって変更できます。
この引数は、ハッシュアルゴリズムを変更するのに 'md5' もしくは 'sha' 文字列のどちらかを値にとります。
By specifying the arguments --privkey or --privpassword the securityLevel associated with the object becomes 'authPriv'. According to SNMPv3, privacy requires the use of authentication. Therefore, if either of these two arguments are present and the --authkey or --authpassword arguments are missing, the creation of the object fails. The --privkey and --privpassword arguments expect the same input as the --authkey and --authpassword arguments respectively.
引数に --privkey もしくは --privpassword を指定することで、オブジェクトに関連した securityLevel は 'authPriv' になります。
SNMPv3 によると、プライバシーは認証の使用を必要とします。
したがって、--privkey もしくは --privpassword の 2 つのうち、どちらかの引数が存在し、なおかつ、--authkey もしくは --authpassword の引数が存在しない場合は、オブジェクトの生成は失敗します。
--privkey と --privpassword の引数は、それぞれ --authkey と --authpassword の引数と同じ入力値を値にとります。
The User-based Security Model described in RFC 3414 defines a single encryption protocol to be used for privacy. This protocol, CBC-DES ``DES'' (NIST FIPS PUB 46-1), is used by default or if the string 'des' is passed to the --privprotocol argument. By working with the Extended Security Options Consortium http://www.snmp.com/eso/, the module also supports additional protocols which have been defined in draft specifications. The draft http://www.snmp.com/eso/draft-reeder-snmpv3-usm-3desede-00.txt defines the support of CBC-3DES-EDE ``Triple-DES'' (NIST FIPS 46-3) in the User-based Security Model. This protocol can be selected using the --privprotocol argument with the string '3desede'. The draft http://www.snmp.com/eso/draft-blumenthal-aes-usm-04.txt describes the use of CFB128-AES-128/192/256 ``AES'' (NIST FIPS PUB 197) in the USM. The three AES encryption protocols, differentiated by their key sizes, can be selected by passing 'aescfb128', 'aescfb192', or 'aescfb256' to the -privprotocol argument.
RFC 3414 に記述されているユーザベースセキュリティモデルは、プライバシーのために使用する共通の暗号化プロトコルを定めています。
この CBC-DES "DES" (NIST FIPS PUB 46-1) プロトコルは、デフォルトでもしくは、--privprotocol の引数に文字列 'des' を渡したときに使用されます。
↓sample
このCBC-DESなんちらかんちらプロトコルは、--privprotocolに何も指定されていないか、'des'が指定されたときに使われます
Extended Security Options Consortium http://www.snmp.com/eso/ が動作することによって、そのモジュールは仕様書案で定められた追加プロトコルをサポートします。
ドラフト http://www.snmp.com/eso/draft-reeder-snmpv3-usm-3desede-00.txt ユーザベースセキュリティモデルで、CBC-3DES-EDE "Triple-DES" (NIST FIPS 46-3) のサポートについて定めています。
このプロトコルは --privprotocol の引数に文字列 '3desede' を使用することで選択することができます。
ドラフト http://www.snmp.com/eso/draft-blumenthal-aes-usm-04.txt は、USM で、CFB128-AES-128/192/256 "AES" (NIST FIPS PUB 197) の使用について記述しています。
キーのサイズで差別化した 3 つの AES 暗号化プロトコルは、--privprotocol の引数に 'aescfb128', 'aescfb192', または 'aescfb256' を渡すことによって選択することができます。