ファイル・ベースのアクセス方式
ファイル・ベースのアクセス方式を使用すると、サーバーに配置されたファイルからデバイス情報を取得できます。
ファイル・ベース・アクセス方式は、ファイル・サーバーからデバイス情報を取得します。 通常、お客様がデバイス情報をファイル・サーバーにダウンロードしてから、 Netcool Configuration Manager が ftp/scp サーバーからデバイス情報をインポートします。 ファイルは、UOW を処理しているワーカー・サーバーにダウンロードされます。 ワーカー・サーバーは、デバイス情報を含むファイル・サーバーに直接接続します。 情報が取得されると、他のデバイスと同様に処理されます。
- Netcool Configuration Manager Resource Browser で、 をクリックし、 Resource Access のリソースタイプを選択します。注: VTMOS フィルターは、他のリソース・アクセス・リソースと同様に適用できます。
- リソース・アクセスを右クリックし、 「編集」 をクリックして、新規リソース・アクセス・リソースの編集パネルを表示します。
- 「アクセス・タイプ」 タグの 「追加」 をクリックして、 fileという新しいアクセス・タイプを追加します。
- 新しい file アクセス・タイプを選択し、「トランスポート」タブで以下のチェック・ボックスを選択します。
- 有効
- Streaming: 書き込み
- Streaming: Get (ストリーミング: 取得)
- 「SSH オプション」タブで、「SSH タイプ」選択メニューから「 ssh2 」オプションを選択します。
- SSH1 「 des3の暗号」、および aes128の SSH2 暗号を選択します。
- 「コマンド・ライン」タブで、「スクリプト」メニューから 「ファイル」 を選択します。注: 「スクリプト」メニューで file オプションを使用できない場合は、 「スクリプト」 テキスト・フィールドに file と入力します。
- 「構成」タブで、 「ネイティブ比較」 および 「ネイティブ・コマンド・セットの行ごとに許可」のチェック・ボックスを選択します。
- CLIの構成データ・タイプを入力します。
- 「スクリプト」 タブを選択し、 「追加」 をクリックして、 fileという名前の新規スクリプトを作成します。
- テキスト・ウィンドウに必要なスクリプトを入力します。以下に例を示します。
#turn on flags to get info from file server getConfigFileServer=true getModelFileServer=true getDiagFileServer=true getVersionFileServer=true getBinaryFileServer=true putConfigFileServer=true ### Defaults for sending commands. Errors must be separated by , not spaces default.prompt=$ log-in.prompt=$ default.error=Error,Invalid,Incomplete command default.errorResponse=Error sending command ### Connection Global # if connect.* is not present use connect.all.properties connect.errorResponse=Unable to connect to device connect.09.wait=$ # check for Running config and stored config values multipleConfigs or SingleConfig config.check.end=singleConfig # Signals start of config config.start=! # Signals end of config config.end=\nend\r # Identifies error retreiving config. Must be separated by , config.fail=Error,Invalid,Incomplete command # Info # these commands are used to gain some information on the hardware installed # in the device diag.01.setReturnBuff=test# diag.end=$ # Model ## using the command below, or similar, select the text that will allow determination of a model model.01.setReturnBuff=EBS-NSP-6.1 model.end=$ model.FIND-BEGIN= model.FIND-END= # Version ## using the command below, or similar, select the text that will allow determination ## of an OS version config.version.setReturnBuff=<your version value goes here> config.version.end=$ config.version.FIND-BEGIN= config.version.FIND-END= # Running config ### ## The setFtpFileName parameter can be used to specify the file containing the ## configuration content by its exact name if needed. ## To use this parameter, uncomment the following line and supply the file name. ## If you use this parameter, comment out the line for getFtpFileName. ### #config.running.01.setFtpFileName=<filename> ### ## Use the getFtpFileName parameter to identify the file based on the ## name/address of the device. ## The addressName parameter will use the name of the resource. If you modify ## the directory structure on the source file server, then there is one edit to ## the device script required. The "f" parameter in the "cut" operation needs to ## be incremented to match the number of directory levels. If you add a level ## on the source file server, then "-f4" is changed to "-f5" and so on. ## The other change required is an addition of a corresponding directory to the ## /home/icosftp directory to match the source directory. This is required due to ## the way the file-based access method uses the ftp resource. ### ## The end parameter, either first or last, specifies the first or last instance ## of the file based upon the order of the file listing used earlier in the command: ## ls -t lists files with the newest (most recently modified file) listed first. ## ls -tr lists files with oldest (least recently modified file) listed first. ### config.running.01.getFtpFileName=ls -t $ftpPath$/*$addressName$* | cut -d"/" -f4,first config.running.02.getSCP=$ftp_username$:$ftp_password$@$ftp_hostname$:$ftpPath$/$ftp_filename$ config.running.end=$ config.running.FIND-BEGIN=# extended LDIF config.running.FIND-END=numEntries: # Stored config config.stored.send=show startup-config\r config.stored.end=\nend\r config.stored.FIND-BEGIN=version config.stored.FIND-END=\nend\r ### Sends a change back to the file server ftp.01.send=putSCP://$ftp_username$:$ftp_password$@$ftp_hostname$/ $ftp_filename$ running-config\r ftp.09.wait=$ - ここで、デバイスをインポートします。

単一サーバーを使用した NCM ファイル・ベース・ドライバーのセットアップ
概要
別個のサーバーからファイル・ベースのドライバー・アクセス方式を使用してデバイスをインポートすることも、同じワーカー・サーバーからファイル (デバイス) をインポートすることもできます。 2 サーバー・アプローチは、ネットワーク・ポリシーによって Netcool Configuration Manager ワーカー・サーバーとネットワーク EMS またはノードの間の直接対話が防止される実稼働環境で一般的に使用されます。 通常、このファイル・サーバーは DMZ 内にあり、実動デバイスはサーバー上の 1 つの NIC に到達できますが、 Netcool Configuration Manager は別の NIC に到達できます。 その他の状況では、ファイルを同じワーカー・サーバー上に配置することができ、 Netcool Configuration Manager はファイルをあるディレクトリーから別のディレクトリーに転送します。
単一サーバー実装
Netcool Configuration Manager UI からレルムを作成する必要があります。そのレルム内で、認証リソース、ファイル転送リソース、および作成してインポートするネットワーク・リソースを作成する必要があります。 インポートを実行するワーカー・サーバー上に、インポートされるファイル (ソース・ファイル) を保管するための別個のディレクトリーを作成する必要があります。 これらのソース・ファイルは、サーバー上でファイル転送リソースに指定された宛先ディレクトリーに転送されます。
詳細なセットアップ・プロセス
- ユーザー
- アイコスフトピー
- ユーザーのホーム・ディレクトリー
- /home/icosftp
- レルム
- ITNCM/ 単一サーバー
- ワーカー・サーバー上に /home/icosftp/singleという名前のファイル・ディレクトリーを作成します。 このディレクトリーは、ファイルのソース・ディレクトリーを指定します。 icosftp ユーザーに適切な読み取り許可が設定されていることを確認して、すべてのデバイス構成ファイルをこのディレクトリーに配置します。
- 以下のパラメーターを使用してファイル転送リソースを作成します (この FTP リソースはファイルの宛先ディレクトリーを指定します)。
- 氏名
- ftpInfo
- ホスト
- ローカル・ホスト
- ユーザー名
- IcosFTP
- パスワード
- icosftp ユーザーのパスワード
- パス
- /home/icosftp
- パッシブ・モード
- チェックされた
- デフォルトの FTP ユーザーの認証リソースを作成します (まだ存在しない場合)。 以下の設定例では、デフォルトの
icosftpユーザーを使用しています。- ユーザー名
- IcosFTP
- パスワード
- icosftp ユーザーのパスワード
- パスワードの有効化
- 強制ブランク
- 再試行カウント
- 0 (ゼロ)
- 再試行遅延
- 0 (ゼロ)
- 無視
- いいえ
- 名前、ベンダー、タイプ、モデル、および OS を指定してネットワーク・リソースを作成します。
- ネットワークリソースのリソースアクセスを編集するか( ネットワークリソースを右クリックし、 リソースアクセスを選択)、リソースアクセスを作成します( クリック)。注:
- 新規リソース・アクセスを作成する場合
- ファイル・スクリプトをリソース・アクセスに追加します。
- ネットワーク・リソースでリソース・アクセスを編集する場合
- ファイル・スクリプトを変更します。
- 以下の例に示すように、リソース・アクセス文書 (RAD) 内のファイル・スクリプトを編集して、ファイルのソース・ディレクトリーを指定します。
config.running.01.getFtpFileName=ls -t $ftpPath$/single/*$addressName$* | cut -d"/" -f5,first config.running.02.getSCP=$ftp_username$:$ftp_password$@$ftp_hostname$:$ftpPath$/single/$ftp_filename$ config.running.end=$注: ディレクトリ名 single をパスに導入し、ディレクトリの深さを 5 (以前は4)に変更したことに注目。 - ネットワーク・デバイスをインポートします。
指定された構成ファイルへの変更の書き込み
NSM REST API (GUI は除く) を使用して、ファイル・ベースのアクセス権限を持つデバイスの名前付きファイルおよびディレクトリーに対して、フル・デバイス構成またはフル・デバイス・サービス構成を書き込みまたは削除することができます。 サービスとは、デバイスの全構成のサブセットです。 いずれか一方のデバイスに対して、デバイス構成またはデバイス・サービス構成のいずれかを作成および削除できます。両方を作成および削除することはできません。
ローカル・システムおよびリモート・システムでのディレクトリー・パスおよび構成ファイルの作成
ディレクトリー・パスと構成ファイルを作成するには、NSM REST API を使用してサービスをポストします。 サービス・テンプレートで、サービス・テンプレートの CUSTOM_UOW_LABEL_1 uowParameter にディレクトリー・パスとファイル名を指定します。 例えば、MAC999999/SN77777_1.xml などです。
指定したディレクトリーとファイルは、ローカル・ファイル・システム上の $ftpPath$/$addressName$ ディレクトリーの下に作成されます。
構成ファイルには、デバイスまたはデバイス・サービスの完全な構成が含まれています。 ディレクトリーとファイル名は、リモート・システム上の $ftp_altpath$ ディレクトリーの下に作成されます。 このファイルには、デバイスまたはデバイス・サービスの完全な構成が含まれています。
ディレクトリー名およびファイル名に有効な文字は、英数字と以下の文字です。
-
_
.
/ (for path separator only)
2 つの装置が同じユーザー提供パスを共用することはできません。
デバイス・スクリプトを使用してサービス構成更新用の初期構成ファイルを作成する場合は、サービスの通知時に使用されるサービス・テンプレートまたはコマンド・セットに、完全なサービス構成が含まれていることを確認してください。 ユーザー提供のデバイス・スクリプトで処理できない場合は、 $addressName$.cfg をユーザー提供のファイル名として使用しないでください。
デバイス・スクリプトを使用してデバイス構成更新用の初期構成ファイルを作成する場合は、サービスの通知時に使用されるサービス・テンプレートまたはコマンド・セットに、完全なデバイス構成が含まれていることを確認してください。 デバイスのサービスの各ポストは、同じディレクトリー・パスと構成ファイル名を使用する必要があります。
全構成のインポート
ダミー値を使用して初期構成ファイル $ftpPath$/$addressNam $addressName$.cfg を作成するスクリプトを作成する必要があります。
デバイス構成を更新する場合は、作成後の最初のインポート時にこのスクリプトを実行します。以降のサービス投稿や構成インポートには実行しません。
サービス構成の更新の場合は、作成後の最初のインポート時にこのスクリプトを実行します。 後続のインポート時に、このスクリプトは、各「サービス」構成ファイルを $ftpPath$/$addressName$ ディレクトリー内のデバイス構成ファイル $addressName$.cfg に集約します。 このファイルは、デバイスのインポート操作に使用されます。
サービスまたはデバイスに関連付けられた構成ファイルの削除
以下の考慮事項は、ローカル・システムとリモート・システムの両方に適用されます。
REST Delete およびポストされたサービスのサービス ID を使用してサービスを削除すると、サービスの元のポストに関連付けられていた構成ファイルが削除されます。
デバイスに関連付けられた構成ファイルを削除すると、完全な構成が削除されます。これは、完全な構成が元のサービスの操作後に提供されたためです。
装置が削除されたときの装置構成ファイルの削除
以下の考慮事項は、ローカル・システムとリモート・システムの両方に適用されます。
デバイスの削除と同時にデバイスの構成ファイルを削除するには、以下の手順を実行します。
- デバイスを削除するサービスをポストし、サービス・テンプレート
CUSTOM_UOW_LABEL_1uowParameterに値delete_device_file_based_configsを指定します。 delete_device_file_based_configs値を指定します。
デバイスが削除され、 $ftpPath$/$addressName$ ディレクトリーとそれに含まれるすべてのファイルおよびサブディレクトリーがローカル・ファイル・システムから削除されます。
$ftpPath$/$addressName$ の下のいずれかのファイルまたはサブディレクトリーがリモート・システム上の $ftp_altpath$ の下にも存在する場合、それらのファイルまたはサブディレクトリーもその場所から削除されます。
指定された構成ファイルに変更を書き込むには、以下のステップを実行します。
- 上記の説明に従って、ファイル・ベースのアクセスをセットアップします。
- デフォルトの FTP ユーザーの認証リソースを作成します (まだ存在しない場合)。 以下の設定例では、デフォルトの
icosftpユーザーを使用しています。- ユーザー名
- IcosFTP
- パスワード
- icosftp ユーザーのパスワード
- パスワードの有効化
- 強制ブランク
- 再試行カウント
- 0 (ゼロ)
- 再試行遅延
- 0 (ゼロ)
- 無視
- いいえ
- FTP リソースを作成して、ファイルの宛先ディレクトリーを指定します。
- 新規エントリーを追加し、以下のパラメーターを設定します。
- 名前: ftpInfo
- Host: localhost
- ユーザー名: icosftp
- パスワード: icosftp ユーザーのパスワード
- パス: /home/icosftp
- パッシブ・モード: チェック・マークなし
- 別のエントリーを追加し、以下のパラメーターを設定します。
- 名前: altftpInfo
- ホスト: リモート・ホストのアドレス
- ユーザー名: icosftp
- パスワード: icosftp ユーザーのパスワード
- パス: /home/icosftp
- パッシブ・モード: チェック・マークなし
- 新規エントリーを追加し、以下のパラメーターを設定します。
- カスタム・ファイル名に使用するカスタム UOW ラベルを作成します。
- システムマネージャから選択します。
- 「カスタム UOW ラベル 1」プロパティーを Config_Dir_Name に設定します。
- カスタム UOW ラベル 1 の状態を値「オプション」に設定します。
ステップ 5(デバイス構成の更新の場合) またはステップ 6 (サービス構成の更新の場合) のいずれかを実行します。
新しい構成ファイルを生成するスクリプトを作成します。 このスクリプトは、ステップ 5.bに示すように、リソース・アクセス・デバイス・スクリプトから実行されます。 スクリプトは、以下の結果を達成する必要があります。
- 最初の作成後にデバイスに初期構成を指定する場合、スクリプトは、スクリプトに渡されるディレクトリーとファイル名を使用して新規構成ファイルを作成し (ファイルがまだ存在しない場合)、そのファイルにデータを追加する必要があります。
- 構成ファイルがデバイス用に既に存在する場合は、構成ファイルを作成したり、構成ファイルにデータを追加したりしないでください。
- データを返しません。 返されたデータが構成に追加されます。
chmod 777コマンドを使用して、デバイスの初期構成ファイルの許可を変更します。 このスクリプトは通常、icosuserとして実行されますが、FTP は通常、icosftpユーザーとして実行されます。
ファイル・ベースのデバイス・アクセス用に以前に作成したリソース・アクセス権限を編集し、 「ファイル」 アクセス・タイプを選択して、以下の変更を行います。
- 「トランスポート」 タブの 「ストリーミング: 書き込み」 のチェック・マークを外します。
- 「構成」 タブの 「変更時に更新」 にチェック・マークを付けます。
- デバイス・スクリプトを編集して、以下の変更を行います。
# Device script propertiesセクションで、putConfigFileServerをputConfigFileServer=configured_for_remote_scpに変更します。新規デバイス・スクリプトの
removeConfigDirセクションを追加します。# New section in device script, removes all config files and directories for a device, both locally and remotely. removeConfigDir.01.getDeviceFileDirContent=ls $ftpPath$/$addressName$/ | cut -d"/" -f5,all removeConfigDir.02.removeRemoteContent=$ftp_altusername$:$ftp_altpassword$@$ftp_althostname$:$ftp_altpath$/$device_file_dir_content$ removeConfigDir.03.exec=rm -rf $ftpPath$/$addressName$\r新規デバイス・スクリプトの
removeConfigFileセクションを追加します。# New 'removeConfigFile' section. # Removes a config file for a device, both locally and remotely, this will be triggered as a result of a 'delete service' being performed. # 'Update on Change' should be set in the Resource access, so that changes here will be reflected in the configuration. removeConfigFile.01.removeRemoteContent=$ftp_altusername$:$ftp_altpassword$@$ftp_althostname$:$ftp_altpath$/$config_dir$/$ftp_filename$ removeConfigFile.02.exec=rm -rf $ftpPath$/$addressName$/$config_dir$/$ftp_filename$\r removeConfigFile.03.exec=rm -rf $ftpPath$/$addressName$/$addressName$.cfg\rデバイス・スクリプトの
config.runningセクションで、ファイル・ベースの例のconfig.running.01およびconfig.running.02を以下の行に置き換えます。config.running.01.exec=mkdir -p $ftpPath$/$addressName$\r config.running.02.exec=$ftpPath$/telus_script_for_initial_config.sh -d $ftpPath$/$addressName$ -f $addressName$.cfg\r config.running.03.setFileName=$addressName$.cfg config.running.04.setSubDirForFtpPath=$addressName$ config.running.05.readSCPFile=$ftpPath$/$subDirForFtpPath$/$ftpFileName$注:config.running.02.execで始まる行はオプションです。 これは、デバイスの作成後の最初のインポート時に有効になる初期デフォルト構成をセットアップする方法の例として提供されています。 スクリプト名script_for_initial_config.shを、このステップで作成したスクリプトに置き換えます。 スクリプトの場所、および前のコード内の引数名-dと-fは変更できます。
- ホスト上に
cp -i別名がセットアップされている場合は、unalias cp -iを使用して別名を定義解除します。そうしないと、cp -fは次のステップで動作しません。 デバイス・スクリプトの
ftpセクションで、例のftpセクション全体を以下の行に置き換えます。ftp.01.exec=mkdir -p $ftpPath$/$addressName$/$config_dir$/\r ftp.02.exec=mv -f $ftpPath$/$ftp_filename$ $ftpPath$/$addressName$/$config_dir$/\r ftp.03.exec=cp -f $ftpPath$/$addressName$/$config_dir$/$ftp_filename$ $ftpPath$/$addressName$/$addressName$.cfg\r ftp.04.setSubDirForFtpPath=$addressName$/$config_dir$ ftp.05.scpFile=$ftp_altusername$:$ftp_altpassword$@$ftp_althostname$:$ftp_altpath$/$config_dir$/r
- サービス構成の更新の場合はステップ 6、デバイス構成の更新の場合はステップ 5 のいずれかを実行します。
新しい構成ファイルを生成するスクリプトを作成します。 このスクリプトは、リソース・アクセス・デバイス・スクリプトから実行されます。 スクリプトは、以下の結果を達成する必要があります。
- 最初の作成後にデバイスに初期構成を指定する場合、スクリプトは、スクリプトに渡されるディレクトリーとファイル名を使用して新規構成ファイルを作成し (ファイルがまだ存在しない場合)、そのファイルにデータを追加する必要があります。
- ディレクトリー $ftpPath$/$addressName$ にあるすべてのサービス構成ファイルを、インポート用の単一のデバイス構成ファイル $addressName$.cfgに集約します。
- 個々のサービス構成ファイルをデバイス構成ファイルに集約するための特定の順序付け要件またはフォーマット要件を処理します。
- データを返しません。 返されたデータが構成に追加されます。
chmod 777コマンドを使用して、デバイスの初期構成ファイルの許可を変更します。 このスクリプトは通常、icosuserとして実行されますが、FTP は通常、icosftpユーザーとして実行されます。
ファイル・ベースのデバイス・アクセス用に以前に作成したリソース・アクセス権限を編集し、 「ファイル」 アクセス・タイプを選択して、以下の変更を行います。
- 「トランスポート」 タブの 「ストリーミング: 書き込み」 のチェック・マークを外します。
- 「構成」 タブの 「変更時に更新」 にチェック・マークを付けます。
- デバイス・スクリプトを編集して、以下の変更を行います。
# Device script propertiesセクションで、putConfigFileServerをputConfigFileServer=configured_for_remote_scpに変更します。新規デバイス・スクリプトの
removeConfigDirセクションを追加します。# New section in device script, removes all config files and directories for a device, both locally and remotely. removeConfigDir.01.getDeviceFileDirContent=ls $ftpPath$/$addressName$/ | cut -d"/" -f5,all removeConfigDir.02.removeRemoteContent=$ftp_altusername$:$ftp_altpassword$@$ftp_althostname$:$ftp_altpath$/$device_file_dir_content$ removeConfigDir.03.exec=rm -rf $ftpPath$/$addressName$\r新規デバイス・スクリプトの
removeConfigFileセクションを追加します。# New 'removeConfigFile' section. # Removes a config file for a device, both locally and remotely, this will be triggered as a result of a 'delete service' being performed. # 'Update on Change' should be set in the Resource access, so that changes here will be reflected in the configuration. removeConfigFile.01.removeRemoteContent=$ftp_altusername$:$ftp_altpassword$@$ftp_althostname$:$ftp_altpath$/$config_dir$/$ftp_filename$ removeConfigFile.02.exec=rm -rf $ftpPath$/$addressName$/$config_dir$/$ftp_filename$\r removeConfigFile.03.exec=rm -rf $ftpPath$/$addressName$/$addressName$.cfg\rデバイス・スクリプトの
config.runningセクションで、ファイル・ベースの例のconfig.running.01およびconfig.running.02を以下の行に置き換えます。config.running.01.exec=mkdir -p $ftpPath$/$addressName$\r config.running.02.exec=$ftpPath$/telus_script_for_initial_config.sh -d $ftpPath$/$addressName$ -f $addressName$.cfg\r config.running.03.setFileName=$addressName$.cfg config.running.04.setSubDirForFtpPath=$addressName$ config.running.05.readSCPFile=$ftpPath$/$subDirForFtpPath$/$ftpFileName$注:config.running.02.execで始まる行はオプションです。 これは、デバイスの作成後の最初のインポート時に有効になる初期デフォルト構成をセットアップする方法の例として提供されています。 スクリプト名script_for_initial_config.shを、このステップで作成したスクリプトに置き換えます。 スクリプトの場所、および前のコード内の引数名-dと-fは変更できます。
- ホスト上に
cp -i別名がセットアップされている場合は、unalias cp -iを使用して別名を定義解除します。そうしないと、cp -fは次のステップで動作しません。 デバイス・スクリプトの
ftpセクションで、例のftpセクション全体を以下の行に置き換えます。ftp.01.exec=mkdir -p $ftpPath$/$addressName$/$config_dir$/\r ftp.02.exec=mv -f $ftpPath$/$ftp_filename$ $ftpPath$/$addressName$/$config_dir$/\r ftp.03.exec=cp -f $ftpPath$/$addressName$/$config_dir$/$ftp_filename$ $ftpPath$/$addressName$/$addressName$.cfg\r ftp.04.setSubDirForFtpPath=$addressName$/$config_dir$ ftp.05.scpFile=$ftp_altusername$:$ftp_altpassword$@$ftp_althostname$:$ftp_altpath$/$config_dir$/r
- サービス・テンプレートを編集して、
CUSTOM_UOW_LABEL_1という名前の新しいパラメーターuowParameterを組み込みます。 このパラメーターを追加すると、REST 呼び出しで構成ファイル名を渡すことができます。 以下のサービス・テンプレートの例は、新規パラメーターが追加された snmp contact および snmp location エレメントを構成に追加するコマンド・セットを示しています。<serviceTemplate name="SNMP_test" description="NSM Service Template to add and delete SNMP info"> <clientParameters> <clientParameter> <name>LOCATION</name> </clientParameter> <clientParameter> <name>CONTACT</name> </clientParameter> </clientParameters> <uowParameters> <uowParameter> <name>CUSTOM_UOW_LABEL_1</name> <description>The configuration file name</description> </uowParameter> </uowParameters> <implementations> <implementation> <rules> <rule type="DeviceType"> <ruleProperty name="Vendor" value="mediatrix"/> <ruleProperty name="Type" value=".*"/> <ruleProperty name="Model" value=".*"/> <ruleProperty name="OS" value=".*"/> </rule> </rules> <serviceOperations> <serviceOperation type="CREATE"> <operations> <operation name="ITNCM/mediatrix/SNMP-add" type="COMMANDSET"> <parameters> <parameter name="LOCATION"/> <parameter name="CONTACT"/> </parameters> </operation> </operations> </serviceOperation> <serviceOperation type="DELETE"> <operations> <operation name="ITNCM/mediatrix/SNMP-delete" type="COMMANDSET"> <parameters> <parameter name="LOCATION"/> <parameter name="CONTACT"/> </parameters> </operation> </operations> </serviceOperation> </serviceOperations> </implementation> </implementations> </serviceTemplate>以下のサービス・テンプレートの例では、デバイスが削除され、新しいパラメーターが追加されています。
<?xml version="1.0" encoding="UTF-8"?> <serviceTemplate name="remove_device" description="To remove devices"> <uowParameters> <uowParameter> <name>CUSTOM_UOW_LABEL_1</name> <description>The configuration file name</description> </uowParameter> </uowParameters> <implementations> <implementation> <rules> <rule type="DeviceType"> <ruleProperty name="Vendor" value="Mediatrix"/> <ruleProperty name="Type" value=".*"/> <ruleProperty name="Model" value=".*"/> <ruleProperty name="OS" value=".*"/> </rule> </rules> <serviceOperations> <serviceOperation type="CREATE"> <operations> <operation name="REMOVE" type="REMOVE"> </operation> </operations> </serviceOperation> <serviceOperation type="DELETE"> <operations> <operation name="REMOVE" type="REMOVE"> </operation> </operations> </serviceOperation> </serviceOperations> </implementation> </implementations> </serviceTemplate> - GUI を使用して構成の更新を実行依頼する場合は、 「作業の説明 (Describe Work)」 画面の 「Config_Dir_Name」 フィールドに構成ファイルのカスタム名を入力します。
以下の NSM サービス POST 本文の例では、構成ファイル名を MAC999999/SN77777_1.xmlとして定義しています。
XML の例:
<serviceTemplate id="101"> <deviceID>402</deviceID> <uowParameters> <uowParameter> <name>CUSTOM_UOW_LABEL_1</name> <value>mediatrix_device.cfg</value> </uowParameter> </uowParameters> <clientParameters> <clientParameter> <name>LOCATION</name> <value>The Shire</value> </clientParameter> <clientParameter> <name>CONTACT</name> <value>Bilbo Baggins</value> </clientParameter> </clientParameters> </serviceTemplate>JSON の例:
{ "serviceTemplateId" : "101", "deviceID": "402", "clientParameters": [ { "name": "LOCATION", "value": "The Shire" }, { "name": "CONTACT", "value": "Bilbo Baggins" } ], "uowParameters": [ { "name": "CUSTOM_UOW_LABEL_1", "value": "MAC999999/SN77777_1.xml" } ] }以下のデバイスを削除するための NSM サービス POST 本体の例には、デバイスに関連付けられた構成ファイルの削除をトリガーする
delete_device_file_based_configs値が含まれています。XML の例:
<serviceTemplate id="105"> <deviceID>3207</deviceID> <uowParameters> <uowParameter> <name>CUSTOM_UOW_LABEL_1</name> <value>delete_device_file_based_configs</value> </uowParameter> </uowParameters> </serviceTemplate>JSON の例
{ "id" : "105", "deviceID": "3207", "uowParameters": [ { "name": "CUSTOM_UOW_LABEL_1", "value": "delete_device_file_based_configs" } ] }