User Tools

Site Tools


api:export:externalsystemcpaneldns

ExportAPI: Destination cPanel (DNS-Records)

This feature is available version 0.12 or higher.

This destination adds DNS A-records for yourCMDB objects to a given DNS zone in cPanel using the cPanel JSON API version 2. Any existing A records in that zone, that does not exists as objects in yourCMDB will be deleted. You can manage other record types like CNAME or MX records manually in that zone and the yourCMDB exporter will not touch these records.

To use this exporter, you need a valid cPanel account with username and password and a DNS zone, you can manage.

The exporter will not create a DNS zone for you. So the DNS zone should already exist, if you want to use this exporter.

Configuration

short information
class name ExternalSystemCpanelDns
needed destination parametercpanelApiUrl
cpanelApiUser
cpanelApiPassword
domainName
needed variableshostname
ip

destination parameters

namerequireddescriptionexample
cpanelApiUrlrequiredcPanel API base URLhttps://1.2.3.4:2083/json-api
cpanelApiUserrequiredcPanel usernameadmin
cpanelApiPasswordrequiredcPanel passwordadmin
domainNamerequiredDNS Zone managed by cPanel for adding DNS A recordsobjects.yourcmdb.org
cpanelApiSslVerifyoptionaldisable SSL peer verificationfalse

variables

namerequireddescriptionexample
hostnamerequiredhost part of the DNS A recordtest
iprequiredip address of the DNS A record8.8.8.8

Examples

example of export task configuration:

<task name="cpanel-example">
              <sources>
                      <source objecttype="router" status="A" />
                      <source objecttype="switch" status="A" />
              </sources>
              <destination class="ExternalSystemCpanelDns">
                      <parameter key="cpanelApiUrl" value="https://1.2.3.4:2083/json-api" />
                      <parameter key="cpanelApiUser" value="admin" />
                      <parameter key="cpanelApiPassword" value="admin" />
                      <parameter key="domainName" value="objects.yourcmdb.org" />
              </destination>
              <variables>
                      <variable name="hostname">
                              <value objecttype="router" fieldname="hostname" />
                              <value objecttype="switch" fieldname="hostname" />
                      </variable>
                      <variable name="ip">
                              <value objecttype="router" fieldname="management-ip" />
                              <value objecttype="switch" fieldname="management-ip" />
                      </variable>
              </variables>
</task>
api/export/externalsystemcpaneldns.txt · Last modified: 2017/07/24 11:43 (external edit)