integer/array itemprototype.get(object parameters)
このメソッドを使用すると、指定されたパラメーターに従ってアイテムのプロトタイプを取得できます。
このメソッドはどのタイプのユーザーでも利用可能です。このメソッドを呼び出す権限は、ユーザーロール設定で取り消すことができます。詳しくはユーザーの役割を参照してください。
(object) 目的の出力を定義するパラメーター
このメソッドは、次のパラメーターをサポートしています
| パラメータ | タイプ | 説明 | 
|---|---|---|
| discoveryids | string/array | 指定された LLD ルールに属するアイテム プロトタイプのみを返します | 
| graphids | string/array | 指定されたグラフ プロトタイプで使用されているアイテム プロトタイプのみを返します | 
| hostids | string/array | 指定されたホストに属するアイテム プロトタイプのみを返します | 
| inherited | boolean | trueに設定すると、テンプレートから継承されたアイテム プロトタイプのみが返されます | 
| itemids | string/array | 指定された ID を持つアイテム プロトタイプのみを返します | 
| monitored | boolean | trueに設定すると監視対象ホストに属する有効なアイテム プロトタイプのみが返されます | 
| templated | boolean | trueに設定するとテンプレートに属するアイテム プロトタイプのみが返されます | 
| templateids | string/array | 指定されたテンプレートに属するアイテム プロトタイプのみを返します | 
| triggerids | string/array | 指定されたトリガー プロトタイプで使用されるアイテム プロトタイプのみを返します | 
| selectDiscoveryRule | query | アイテムプロトタイプが属するローレベルディスカバリルールを含むdiscoveryRuleプロパティを返します | 
| selectGraphs | query | アイテム プロトタイプが使用されているグラフ プロトタイプを含むgraph_prototypeプロパティを返します。 countをサポートします | 
| selectHosts | query | アイテムのプロトタイプが属するホストの配列を持つ hosts プロパティを返します | 
| selectTags | query | tags プロパティでアイテム プロトタイプ タグを返します | 
| selectTriggers | query | アイテム プロトタイプが使用されているトリガー プロトタイプを含むtriggersプロパティを返します。 countをサポートします。 | 
| selectPreprocessing | query | アイテムの事前処理オプションを含む事前処理プロパティを返します。 次のプロパティがあります: type-(string)事前処理オプションタイプ:1 - カスタム乗数 2 - 右トリム 3 - 左トリム 4 - トリム 5 - 正規表現一致 6 - ブール値から10進数へ 7 - 8進数から10進数へ 8 - 16進数から10進数へ 9 - 単純な変更 10 - 1 秒ごとの変更 11 - XML XPath 12 - JSONPath 13 - 範囲内 14 - 正規表現に一致 15 - 正規表現に一致しない 16 - JSON のエラーをチェック 17 - XMLエラーをチェック 18 - 正規表現を使用してエラーをチェック 19 - 変更なしで破棄 20 - ハートビートで変更なしで破棄 21 - JavaScript 22 - Prometheusパターン 23 - PrometheusからJSON 24 - CSV から JSON 25 - 置換 26 - サポートされていない値のチェック 27 - XMLからJSON params-(string)追加パラメータ前処理オプションで使用されます。複数のパラメータは LF(\n) 文字で区切られます。error_handler-(string)前処理ステップが失敗した場合に使用されるアクション タイプ:0 - エラー メッセージは Zabbix サーバーによって設定されます。 1 - 値を破棄します。 2 - カスタム値を設定します。 3 - カスタム エラー メッセージを設定します。 error_handler_params-(string)エラーハンドラパラメータ | 
| selectValueMap | query | アイテム プロトタイプ値マップを含むvaluemapプロパティを返します | 
| filter | object | 指定されたフィルタに正確に一致する結果のみを返します。 配列を受け入れます。キーはプロパティ名で、値は単一の値または照合する値の配列です。 <br >追加のフィルタをサポート: host- アイテム プロトタイプが属するホストの技術名 | 
| limitSelects | integer | 副選択によって返されるレコードの数を制限します 次のサブセレクトに適用されます selectGraphs- 結果はnameでソートされますselectTriggers- 結果はdescriptionでソートされます | 
| sortfield | string/array | 指定されたプロパティで結果を並べ替えます。 可能な値は次のとおりです: itemid,name,key_,delay,type,status | 
| countOutput | boolean | すべての getメソッドに共通するこれらのパラメーターについてはリファレンス解説ページで詳しく説明されています。 | 
| editable | boolean | |
| excludeSearch | boolean | |
| limit | integer | |
| output | query | |
| preservekeys | boolean | |
| search | object | |
| searchByAny | boolean | |
| searchWildcardsEnabled | boolean | |
| sortorder | string/array | |
| startSearch | boolean | 
(integer/array) 次のいずれかを返します:
countOutputパラメータが使用されている場合、取得されたオブジェクトの数特定の LLD ルール ID のすべてのアイテム プロトタイプを取得します。
Request:
{
           "jsonrpc": "2.0",
           "method": "itemprototype.get",
           "params": {
               "output": "extend",
               "discoveryids": "27426"
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }Response:
{
           "jsonrpc": "2.0",
           "result": [
               {
                   "itemid": "23077",
                   "type": "0",
                   "snmp_oid": "",
                   "hostid": "10079",
                   "name": "Incoming network traffic on en0",
                   "key_": "net.if.in[en0]",
                   "delay": "1m",
                   "history": "1w",
                   "trends": "365d",
                   "status": "0",
                   "value_type": "3",
                   "trapper_hosts": "",
                   "units": "bps",
                   "logtimefmt": "",
                   "templateid": "0",
                   "valuemapid": "0",
                   "params": "",
                   "ipmi_sensor": "",
                   "authtype": "0",
                   "username": "",
                   "password": "",
                   "publickey": "",
                   "privatekey": "",
                   "interfaceid": "0",
                   "description": "",
                   "evaltype": "0",
                   "jmx_endpoint": "",
                   "master_itemid": "0",
                   "timeout": "3s",
                   "url": "",
                   "query_fields": [],
                   "posts": "",
                   "status_codes": "200",
                   "follow_redirects": "1",
                   "post_type": "0",
                   "http_proxy": "",
                   "headers": [],
                   "retrieve_mode": "0",
                   "request_method": "0",
                   "output_format": "0",
                   "ssl_cert_file": "",
                   "ssl_key_file": "",
                   "ssl_key_password": "",
                   "verify_peer": "0",
                   "verify_host": "0",
                   "allow_traps": "0",
                   "discover": "0",
                   "uuid": "",
                   "parameters": []
               },
               {
                   "itemid": "10010",
                   "type": "0",
                   "snmp_oid": "",
                   "hostid": "10001",
                   "name": "Processor load (1 min average per core)",
                   "key_": "system.cpu.load[percpu,avg1]",
                   "delay": "1m",
                   "history": "1w",
                   "trends": "365d",
                   "status": "0",
                   "value_type": "0",
                   "trapper_hosts": "",
                   "units": "",
                   "logtimefmt": "",
                   "templateid": "0",
                   "valuemapid": "0",
                   "params": "",
                   "ipmi_sensor": "",
                   "authtype": "0",
                   "username": "",
                   "password": "",
                   "publickey": "",
                   "privatekey": "",
                   "interfaceid": "0",
                   "description": "The processor load is calculated as system CPU load divided by number of CPU cores.",
                   "evaltype": "0",
                   "jmx_endpoint": "",
                   "master_itemid": "0",
                   "timeout": "3s",
                   "url": "",
                   "query_fields": [],
                   "posts": "",
                   "status_codes": "200",
                   "follow_redirects": "1",
                   "post_type": "0",
                   "http_proxy": "",
                   "headers": [],
                   "retrieve_mode": "0",
                   "request_method": "0",
                   "output_format": "0",
                   "ssl_cert_file": "",
                   "ssl_key_file": "",
                   "ssl_key_password": "",
                   "verify_peer": "0",
                   "verify_host": "0",
                   "allow_traps": "0",
                   "lastclock": "0",
                   "lastns": "0",
                   "lastvalue": "0",
                   "prevvalue": "0",
                   "discover": "0",
                   "uuid": "",
                   "parameters": []
               }
           ],
           "id": 1
       }アイテムID"25545"の依存アイテムを 1 つ検索します。
Request:
{
           "jsonrpc": "2.0",
           "method": "item.get",
           "params": {
               "output": "extend",
               "filter": {
                   "type": "18",
                   "master_itemid": "25545"
               },
               "limit": "1"
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }Response:
{
           "jsonrpc": "2.0",
           "result": [
               {
                   "itemid": "25547",
                   "type": "18",
                   "snmp_oid": "",
                   "hostid": "10116",
                   "name": "Seconds",
                   "key_": "apache.status.uptime.seconds",
                   "delay": "0",
                   "history": "90d",
                   "trends": "365d",
                   "status": "0",
                   "value_type": "3",
                   "trapper_hosts": "",
                   "units": "",
                   "logtimefmt": "",
                   "templateid": "0",
                   "valuemapid": "0",
                   "params": "",
                   "ipmi_sensor": "",
                   "authtype": "0",
                   "username": "",
                   "password": "",
                   "publickey": "",
                   "privatekey": "",
                   "interfaceid": "0",
                   "description": "",
                   "evaltype": "0",
                   "master_itemid": "25545",
                   "jmx_endpoint": "",
                   "timeout": "3s",
                   "url": "",
                   "query_fields": [],
                   "posts": "",
                   "status_codes": "200",
                   "follow_redirects": "1",
                   "post_type": "0",
                   "http_proxy": "",
                   "headers": [],
                   "retrieve_mode": "0",
                   "request_method": "0",
                   "output_format": "0",
                   "ssl_cert_file": "",
                   "ssl_key_file": "",
                   "ssl_key_password": "",
                   "verify_peer": "0",
                   "verify_host": "0",
                   "allow_traps": "0",
                   "discover": "0",
                   "uuid": "",
                   "parameters": []
               }
           ],
           "id": 1
       }特定のホスト ID のリクエスト メソッド HEAD を持つ HTTP エージェント アイテム プロトタイプを検索します。
Request:
{
           "jsonrpc": "2.0",
           "method": "itemprototype.get",
           "params": {
               "hostids": "10254",
               "filter": {
                   "type": "19",
                   "request_method": "3"
               }
           },
           "id": 17,
           "auth": "d678e0b85688ce578ff061bd29a20d3b"
       }Response:
{
           "jsonrpc": "2.0",
           "result": [
               {
                   "itemid": "28257",
                   "type": "19",
                   "snmp_oid": "",
                   "hostid": "10254",
                   "name": "discovered",
                   "key_": "item[{#INAME}]",
                   "delay": "{#IUPDATE}",
                   "history": "90d",
                   "trends": "30d",
                   "status": "0",
                   "value_type": "3",
                   "trapper_hosts": "",
                   "units": "",
                   "logtimefmt": "",
                   "templateid": "28255",
                   "valuemapid": "0",
                   "params": "",
                   "ipmi_sensor": "",
                   "authtype": "0",
                   "username": "",
                   "password": "",
                   "publickey": "",
                   "privatekey": "",
                   "interfaceid": "2",
                   "description": "",
                   "evaltype": "0",
                   "jmx_endpoint": "",
                   "master_itemid": "0",
                   "timeout": "3s",
                   "url": "{#IURL}",
                   "query_fields": [],
                   "posts": "",
                   "status_codes": "",
                   "follow_redirects": "0",
                   "post_type": "0",
                   "http_proxy": "",
                   "headers": [],
                   "retrieve_mode": "0",
                   "request_method": "3",
                   "output_format": "0",
                   "ssl_cert_file": "",
                   "ssl_key_file": "",
                   "ssl_key_password": "",
                   "verify_peer": "0",
                   "verify_host": "0",
                   "allow_traps": "0",
                   "discover": "0",
                   "uuid": "",
                   "parameters": []
               }
           ],
           "id": 17
       }CItemPrototype::get() in ui/include/classes/api/services/CItemPrototype.php.