CQE Repository Script Management Guide
Learn how to manage, execute, and monitor script registration in the CQE (Custom Query Engine) Repository.
📋 Overview
The CQE Repo List provides a centralized repository for your maintenance and diagnostic scripts. You can store scripts once and deploy them across any number of logical servers (LSVR) with custom execution parameters.
🔍 Script Details & Execution
When you click on a script in the list, the detail modal opens with the following capabilities:
1. Script Content
View the full source code of the script. This is read-only in the list view; use the edit feature if modifications are needed.
2. Execution Settings (NEW)
Before registering a script to a server, you can configure how it should run:
- Active: Toggle whether the script is enabled for the selected servers.
- Repeat: If enabled, the script will run periodically.
- Interval (min): Set the frequency for repeated execution (in minutes).
- Start Date: Specify when the first execution should occur.
3. Server Registration (LSVR Queue Put)
You can select one or more servers from your current project to receive this script.
- LSVR Selector: Use the checkboxes to choose target servers.
- Add to Queue: Click this button to register the script with the defined settings for all selected servers.
📊 Script Usage Status
At the bottom of the modal, the Usage Status Table displays all servers currently registered for this specific script.
- Hostname: The name of the server using the script.
- Usage: The logical server's defined purpose.
- Settings: View the active/repeat/interval status for each registration.
- Last Run: Tracks the last time the script was successfully executed on that machine.
API リファレンス
この機能の API 詳細仕様は専用ガイドを参照してください。
トラブルシューティング
| 症状 | 原因 | 解決 |
|---|---|---|
| キュー登録後もスクリプトが実行されない | 実行設定で 有効 (Active) がオフになっている | 詳細モーダルで Active をオンにして再度キューに登録します。 |
| LSVR セレクターに対象サーバーが表示されない | 選択中のプロジェクトにサーバーがない、またはサーバーが別プロジェクトに属している | 上部で正しいプロジェクトを選択しているか確認します。 |
| 繰り返し実行が動作しない | 繰り返し (Repeat) はオンだが 実行間隔 (分) が空になっている | 実行間隔を 1 以上に設定して再登録します。 |
| 登録状況の 最終実行 が更新されない | 対象サーバーのエージェントがまだキューを受信していない | エージェントの接続状態と、開始日時が過去の時刻かを確認します。 |
🔌 CQE API (自動化向け)
上記のUI操作は次のCQE APIバーブ(byAK/bySkディスパッチャ)に対応します。リクエストは text(バーブ+パラメータ名)、jsondata(値)、token を送信します。
- CQERepoPut
msName msDetail msBody msPer msPrice msType— スクリプトをリポジトリに登録。msTypeはps1/cmd/wsf/cmdui/ps1uiのいずれか。- エージェントが実際に参照して分岐するのはこの
msTypeです。 下のCQEQueuePutのscript_typeに異なる値を入れても、実行方式はmsTypeに従います。
- エージェントが実際に参照して分岐するのはこの
- CQEQueuePut
mssn lssngroup csn interval active script_type custom_values repeat startdate auid— サーバーにスクリプトを割り当て。lssngroup: カンマ区切りのLSSN一覧(サーバーごとに1件)。interval: 分。repeat: 0/1 = 一回のみ, 2 = 繰り返し(intervalごとに再実行)。custom_values: サーバー別の注入値 → スクリプト本文の{{CustomVariables}}を置換。auid: 実行担当者のログインID。 この値がtMgmtScriptList.usnになります。スクリプト所有者でもマーケットプレイス購読者でもないユーザーを指定するとRstVal=610で拒否されます(giip #2557)。従来は200で登録され、そのサーバー(lssn)のCQEキュー全体が永久に停止していました。分からない場合は空にするか自分のログインIDを入れてください。
- CQEQueueGet
lssn hostname os op— エージェントがポーリングして次のスクリプト本文を受信。
スクリプト本文のプレースホルダ: {{CustomVariables}}(割り当てごとのcustom_values、サーバー側で注入)、{{sk}}(エージェントトークン)、{{lssn}}(エージェントLSSN)。
実行タイプ(msType)
| 値 | 実行方式 | タイムアウト | 出力収集 |
|---|---|---|---|
ps1 | powershell.exe、ウィンドウなし | 既定 600秒(エージェントの giipAgent.cfg の cqetimeoutsec で調整) | あり |
cmd | cmd.exe、ウィンドウなし | 同じ | あり |
wsf | wscript.exe、ウィンドウなし | 同じ | あり |
cmdui | cmd.exe、画面に見えるコンソールウィンドウ | なし | なし |
ps1ui | powershell.exe、画面に見えるコンソールウィンドウ | なし | なし |
エージェントは各スクリプトを一時ファイルにして実行し、ps1 は Windows PowerShell 5.1 で実行されます。
cmdui / ps1ui(見えるウィンドウ): claude のような対話型プログラムをリモートで起動するためのタイプです。
- 出力を取得しようとすると対話画面が表示されず即座に終了してしまうため、このタイプは実行結果を記録しません。実行履歴には「ウィンドウ起動の成否」までしか残りません(終了コードも実行時間も不明)。
- タイムアウトがないため、人が閉じるまでウィンドウは開いたままです。
- 対象サーバーにユーザーがログオンしており、エージェントがそのユーザーセッションで動作している場合にのみウィンドウが実際に表示されます。
スクリプトは短く保ってください。
完全な仕様: giipdb
docs/30_Specs/CQE_SPECIFICATION.md。
Version: 1.3
Last Updated: 2026-09-15
Source File: giipv3/public/help/cqerepolist.en.md