Skip to main content
Declined

Request to Upgrade Connector 3CX

Related products:Infra Monitoring - Connectors
  • February 27, 2025
  • 8 replies
  • 74 views

Forum|alt.badge.img+5
The current connector is for 3CX V18…. the current version of 3CX is on V20.0 Update 5, the connector does not work with this version 20.0 released a long time ago...it would be good to keep this connector up to date

8 replies

ltirand
Centreonian
Forum|alt.badge.img+10
  • Centreonian
  • February 28, 2025

Hello :)

In August 2024 we completed work to added support for authentication on versions higher than 18.0.5 and made the default values more explicit. Could you give us more informations about what doesn’t work with the version 20.0? We'll also will need data (anonymized outputs) from version 20 to be able to work on the improvements you're asking for. Would you be able to provide them?

Kind regards.


Forum|alt.badge.img+5
  • Author
  • Steward *
  • February 28, 2025

result fom command with debug mode

 

i have replace dns name and api-password :)

 su - centreon-engine
Dernière connexion : jeudi 27 février 2025 à 12:48:35 CET sur pts/0
~]$ /usr/lib/centreon/plugins//centreon_3cx_restapi.pl --plugin=apps::voip::3cx::restapi::plugin --mode=system --hostname='xxxxx.my3cx.fr' --port='443' --proto='https' --api-username='centreon' --api-password='xxxxxxxxxxxx' --3cx-version='20.0.5.506'  --unknown-status='' --warning-status='' --critical-status='%{error} =~ /true/' --warning-calls-active-usage='' --critical-calls-active-usage='' --warning-calls-active-free='' --critical-calls-active-free='' --warning-calls-active-usage-prct='' --critical-calls-active-usage-prct='' --warning-extensions-registered='' --critical-extensions-registered='' --debug
UNKNOWN: 404 Not Found
Version '20.0.5.506' identified as higher or equal to 18 update 5. Using new API.
======> request send
POST https://xxxxxx.fr:443/api/login
User-Agent: centreon::plugins::backend::http::useragent
Content-Type: application/json;charset=UTF-8

{"Username":"centreon","Password":"xxxxxxxxxxxxxx"}
======> response done
HTTP/1.1 404 Not Found
Connection: keep-alive
Date: Fri, 28 Feb 2025 14:31:24 GMT
Server: nginx
Content-Length: 0
Client-Date: Fri, 28 Feb 2025 14:31:25 GMT
Client-Peer: 185.98.20.215:443
Client-Response-Num: 1
Client-SSL-Cert-Issuer: /C=US/O=Let's Encrypt/CN=R10
Client-SSL-Cert-Subject: /CN=callnextit.my3cx.fr
Client-SSL-Cipher: TLS_AES_256_GCM_SHA384
Client-SSL-Socket-Class: IO::Socket::SSL
Strict-Transport-Security: max-age=31536000
 

 

Regards

Jean-Francois


rchauvel
Centreonian
Forum|alt.badge.img+18
  • Centreonian
  • March 7, 2025
NewDiscussion ongoing

ltirand
Centreonian
Forum|alt.badge.img+10
  • Centreonian
  • March 17, 2025

Hello :)

Thanks for your feedback. Could you give us the API information we need to update the plugin? (from the debug output you provided we only know that: “Version '20.0.5.506' identified as higher or equal to 18 update 5. Using new API.”). The API call route has probably changed and there may be other subtleties.

Kind regards.


Forum|alt.badge.img+5
  • Author
  • Steward *
  • March 17, 2025

Hello,

I have a 3CX account where I'm an admin. The best thing would be to schedule a call so we can take a look and test it.

regards

Jean-Francois


rchauvel
Centreonian
Forum|alt.badge.img+18
  • Centreonian
  • June 13, 2025

Declined since the endpoint disappeared from the 3CX API.


rchauvel
Centreonian
Forum|alt.badge.img+18
  • Centreonian
  • June 13, 2025
Discussion ongoingDeclined

Forum|alt.badge.img+5
  • Author
  • Steward *
  • April 21, 2026

Objet : Mise à jour du connecteur Apps-VoIP-3CX-Restapi pour compatibilité 3CX v20 (Pro & Enterprise)

Bonjour,

Je vous contacte au sujet du connecteur de supervision Apps-VoIP-3CX-Restapi dont je suis l'auteur original.

3CX a introduit des changements majeurs dans son API lors du passage à la version 20, rendant le connecteur actuel non fonctionnel. J'ai développé, testé et validé une mise à jour complète du plugin sur deux environnements de production réels — une instance Enterprise et une instance Pro.

Résumé des changements

1. Double mode d'authentification — nouvelle option --auth-mode

3CX v20 propose deux méthodes d'authentification selon l'édition de la licence :

Mode

Edition

Méthode

Endpoint

oauth2 (défaut)

Enterprise

client_id / client_secret

POST /connect/token

login

Pro

email / password (sans 2FA)

POST /webclient/api/Login/GetAccessToken

En Enterprise, l'interface /#/office/integrations/api permet de créer un client API avec client_id/client_secret. Cette interface n'existe pas en version Pro — on utilise alors les credentials d'un compte System Owner avec 2FA désactivé.

Le plugin gère les erreurs spécifiques à chaque mode, notamment un message explicite si le 2FA est activé sur le compte en mode login.

2. Endpoints mis à jour

Fonction

v18

v20

Auth Enterprise

POST /api/login + GET /api/Token

POST /connect/token

Auth Pro

POST /webclient/api/Login/GetAccessToken

Appels actifs

GET /api/activeCalls → {list:[...]}

GET /xapi/v1/ActiveCalls → {value:[...]}

Extensions

GET /api/ExtensionList → {list:[...]}

GET /xapi/v1/Users → {value:[...]}

Statut système

GET /api/SystemStatus

GET /xapi/v1/SystemStatus

Single status

GET /api/SystemStatus/GetSingleStatus

Supprimé — intégré dans SystemStatus

Mises à jour

GET /xapi/v1/GetUpdatesStats()

Inchangé ✅

3. Mode extension

  • Le champ booléen DND n'existe plus en v20
  • Le DND est désormais dérivé de CurrentProfileName
  • Ajout de l'option --dnd-profile-name (défaut : DND) pour configurer le nom du profil DND selon la configuration 3CX du client
  • Champ CurrentProfile renommé en CurrentProfileName

4. Mode system

  • Suppression de l'appel api_single_status() — endpoint disparu en v20
  • Les checks Firewall/Phones sont retirés — endpoints supprimés en v20
  • Ajout d'un check LicenseActive exploitant les nouvelles données de SystemStatus
  • Les checks HasNotRunningServicesHasUnregisteredTrunksHasUnregisteredSystemExtensions restent fonctionnels

5. Suppressions

  • Option --3cx-version supprimée — devenue inutile en v20
  • Macro hôte 3CXVERSION peut être retirée des templates
  • Ajout de la macro hôte 3CXAUTHMODE (valeur par défaut : oauth2)

Tests effectués

Environnement

Version 3CX

Licence

Mode auth

Résultat

Production client 1

20.0.8.1121

Enterprise

oauth2

✅ OK

Production client 2

20.0.8.1121

Pro

login

✅ OK

Modes testés

system + extension

✅ OK

Commandes mises à jour

App-VoIP-3cx-Restapi-System :

 

$CENTREONPLUGINS$/centreon_3cx_restapi.pl --plugin=apps::voip::3cx::restapi::plugin --mode=system --hostname='$HOSTADDRESS$' --port='$_HOST3CXPORT$' --proto='$_HOST3CXPROTO$' --api-username='$_HOST3CXUSERNAME$' --api-password='$_HOST3CXPASSWORD$' --auth-mode='$_HOST3CXAUTHMODE$' $_HOST3CXEXTRAOPTIONS$ --unknown-status='$_SERVICEUNKNOWNSTATUS$' --warning-status='$_SERVICEWARNINGSTATUS$' --critical-status='$_SERVICECRITICALSTATUS$' --warning-calls-active-usage='$_SERVICEWARNINGCALLSACTIVEUSAGE$' --critical-calls-active-usage='$_SERVICECRITICALCALLSACTIVEUSAGE$' --warning-calls-active-free='$_SERVICEWARNINGCALLSACTIVEFREE$' --critical-calls-active-free='$_SERVICECRITICALCALLSACTIVEFREE$' --warning-calls-active-usage-prct='$_SERVICEWARNINGCALLSACTIVEUSAGEPRCT$' --critical-calls-active-usage-prct='$_SERVICECRITICALCALLSACTIVEUSAGEPRCT$' --warning-extensions-registered='$_SERVICEWARNINGEXTENSIONSREGISTERED$' --critical-extensions-registered='$_SERVICECRITICALEXTENSIONSREGISTERED$' $_SERVICEEXTRAOPTIONS$

App-VoIP-3cx-Restapi-Extension (nouvelle commande) :

 

$CENTREONPLUGINS$/centreon_3cx_restapi.pl --plugin=apps::voip::3cx::restapi::plugin --mode=extension --hostname='$HOSTADDRESS$' --port='$_HOST3CXPORT$' --proto='$_HOST3CXPROTO$' --api-username='$_HOST3CXUSERNAME$' --api-password='$_HOST3CXPASSWORD$' --auth-mode='$_HOST3CXAUTHMODE$' $_HOST3CXEXTRAOPTIONS$ --filter-extension='$_SERVICEFILTEREXTENSION$' --dnd-profile-name='$_SERVICEDNDPROFILENAME$' --unknown-status='$_SERVICEUNKNOWNSTATUS$' --warning-status='$_SERVICEWARNINGSTATUS$' --critical-status='$_SERVICECRITICALSTATUS$' --warning-count='$_SERVICEWARNINGCOUNT$' --critical-count='$_SERVICECRITICALCOUNT$' $_SERVICEEXTRAOPTIONS$


Le lien vers vos 3 fichiers modifiés sur GitHub :