cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Cognitive2707
Engaged Sweeper

The fundamental step of triggering a scan for our IT Agent Installations in our LS Cloud has started returning no payload via the API.
Previously when working with this it would return the id and name as expected, but this week the response is blank.
I cannot see any information in the API release notes or system status regarding this change, so either I'm doing something dumb or there's a breakage/undocumented feature at work.

Running the below (but with the correct siteId):

{ 
    site(id: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee") {
        allInstallations { 
            id
            name
        }
    }
}

returns:

{
    "data": {
        "site": {
            "allInstallations": []
        }
    }
}

I expect the response to be a list of all id and name of all installations.

If I add an arbitrary additional "accounts.username" request into the query:

{
    site(id: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee") {
        accounts {
            username
        }
        allInstallations {
        id
        name
        }
    }
}

I get a properly formed response with the usernames section containing the expected data, but the allInstallations section remains blank.

{
    "data": {
        "site": {
            "accounts": [
                {
                    "username": "user.00"
                },
                {
                    "username": "user.01"
                }
            ],
            "allInstallations": []
        }
    }
}

Am I doing something ultimately thick here? Or is something broken?

1 ACCEPTED SOLUTION

@Cognitive2707 thanks for sharing. I'll have the documentation updated for IT Agents.

Meanwhile I can share another way to get the installationid required for forcing IT Agents to do a scan. Using these GraphQLs, you can get the installationId's through the assets so you can use them in "scanNow":

All assets/installations (including those remotely discovered using either Lansweeper On-premises or Network Discovery):

 

query getAssetResources {
  site(id: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee") {
    assetResources(
      assetPagination: { limit: 500, page: FIRST }
      fields: [
        "assetBasicInfo.name"
        "assetBasicInfo.ipAddress"
        "installationId"
      ]
    ) {
      total
      pagination {
        limit
        next
        current
        page
      }
      items
    }
  }
}

 

 

IT Agents only:

query getAssetResources {
  site(id: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee") {
    assetsWithSoftware(
      software: "IT Agent Discovery"
      publisher: "Lansweeper"
      pagination: { limit: 500, page: FIRST }
      fields: ["assetBasicInfo.name","assetBasicInfo.ipAddress","installationId"]
    ) {
      total
      pagination {
        limit
        next
        current
        page
      }
      items
    }
  }
}

 

View solution in original post

8 REPLIES 8
Gilian
Product Team
Product Team

Hi @Cognitive2707,

GraphQL "allInstallations" only returns installs of Lansweeper On-premises (with scanning servers) and Network Discovery (with IT/OT sensors), not IT Agents as they're designed only get data on the asset where they are installed on (and optionally some external monitors).

In your case, you have an LS Site and only IT Agents, so allInstallations won't return any results.
You could use the following GraphQL request to get the assets from your IT Agents:

 

 

query getAssetResources {
  site(id: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee") {
    assetResources(
      assetPagination: { limit: 3, page: FIRST }
      fields: [
        "assetBasicInfo.name"
        "assetBasicInfo.userDomain"
        "assetBasicInfo.description"
        "assetBasicInfo.subType"
        "assetBasicInfo.typeGroup"
        "assetBasicInfo.scannerType"
        "softwares.type"
        "url"
      ]
    ) {
      total
      pagination {
        limit
        current
        next
        page
      }
      items
    }
  }
}

 

 

 

More info here: https://docs.lansweeper.com/docs/api/getting-data

Thanks for the information @Gilian 

I have created a new trial environment and run through the same steps and see exactly the same (lack of) data being returned.

What you're saying is definitely in line with what I'm seeing.

However..... This is in direct conflict with the information provided in the LS documentation here:
https://docs.lansweeper.com/docs/api/actions 

Which is the recommended way to force a scan. As sourced in the FAQ section of a thread authored by.... you 😄
https://community.lansweeper.com/t5/product-discussions/new-preview-capability-track-your-hard-to-reach-assets-using-it-agent-the/td-p/68280 

Can I force the IT Agent to do an ad hoc rescan of the asset(s), now?

IT Agent does a rescan every 24 hours by default. You can also force a scan using the API, see https://docs.lansweeper.com/docs/api/actions#request-the-scan 





I still have all of the results in a text dump from when it did work. So there must have been some change made to the API which has not yet made it to the IT Agent documentation.

 

Perform a scan

