検索クエリーを入力してください
<book_title> を検索 ...
Cluster Server 7.3.1 エージェント開発者ガイド - AIX、Linux、Solaris、Windows
Last Published:
2018-01-17
Product(s):
InfoScale & Storage Foundation (7.3.1)
- 概要
- エージェントのエントリポイントの概要
- エージェントのエントリポイントについて
- エージェントエントリポイントの説明
- action エントリポイントについて
- info エントリポイントについて
- C++ またはスクリプトエントリポイントの使用上の注意事項
- エージェント情報ファイルについて
- ArgList 属性と ArgListValues 属性について
- C++ でのエントリポイントの作成
- C++ でのエントリポイントの作成について
- C++ のエントリポイントの構文
- エージェントフレームワークの基本関数
- コンテナサポートのためのエージェントフレームワーク基本関数
- スクリプトでのエントリポイントの作成
- スクリプトでのエントリポイントの作成について
- スクリプトエントリポイントの構文
- エージェントフレームワークの基本関数
- VCSAG_GET_ATTR_VALUE
- コンテナをサポートするエージェントフレームワーク基本関数
- スクリプトのエントリポイントの例
- エージェントメッセージのログ
- カスタムエージェントの作成
- スクリプトベースの IMF 対応カスタムエージェントの作成
- エージェントのテスト
- 静的タイプ属性
- 静的属性について
- 静的タイプ属性の定義
- AdvDbg
- ArgList
- 状態の遷移図
- 国際化されたメッセージ
- First Failure Data Capture(FFDC)を使用した VCS リソースの予期しない動作のトラブルシューティング
- 付録 A. 5.0 より前の VCS エージェントの使用
例: C++ での info エントリポイントの実装
VCSAgValidateAndSetEntryPoint() パラメータを、エントリポイントの関数(res_info)の名前に設定します。
次の例に示すように、エントリポイントに info 出力バッファを割り当てます。バッファは任意のサイズにできますが(例では 80)、エージェントフレームワークにより 2048 バイトに切り捨てられます。省略可能な名前と値の組み合わせでは、名前と値のそれぞれに 4096 バイトの限度があります(例では 15 を使用)。
V51 エントリポイントの例:
extern "C" unsigned int res_info(const char *res_name, VCSAgResInfoOp resinfo_op, void **attr_val, char **info_output, char ***opt_update_args, char ***opt_add_args) { struct stat stat_buf; int I; char **args = NULL; char *out = new char [80]; *info_output = out; VCSAgSnprintf(out, 80,"Output of info entry point - updates the \"Msg\" key in ResourceInfo attribute"); // Use the stat system call on the file to get its // information The attr_val array will look like "PathName" // "1" "<pathname value>" ... Assuming that PathName is the // first attribute in the attr_val array, the value // of this attribute will be in index 2 of this attr_val // array if (attr_val[2]) { if ((strlen((CHAR *)(attr_val[2])) != 0) && (stat((CHAR *)(attr_val[2]), &stat_buf) == 0)) { if (resinfo_op == VCSAgResInfoAdd) { // Add and initialize all the static and // dynamic keys in the ResourceInfo attribute args = new char * [7]; for (I = 0; I < 6; I++) { args[i] = new char [15]; } // All the static information - file owner // and group VCSAgSnprintf(args[0], 15, "%s", "Owner"); VCSAgSnprintf(args[1], 15, "%d", stat_buf.st_uid); VCSAgSnprintf(args[2], 15, "%s", "Group"); VCSAgSnprintf(args[3], 15, "%d", stat_buf.st_gid); // Initialize the dynamic information for the file VCSAgSnprintf(args[4], 15, "%s", "FileSize"); VCSAgSnprintf(args[5], 15, "%d", stat_buf.st_size); args[6] = NULL; *opt_add_args = args; } else { // Simply update the dynamic keys in the // ResourceInfo attribute. In this case, the // dynamic info on the file args = new char * [3]; for (I = 0; I < 2; I++) { args[i] = new char [15]; } VCSAgSnprintf(args[0], 15, "%s", "FileSize"); VCSAgSnprintf(args[1], 15, "%d", stat_buf.st_size); args[2] = NULL; *opt_update_args = args; } } else { // Set the output to indicate the error VCSAgSnprintf(out, 80, "Stat on the file %s failed", attr_val[2]); return 1; } } else { // Set the output to indicate the error VCSAgSnprintf(out, 80, "Error in arglist values passed to the info entry point"); return 1; } // Successful completion of the info entry point return 0; } // End of entry point definition