17 net.dns.getの戻り値

概要

このセクションでは、Zabbix エージェント 2 アイテムの net.dns.get の戻り値の詳細について説明します。

詳細

このアイテムの出力は、アイテムキーで指定されたパラメータに基づいた DNS レコード情報を含むオブジェクトです。

例えば、net.dns.get[,example.com] アイテムは、拒否されたクエリの次の JSON形式で返す場合があります。

{
           "flags": [
               "RA"
           ],
           "query_time": "0.019030",
           "question_section": [
               {
                   "qclass": "IN",
                   "qname": "example.com.",
                   "qtype": "SOA"
               }
           ],
           "response_code": "REFUSED",
           "zbx_error_code": 0
       }

By specifying the IP address of the DNS server, the net.dns.get[192.0.2.0,example.com] item may return the following JSON: DNS サーバーの IP アドレスを指定すると、net.dns.get[192.0.2.0,example.com] アイテムは次の JSON形式で返す場合があります。

{
           "answer_section": [
               {
                   "class": "IN",
                   "name": "example.com.",
                   "rdata": {
                       "expire": 1209600,
                       "mbox": "noc.dns.example.org.",
                       "minttl": 3600,
                       "ns": "ns.example.org.",
                       "refresh": 7200,
                       "retry": 3600,
                       "serial": 2022091378
                   },
                   "rdlength": 44,
                   "ttl": 1205,
                   "type": "SOA"
               }
           ],
           "flags": [
               "RA"
           ],
           "query_time": "0.029556",
           "question_section": [
               {
                   "qclass": "IN",
                   "qname": "example.com.",
                   "qtype": "SOA"
               }
           ],
           "response_code": "NOERROR",
           "zbx_error_code": 0
       }

接続に問題がある場合は、 net.dns.get[192.0.2.0,example.com] アイテムでエラーが発生する可能性があります:

{
           "zbx_error_code": -1,
           "zbx_error_msg": "Communication error: read udp 192.0.2.0:12345->192.0.2.0:53: i/o timeout"
       }

以下の種類のエラーコードが想定されます:

シナリオ "zbx_error_code" "zbx_error_msg"
エラーはなく、DNS 応答を受信して解析しました 0
DNS がダウンしています -1 "通信エラー"
JSON 解析中にエラーが発生しました -2 "予期しない応答を受信しました"

追加パラメータを指定すると、net.dns.get[192.0.2.0,example.com,ANY,5,5,tcp,"cdflag,rdflag,dnssec,nsid,edns0,aaflag,adflag"] 項目は次の JSON を返す場合があります。

{
           "additional_section": [
               {
                   "extended_rcode": 32768,
                   "name": ".",
                   "rdata": {
                       "options": [
                       {
                           "code": 0,
                           "nsid": "67 70 64 6e 73 2d 6c 70 70"
                       }
                   ]
               },
                   "rdlength": 13,
                   "type": "OPT",
                   "udp_payload": 512
               }
           ],
           "answer_section": [
               {
                   "class": "IN",
                   "name": "example.com.",
                   "rdata": {
                       "a": "192.0.2.0"
                   },
                   "rdlength": 4,
                   "ttl": 19308,
                   "type": "A"
               },
               {
                   "class": "IN",
                   "name": "example.com.",
                   "rdata": {
                       "algorithm": 13,
                       "expiration": 1704715951,
                       "inception": 1702910624,
                       "key_tag": 21021,
                       "labels": 2,
                       "orig_ttl": 86400,
                       "signature": "HVBOBcJJQy0S08J3f8kviPj8UkEUj7wmyiMyQqPSWgQIY9SCEJ5plq6KuxJmtAek1txZWXDo+6tpIC6DIVBnuw==",
                       "signer_name": "example.com.",
                       "type_covered": "A"
                   },
                   "rdlength": 95,
                   "ttl": 19308,
                   "type": "RRSIG"
               }
           ],
           "flags": [
               "RD",
               "RA",
               "AD",
               "CD"
           ],
           "query_time": "0.058221",
           "question_section": [
               {
                   "qclass": "IN",
                   "qname": "example.com.",
                   "qtype": "ANY"
               }
           ],
           "response_code": "NOERROR",
           "zbx_error_code": 0
       }

参照

DNSレコードの詳細については、以下を参照してください。