dhost.get

    The method allows to retrieve discovered hosts according to the given parameters.

    This method is available to users of any type. Permissions to call the method can be revoked in user role settings. See User roles for more information.

    Parameters

    The method supports the following parameters.

    (integer/array) Returns either:

    • an array of objects;
    • the count of retrieved objects, if the countOutput parameter has been used.

    Examples

    Retrieve discovered hosts by discovery rule

    Request:

    Response:

    1. {
    2. "jsonrpc": "2.0",
    3. "result": [
    4. {
    5. "dservices": [
    6. {
    7. "dserviceid": "1",
    8. "dhostid": "1",
    9. "type": "4",
    10. "key_": "",
    11. "value": "",
    12. "port": "80",
    13. "status": "0",
    14. "lastup": "1337697227",
    15. "lastdown": "0",
    16. "dcheckid": "5",
    17. "ip": "192.168.1.1",
    18. "dns": "station.company.lan"
    19. }
    20. ],
    21. "dhostid": "1",
    22. "druleid": "4",
    23. "status": "0",
    24. "lastup": "1337697227",
    25. "lastdown": "0"
    26. },
    27. "dservices": [
    28. {
    29. "dserviceid": "2",
    30. "dhostid": "2",
    31. "type": "4",
    32. "key_": "",
    33. "value": "",
    34. "port": "80",
    35. "status": "0",
    36. "lastup": "1337697234",
    37. "lastdown": "0",
    38. "dcheckid": "5",
    39. "ip": "192.168.1.4",
    40. "dns": "john.company.lan"
    41. }
    42. ],
    43. "dhostid": "2",
    44. "druleid": "4",
    45. "status": "0",
    46. "lastup": "1337697234",
    47. "lastdown": "0"
    48. },
    49. {
    50. "dservices": [
    51. {
    52. "dserviceid": "3",
    53. "dhostid": "3",
    54. "type": "4",
    55. "key_": "",
    56. "value": "",
    57. "port": "80",
    58. "status": "0",
    59. "lastup": "1337697234",
    60. "lastdown": "0",
    61. "dcheckid": "5",
    62. "dns": "printer.company.lan"
    63. }
    64. ],
    65. "dhostid": "3",
    66. "druleid": "4",
    67. "status": "0",
    68. "lastup": "1337697234",
    69. "lastdown": "0"
    70. },
    71. {
    72. "dservices": [
    73. {
    74. "dserviceid": "4",
    75. "dhostid": "4",
    76. "type": "4",
    77. "key_": "",
    78. "value": "",
    79. "port": "80",
    80. "status": "0",
    81. "lastup": "1337697234",
    82. "lastdown": "0",
    83. "dcheckid": "5",
    84. "ip": "192.168.1.7",
    85. "dns": "mail.company.lan"
    86. }
    87. ],
    88. "dhostid": "4",
    89. "druleid": "4",
    90. "status": "0",
    91. "lastup": "1337697234",
    92. "lastdown": "0"
    93. }
    94. ],
    95. "id": 1
    96. }

    Source