Note that LogicMonitor does have an available REST API equivalent for this API call.

LogicMonitor’s RPC API enables you to get the properties for your devices using getHostProperties.

Note: As with all our API calls, authentication is required.

 

getHostProperties

URL:

https://accountName.logicmonitor.com/santaba/rpc/getHostProperties?c=accountName&u=user&p=password&hostId=hostIdNum

 

Request Parameters: You can include the following as query parameters in a getHostProperties request:

Parameter

Type

Description

hostId Integer Required. The unique Id of the Host

 

To get a hostId in the UI: navigate to the device, select the focus icon & the id displayed is in the URL as d-##.

 

All outputs will be in the format: { [status], [data], [errmsg] }, where status is the status of the response, errmsg is the error message associated with the response, and the data object includes the following for each property:

  • name
  • value

 

Example

Request:

curl "https://apiAccount.logicmonitor.com/santaba/rpc/getHostProperties?c=apiAccount&u=apiUser&p=example&hostId=186" 

Response:

{
  "status": 200,
  "data": [
    {
      "name": "system.db.db2",
      "value": ""
    },
    {
      "name": "system.aws.region",
      "value": "us-west-2"
    },
    {
      "name": "system.aws.resourceid",
      "value": "i-c346c105"
    },
    {
      "name": "system.aws.vpcId",
      "value": "vpc-1992107c"
    },
    {
      "name": "system.aws.publicIpAddress",
      "value": "54.213.83.19"
    },
    {
      "name": "system.aws.instanceType",
      "value": "t2.micro"
    },
    {
      "name": "system.aws.endpoint",
      "value": "ec2.us-west-2.amazonaws.com"
    },
    {
      "name": "system.collectorid",
      "value": "85"
    },
    {
      "name": "system.aws.imageId",
      "value": "ami-d5c5d1e5"
    },
    {
      "name": "system.aws.sourceDestCheck",
      "value": "true"
    },
    {
      "name": "system.aws.clientToken",
      "value": "RYfFK1440607299329"
    },
    {
      "name": "system.aws.keyName",
      "value": "mypem"
    },
    {
      "name": "system.aws.ebsOptimized",
      "value": "false"
    },
    {
      "name": "system.aws.architecture",
      "value": "x86_64"
    },
    {
      "name": "system.aws.privateIpAddress",
      "value": "172.31.40.176"
    },
    {
      "name": "system.sysinfo",
      "value": ""
    },
    {
      "name": "system.aws.publicDnsName",
      "value": "ec2-54-213-83-19.us-west-2.compute.amazonaws.com"
    },
    {
      "name": "system.aws.amiLaunchIndex",
      "value": "0"
    },
    {
      "name": "system.enablenetflow",
      "value": "false"
    },
    {
      "name": "system.prefcollectorid",
      "value": "85"
    },
    {
      "name": "system.aws.tag.Name",
      "value": "[email protected]"
    },
    {
      "name": "system.aws.hypervisor",
      "value": "xen"
    },
    {
      "name": "system.db.mssql",
      "value": ""
    },
    {
      "name": "system.db.oracle",
      "value": ""
    },
    {
      "name": "system.aws.availabilityZone",
      "value": "us-west-2b"
    },
    {
      "name": "system.aws.securityGroups",
      "value": "[{\"groupId\":\"sg-78ce791c\",\"groupName\":\"launch-wizard-3\"}]"
    },
    {
      "name": "system.ips",
      "value": ""
    },
    {
      "name": "system.description",
      "value": "Discovered by Cloud Collector"
    },
    {
      "name": "system.aws.subnetId",
      "value": "subnet-8b5fe7fc"
    },
    {
      "name": "system.aws.rootDeviceName",
      "value": "/dev/xvda"
    },
    {
      "name": "system.aws.launchTime",
      "value": "1440607299000"
    },
    {
      "name": "system.virtualization",
      "value": ""
    },
    {
      "name": "system.aws.monitoring",
      "value": "enabled"
    },
    {
      "name": "system.aws.rootDeviceType",
      "value": "ebs"
    },
    {
      "name": "system.hostname",
      "value": "us-west-2:ec2:i-c346c105-41"
    },
    {
      "name": "system.aws.virtualizationType",
      "value": "hvm"
    },
    {
      "name": "system.aws.blockDeviceMappings",
      "value": "[{\"volumeId\":\"vol-bd486373\",\"deviceName\":\"/dev/xvda\",\"status\":\"attached\",\"attachTime\":1440607303000,\"deleteOnTermination\":true}]"
    },
    {
      "name": "system.aws.monitoringstate",
      "value": "1"
    },
    {
      "name": "system.categories",
      "value": "AWS/EC2"
    },
    {
      "name": "system.db.mysql",
      "value": ""
    },
    {
      "name": "system.sysoid",
      "value": ""
    },
    {
      "name": "system.aws.stateCode",
      "value": "16"
    },
    {
      "name": "system.aws.privateDnsName",
      "value": "ip-172-31-40-176.us-west-2.compute.internal"
    },
    {
      "name": "system.displayname",
      "value": "US-W2:[email protected]_i-c346c105"
    },
    {
      "name": "system.aws.stateName",
      "value": "running"
    }
  ],
  "errmsg": "OK"
} 

In this Article: