Forum Discussion

Gjon's avatar
4 years ago

Citrix Cloud Monitoring

Installation

  1. 1. Install the package from LM Exchange "Citrix Cloud"
  2. 2. Install Cloud Connector property source: Locator JYW9D7

Configuration

This datasource requires several properties to be set:

  1. CITRIX.CLOUD.CUSTOMER
      - This is found in the Citrix Cloud Portal: Identity and Access Management > API Access > Secure Clients. Copy the bolded customer ID on the page.
  2. CITRIX.CLOUD.ID
  3.   - Create a secure client, you can name it "LogicMonitor". The ID here will be used for this property.
    CITRIX.CLOUD.PASS
  4.   - This is the secret when you created the secure client.
    CITRIXCLOUD.OAUTH.KEY
  5.   - This will be autogenerated and populated by LogicMonitor using the above credentials. There is a Citrix Cloud OAuth datasource that will generate a bearer token and save it as a property on the device.
    LM.API.ID
  6.   - Create an API token in LogicMonitor with administrator privileges, copy the Access ID.
    LM.API.KEY
  7.   - This is the API token access key that was created above.
    LM.API.ACCOUNT
  8.   - This is your LogicMonitor account name, you can probably copy the subdomain of your LM portal. https://yourco.logicmonitor.com

1. Set the properties above (except CITRIXCLOUD.OAUTH.KEY) wherever you'd like depending on your folder structure. I like to set the LM API properties at the root and the Citrix Cloud properties per client (folder).
2. Find your cloud connector device in LM and add the category "PrimaryCC". Make sure you have the Cloud Connector property source installed as well!
3. The OAuth datasource should run, generating a token that the other datasources will use to query Citrix Cloud's API. You can also do a manual "poll now" to speed up the process. You should now see the CITRIXCLOUD.OAUTH.KEY property on the device.

If you have any issues, feel free to private message me!

  • Ok - i got it working that i get some data from the Cloud now. I still see some issues with the machine Catalog informations. I changed the script code to get the new datasource setup.

    But when i Poll the Data i get following Warning and no data back. Does anyone had the same?

  • Anonymous's avatar
    Anonymous

    I'd run that script in the Collector debug console and add some println statements to see what you actually are getting back. My guess is that your response is null, so some command after that is failing because it's not got the ability to fail gracefully on an empty response.

  • Hello guys, is someone familary with the groovyscripts?! I am looking into to pulling the license usage information? I have already the API request.

    I thought it would be easiest to modify for example the code for the Citrix_Cloud_DeliveryGroups, but i am not really into the scripting language.

    This is the output. I would like take each value and put display it then the Values beyond it.

    Any suggestions?

    {
        "currentCcu": {
            "reportTime""xxxxx",
            "assignedLicenseCount"xx,
            "totalLicenseCount"xyz
        },
        "last24HoursPeak": {
            "reportTime""xxxx",
            "assignedLicenseCount"xx,
            "totalLicenseCount"xyz
        },
        "monthPeak": {
            "reportTime""xxxx",
            "assignedLicenseCount": xx,
            "totalLicenseCount"xyz
        },
        "allTimePeak": {
            "reportTime""xxxxx",
            "assignedLicenseCount"xx,
            "totalLicenseCount": xyz
        }
    }
  • Hi @Tim OShea from the shown Error you are using a Wrong Service Url in your Query. Which Url do you have set in your Script?

    I also have problems with the DataSources again. Which URL needs to be adapted in each case? E.g. in the Logon Performance DataSource:
    "https://${customer}.xendesktop.net/Citrix/monitor/odata/v4/data/DesktopGroups"
    -> is this no longer correct? Presumably the query for this is not correct either.
    Unfortunately, I'm not as good at Groovy as I am at PowerShell :/

  • Hi Gents, 

    I cannot find the Property Source required for this to work named “Cloud Connector” Locator JYW9D7

    Can anyone help me find it please?

    Thanks

  • @dorian.fuchs

    Hi @Tim OShea from the shown Error you are using a Wrong Service Url in your Query. Which Url do you have set in your Script?

    I also have problems with the DataSources again. Which URL needs to be adapted in each case? E.g. in the Logon Performance DataSource:
    "https://${customer}.xendesktop.net/Citrix/monitor/odata/v4/data/DesktopGroups"
    -> is this no longer correct? Presumably the query for this is not correct either.
    Unfortunately, I'm not as good at Groovy as I am at PowerShell :/

    I changed 
    httpGet = new HttpGet("https://${customer}.xendesktop.net/Citrix/monitor/odata/v4/data/DesktopGroups");

    to
    api_endpoint = "https://api-eu.cloud.com/monitordata";
    httpGet = new HttpGet(api_endpoint+"/DesktopGroups");

    and 
    httpGet.addHeader("Customer" , customer);
    to
    httpGet.addHeader("Citrix-CustomerId" , customer);

    as per the following...

    CloseableHttpClient httpclient = HttpClients.createDefault();
    //httpGet = new HttpGet("https://${customer}.xendesktop.net/Citrix/monitor/odata/v4/data/DesktopGroups");
    api_endpoint="https://api-eu.cloud.com/monitorodata"
    httpGet = new HttpGet(api_endpoint+"DesktopGroups");
    httpGet.addHeader("Authorization" , "CWSAuth bearer= " + token)
    //httpGet.addHeader("Customer" , customer);
    httpGet.addHeader("Citrix-CustomerID" , customer);
    response = httpclient.execute(httpGet);
    responseBody = EntityUtils.toString(response.getEntity());
    code = response.getStatusLine().getStatusCode();
    json_slurper = new JsonSlurper();
    response_obj = json_slurper.parseText(responseBody);

    I dont think i had to change anything else, but it was a while ago I’m afraid.