17 net.dns.get 返回值

概述

本部分提供 Zabbix agent 2监控项 net.dns.get 返回值的详细信息。

详情

该监控项的输出是一个对象,它包含DNS记录信息,是基于监控项键提供的参数获得的。

例如net.dns.get[,example.com] 监控项可能会返回被拒绝查询的 JSON 如下:

  1. {
  2. "flags": [
  3. "RA"
  4. ],
  5. "query_time": "0.00",
  6. "question_section": [
  7. {
  8. "qclass": "IN",
  9. "qname": "example.com.",
  10. "qtype": "SOA"
  11. }
  12. ],
  13. "response_code": "REFUSED",
  14. "zbx_error_code": 0
  15. }

通过提供DNS服务器的IP地址 net.dns.get[192.0.2.0,example.com] 监控项可能会返回以下JSON:

  1. {
  2. "answer_section": [
  3. {
  4. "class": "IN",
  5. "name": "example.com.",
  6. "rdata": {
  7. "expire": 1209600,
  8. "mbox": "noc.dns.example.org.",
  9. "minttl": 3600,
  10. "ns": "ns.example.org.",
  11. "refresh": 7200,
  12. "retry": 3600,
  13. "serial": 2022091378
  14. },
  15. "rdlength": 44,
  16. "ttl": 1205,
  17. "type": "SOA"
  18. }
  19. ],
  20. "flags": [
  21. "RA"
  22. ],
  23. "query_time": "0.02",
  24. "question_section": [
  25. {
  26. "qclass": "IN",
  27. "qname": "example.com.",
  28. "qtype": "SOA"
  29. }
  30. ],
  31. "response_code": "NOERROR",
  32. "zbx_error_code": 0
  33. }

如果存在连接问题net.dns.get[192.0.2.0,example.com] 监控项可能返回错误:

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

以下是可能出现的错误码类型:

场景“zabbix错误码”“zabbix错误信息”
没有错误,并且已收到并解析 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:

  1. {
  2. "additional_section": [
  3. {
  4. "extended_rcode": 32768,
  5. "name": ".",
  6. "rdata": {
  7. "options": [
  8. {
  9. "code": 0,
  10. "nsid": "67 70 64 6e 73 2d 6c 70 70"
  11. }
  12. ]
  13. },
  14. "rdlength": 13,
  15. "type": "OPT",
  16. "udp_payload": 512
  17. }
  18. ],
  19. "answer_section": [
  20. {
  21. "class": "IN",
  22. "name": "example.com.",
  23. "rdata": {
  24. "a": "192.0.2.0"
  25. },
  26. "rdlength": 4,
  27. "ttl": 19308,
  28. "type": "A"
  29. },
  30. {
  31. "class": "IN",
  32. "name": "example.com.",
  33. "rdata": {
  34. "algorithm": 13,
  35. "expiration": 1704715951,
  36. "inception": 1702910624,
  37. "key_tag": 21021,
  38. "labels": 2,
  39. "orig_ttl": 86400,
  40. "signature": "HVBOBcJJQy0S08J3f8kviPj8UkEUj7wmyiMyQqPSWgQIY9SCEJ5plq6KuxJmtAek1txZWXDo+6tpIC6DIVBnuw==",
  41. "signer_name": "example.com.",
  42. "type_covered": "A"
  43. },
  44. "rdlength": 95,
  45. "ttl": 19308,
  46. "type": "RRSIG"
  47. }
  48. ],
  49. "flags": [
  50. "RD",
  51. "RA",
  52. "AD",
  53. "CD"
  54. ],
  55. "query_time": "0.05",
  56. "question_section": [
  57. {
  58. "qclass": "IN",
  59. "qname": "example.com.",
  60. "qtype": "ANY"
  61. }
  62. ],
  63. "response_code": "NOERROR",
  64. "zbx_error_code": 0
  65. }

参见

对于 DNS 记录的更多信息,查阅 :