Bonjour,
On aimerait savoir si avez des solutions (plugin, script, ..) qui peuvent superviser le tenant citrix cloud grace a l'api fournie ( mode maintenance, powerstate, vda non eregistré, débit connexion users, etc...) ?
Pour info on est en train de développer un script de notre coté, voici comment marche l'api citrix
https://citrix-landing-page.readthedocs-hosted.com/projects/monitor-service-odata-api/en/latest/
https://developer-docs.citrix.com/en-us/citrix-cloud/citrix-cloud-api-overview/get-started-with-citrix-cloud-apis.html
Mon script :
#!/bin/bash
# Charger les identifiants de manière sécurisée
CLIENT_ID=*****
CLIENT_SECRET=******
CUSTOMER_ID=*********
# Obtenir le token d'accès
TOKEN_RESPONSE=$(curl -s -X POST "https://api.cloud.com/cctrustoauth2/root/tokens/clients" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "client_id=$CLIENT_ID&client_secret=$CLIENT_SECRET&grant_type=client_credentials")
ACCESS_TOKEN=$(echo "$TOKEN_RESPONSE" | jq -r '.access_token')
# Vérifier si le token est valide
if echo "Erreur : Impossible d'obtenir le token d'accès."
exit 1
fi
echo "✔ Token récupéré avec succès."
echo "📌 Vérification des VDA non enregistrés..."
VDA_UNREGISTERED=$(curl -s -X GET "https://api.cloud.com/monitorodata/Machines?\$filter=CurrentRegistrationState eq 0" \
-H "accept: application/json" -H "Citrix-CustomerId: $CUSTOMER_ID" -H "Authorization: CwsAuth bearer=$ACCESS_TOKEN")
# Vérification du mode maintenance
echo "📌 Vérification des machines en mode maintenance..."
MAINTENANCE_MODE=$(curl -s -X GET "https://api.cloud.com/monitorodata/Machines?\$filter=IsInMaintenanceMode eq true&\$select=HostedMachineName" \
-H "accept: application/json" -H "Citrix-CustomerId: $CUSTOMER_ID" -H "Authorization: CwsAuth bearer=$ACCESS_TOKEN")
echo " VDA non enregistrés : $VDA_UNREGISTERED"
echo " Machines en mode maintenance : $MAINTENANCE_MODE"