Citrix Cloud Monitoring
Installation
- 1. Install the package from LM Exchange "Citrix Cloud"
-
- 2. Install Cloud Connector property source: Locator JYW9D7
Configuration
This datasource requires several properties to be set:
-
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. - CITRIX.CLOUD.ID
-
- Create a secure client, you can name it "LogicMonitor". The ID here will be used for this property.
CITRIX.CLOUD.PASS -
- This is the secret when you created the secure client.
CITRIXCLOUD.OAUTH.KEY -
- 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 -
- Create an API token in LogicMonitor with administrator privileges, copy the Access ID.
LM.API.KEY -
- This is the API token access key that was created above.
LM.API.ACCOUNT - - 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!
Christopher Hale
If anyone is interested I pointed AI at these scripts and this forum post. I had a request internally and it looks like Gjon isn't responding to this thread any longer.
I got the scripts working and was able to publish new versions of them to the exchange. Once they are approved, I will package them and list the locator code here.
Tim_OShea
@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.
Don_OKeeffe
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 :/
Chris Red
After running in to the same issues others have with these DataSources I recreated most of them myself. They are linked in this community post for anyone interested:
https://community.logicmonitor.com/lm-exchange-29/modules-for-citrix-cloud-daas-vad-monitoring-3843Tim_OShea
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?
thanks. I have been re-reading the threads, and corrected the URL and Customer strings. now have most of the datasources working.
Magna_FL
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?
Tim_OShea
Hi,
Has anyone had any issues with the datasources recently, whenever i do a poll now on any of the datasources i get the below error. Is anyone aware if the service URL has changed?
Thanks,
James
Hi James
Have the same problem since last Thursday. Rebuilding the Secure Client on Citrix and the new API token in LM did not bring any improvement. Any news about this? Would be grateful :)
i am seeing the same error. any ideas what could be going wrong?
Magna_FL
It seems me more that Citrix even changed some fields and thats why the calculation is not working correct. We will try to see what we can change on the scirpt in the next days and see to get it working correct again. If anybody has a complete solution it would be nice to share. Thanks
DavidK
Thanks Magna, I will keep amending the script to see how far I can get.
Magna_FL
Hello, Looking at the Citrix_Cloud_DeliveryGroups datasource, does anyone know why the max TotalMachines shown is 100 even though we have a total of 1800?
Thanks,
David
Hello David, i have the same issue. I think its more related to the API just giving you the first 100 results. I have changed the queries a bit that he is paging the results but still i get 100 as Total Machines in the DG
DavidK
Hello, Looking at the Citrix_Cloud_DeliveryGroups datasource, does anyone know why the max TotalMachines shown is 100 even though we have a total of 1800?
Thanks,
David
Manaf_K
Hi @Magna_FL
If you are referring to the DS LogonPerformance, the URI and query would have to be modified.
you need to remove “data” from the query path.
For instance, LogonPerformance DS -
the modified URI would be - "https:/api gateway/monitorodata" + query
and modified query would be - "/Sessions?\$filter=EndD and so on……..” - without the word “data“ in the path.
You can refer this link that lists the available api gateway data sets,
https://developer-docs.citrix.com/en-us/monitor-service-odata-api/current-release.html#urls-for-available-data-sets.
Magna_FL
Hello - i had the same issue with the Service URL Error - looking into the Scripts i found that not all Query are set correct after changing to the new API Gateway. However i just get good results for the DaaS Service like Sessions active etc. Other Queries like Logon Perf. etc. brings back no Data.
Manaf_K
Hi Dorian,
Thanks for your reply!
I don’t intend to modify the token but how\where the token is being retrieved.
I got the below notification, and interpret that this Citrix Cloud DataSource would stop working after 30th June.
At present, it all works without any issues. But would stop after 30th June 2023
The new endpoint information from Citrix can be found here : https://developer.cloud.com/citrix-cloud/citrix-cloud-api-overview/docs/get-started-with-citrix-cloud-apis.
Thanks
Dorian Fuchs
Hi Manaf
What do you want to customize the OAuth token for? This is automatically created by the DataSource "Citrix Cloud OAuth Token".
Did you set all properties correctly (Client Secret of Citrix Cloud, API Token of LM) or did you try to set them again?
What happens if you make a Poll Now on the OAuth Token DataSource? Do you get the same error?
Greetings
Dorian
Manaf_K
Hello,
I am new to LM, and have managed to setup the Citrix Cloud.
We would have to migrate to the new Citrix Cloud API by 30th June and i am struggling to modify the Citrix_Cloud_OAuth_Token..
Any help\guidance\direction would be appreciated.
Following is the partial code that fails with the error below :
def clientId = hostProps.get("citrix.cloud.id");
def clientSecret = hostProps.get("citrix.cloud.pass");
def devid = hostProps.get("system.deviceID");
// post the request, add the above parameters to the body of request
CloseableHttpClient httpclient = HttpClients.createDefault();
httpPost = new HttpPost("https://api-us.cloud.com/cctrustoauth2/root/tokens/clients");
httpPost.setHeader("Accept", "application/json");
httpPost.setHeader("Content-Type", "application/x-www-form-urlencoded");
httpPost.setEntity(new StringEntity("{\'grant_type\':\'client_credentials\',\'client_id\':\'" + clientId + "\',\'client_secret\':\'" + clientSecret + "\'}", ContentType.create("application/json")));
response = httpclient.execute(httpPost);
responseBody = EntityUtils.toString(response.getEntity());
ctxcode = response.getStatusLine().getStatusCode();
// Parse the bearer token from the JSON output
json_slurper = new JsonSlurper();
response_obj = json_slurper.parseText(responseBody);
httpclient.close();
=======================================================
Error returned :
"error": "unsupported_grant_type",
"error_description": "grant_type must be set to client_credentials"
========================================================
Thanks
Dorian Fuchs
Hi James
In case you haven't noticed - I briefly checked the query this morning and for unknown reasons it now works again for me
Greetings
Dorian
Dorian Fuchs
Hi,
Has anyone had any issues with the datasources recently, whenever i do a poll now on any of the datasources i get the below error. Is anyone aware if the service URL has changed?
Thanks,
James
Hi James
Have the same problem since last Thursday. Rebuilding the Secure Client on Citrix and the new API token in LM did not bring any improvement. Any news about this? Would be grateful :)
James_Rolt
Hi,
Has anyone had any issues with the datasources recently, whenever i do a poll now on any of the datasources i get the below error. Is anyone aware if the service URL has changed?
Thanks,
James
LM User
As far as I can tell (still not sure if i'm using the new exchange right), that module doesn't exist on the exchange anymore.
Don_OKeeffe
Hello All,
I am also not able to locate and Install Cloud Connector property source: Locator JYW9D7
Can anyone help the number of people who asked on this page how to do this now?
Many thanks
Magna_FL
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?
LM User
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.
Magna_FL
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?
Magna_FL
?wow just open the eyes ? Found it and give it a try
LM User
It looks like you've got a filter on the Status field.
Magna_FL
Hi Stuart firtst thanks for your reply. This is what i can find?! Why do i don´t see it?
LM User
I just found it in the public repo. Check your filters?
Magna_FL
Hi together, i have a question as we are moving to Citrix Cloud too. I can´t find the Citrix Cloud in the Exchange from LM anymore?! Is that correct?
James_Rolt
It seems the API Reference im after is the below, but after i tied this now getting issues using the AD
http://{ApiGatewayEndpoint}/Machines
Any help would be greatly apricated!
Thanks
James
James_Rolt
Hi,
It is currently collecting data, but the citrix cloud machines DS is missing around 30 devices. AD is working for the devices but the missing ones are been filtered out as deleted (when on citrix cloud they are not deleted and are in production)
I have not made any changes but the groovy scripts for Active discovery is currently set to the below which does not match yours
Collector Attributes Groovy Script
Thanks,
James
Vitor_Santos
Hey James,
Is it actually grabbing data currently (if you test the AD for example)? I've noticed that from those DS we need to change some code (due to API changes) - as mentioned by Brian Wagner in this thread...
This is what I've changed on ours:
here using the 'api-eu' endpoint as an example.
From there it should work... if you did this already, disregard my message :)/emoticons/smile@2x.png 2x" title=":)" width="20" />
James_Rolt
Also jumping back onto this!
I have managed to get the datasource setup and was working perfectly, but recently i have noticed that within the 'Citrix Cloud Machines' Datasource multiple machines are missing from the list. I have recreated the accounts ect but still seeing the same machines.
Has anyone else had this issue, or is this a configuration within Citrix Cloud? Any help would be great!
Thanks
Vitor_Santos
Bumping this again...
Where can we find the property source for the cloud connector 'Locator JYW9D7'? @Gjon can you advise? I'm no longer able to search using the locator code on our portal.
I see another used asked for this a few months ago but no further comments after it.
@Stuart Weenig / @Michael Rodrigues is there any other alternative to find custom modules on exchange? Since the locator code prompt no longer appears & we're directly redirected to exchange.
Already reached out to our CSM as well to confirm if there's any ETA for this cloud integration.
Herin
@Gjon Thanks for the datasource. I am trying to test this but I am unable to download the cloud Connector property source (JYW9D7). Are you able to provide this ?
Also in your post what device we should be using? Can we use a collector ?
Let me know
Thanks
Jav_Fiaz
Hi All,
Would love to get this script working, added all the api elements but still getting this error:
Does the groovy script need updated to reflect any Change to API from Citrix side?
Has anyone out there still got this working?
Cheers
Jav
steeve
Hey GJon, does this still work?
FrankG
PM sent GJon!
LM User
I really can't speak to the roadmap, mainly because I don't have good visibility into it. Our SaaS monitoring is GA if that's what you're asking about.
FrankG
Stuart, can you confirm if the cloud collector situation to which you are referring to is on the roadmap?
Thanks man.
LM User
Cool. The CSM will help direct questions to product management who can give insight into how Citrix monitoring is being planned/changed.
Gjon
OPThanks! I have access to the Cloud Integrations tab but don't see Citrix as an option. I will reach out to my CSM.
LM User
Complete speculation here, but Citrix may be one of the new SaaS monitored apps. SaaS monitored apps can be monitored via the cloud collector instead of running from an on-prem collector in your environment. Go to the exchange and look for the "Cloud Integrations" tab. If you don't have it, reach out to your CSM.
Brian_Wagner
It was on my Citrix Cloud logon for the last few months. Of course now it seems to have disappeared. Wondering if they decided to hold off.
At a high level things were moving from customer.xendesktop.net to https://api-us.cloud.com/monitorodata with different references. I see mention of it all here:
Accessing Monitor Service Data in Citrix Cloud
Gjon
OPI wasn't aware of any API changes. Do you have a link?
Brian_Wagner
Hi,
Thanks so much for this awesome data source. I'm aware that Citrix is changing the API's for the Cloud monitoring in July and I believe these data sources will be affected.
Do you happen to be working on any updates to support the new method?
Thanks!