If you're using the IT Agent Discovery  scanning agent, you can perform a scan on your environment through the API.

Determine your installation source ID

Before performing a scan, you need to find your installation's source ID.

  • 🗂️ GraphQL Request
site(id: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee") {
    allInstallations {
      id
    }
}
 

You should receive a response, similar to this:

  • Response
{
  "data": {
    "site": {
      "allInstallations": [
        {
          "id": "11111111-2222-3333-4444-555555555555"
        },
        {
          "id": "66666666-7777-8888-9999-000000000000"
        },
        {
          "id": "12345678-9876-5432-8765-432198765432"
        }
        // ... other installations
      ]
    }
  }
}
 

Copy the id for the installation you want to perform a scan on. This will be your sourceId.




Previously I have followed these steps exactly, and had been returned the expected list of IT Agent installations.

@Cognitive2707 thanks for sharing. I'll have the documentation updated for IT Agents.

Meanwhile I can share another way to get the installationid required for forcing IT Agents to do a scan. Using these GraphQLs, you can get the installationId's through the assets so you can use them in "scanNow":

All assets/installations (including those remotely discovered using either Lansweeper On-premises or Network Discovery):

 

query getAssetResources {
  site(id: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee") {
    assetResources(
      assetPagination: { limit: 500, page: FIRST }
      fields: [
        "assetBasicInfo.name"
        "assetBasicInfo.ipAddress"
        "installationId"
      ]
    ) {
      total
      pagination {
        limit
        next
        current
        page
      }
      items
    }
  }
}

 

 

IT Agents only:

query getAssetResources {
  site(id: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee") {
    assetsWithSoftware(
      software: "IT Agent Discovery"
      publisher: "Lansweeper"
      pagination: { limit: 500, page: FIRST }
      fields: ["assetBasicInfo.name","assetBasicInfo.ipAddress","installationId"]
    ) {
      total
      pagination {
        limit
        next
        current
        page
      }
      items
    }
  }
}

 

Thanks for following up @Gilian 
Looks like the above is doing the trick, I can now provide our CyberSec guys with a way to trigger scans for their compliance reviews.
Thanks for keeping the documentation up to date - I understand it's an evolving product and the references can spread far and wide during the preview phases.

I think this is a great addition to the LS suite of capabilities, unfortunately it's not quite to the maturity point of being able to justify transition from free tier for our use case; but when IT Agent reaches RTM and the integrations with LS Site are completed we will reconsider.

Let's call this issue done. Cheers for your assistance.

David_GF
Lansweeper Tech Support
Lansweeper Tech Support

Hi @Cognitive2707,

Our Support team is better suited to help you with this issue, as it requires advanced troubleshooting and most probably sharing logs.  Could you open a ticket with them?

How to contact support?

Make sure to add screenshots and the GatherLogs output file so our SME's can start investigating the issue straight away. 

Using the GatherLogs tool.



~~~~~~~ (〃 ̄︶ ̄)人( ̄︶ ̄〃) ~~~~~~~
Sweep that LAN, sweep it!

Hi @David_GF 

I'd love to open this as a support ticket, but we're using the free tier as part of an extended appraisal before committing to the product long term so that isn't an option.
Let's just say the trial is not going hugely well at the minute...

Any logs would be internal to LS as we are 100% cloud & IT Agent. I'm happy to provide any info for troubleshooting, but this would have to be done privately obviously.

David_GF
Lansweeper Tech Support
Lansweeper Tech Support

Hi @Cognitive2707, if you are trialing Lansweeper, the trial includes technical support and access to all features available in the Lansweeper product. You can submit a business or a non-business email address to start your trial, and it is not limited in the number of assets. More information can be found here:

 



~~~~~~~ (〃 ̄︶ ̄)人( ̄︶ ̄〃) ~~~~~~~
Sweep that LAN, sweep it!

Thanks for the info @David_GF.
I'm aware of the support provisions in the trial, but we have passed the time limit and are continuing to review the product as the IT Agent product and integration into the cloud platform evolves.
I realise I could start another trial, and I may not see the same issue there. But would have to migrate endpoints, users & customisations and would lose access to history etc.
This would also then trigger another round of hounding by the sales team..... 😄

 

New to Lansweeper?

Try Lansweeper For Free

Experience Lansweeper with your own data.
Sign up now for a 14-day free trial.

Try Now