Description

This function enables or disables a service and its monitoring.


Examples




https://hostname.example.com:2087/cpsess##########/json-api/configureservice?api.version=1&service=mysql&enabled=1&monitored=1




https://hostname.example.com:2087/cpsess##########/xml-api/configureservice?api.version=1&service=mysql&enabled=1&monitored=1




whmapi1 configureservice service=mysql enabled=1 monitored=1



{
  "metadata": {
    "version": 1,
    "reason": "Enabled monitoring for mysql.",
    "result": 1,
    "command": "configureservice"
  }
}




<result>
    <metadata>
        <version>1</version>
        <reason>Enabled monitoring for mysql.</reason>
        <result>1</result>
        <command>configureservice</command>
    </metadata>
</result>



   

Parameters

ParameterTypeDescriptionPossible valuesExample
servicestring

Required

The service to configure.

For more information, read our Service Manager documentation.


  • apache_php_fpm
  • cpanel_php_fpm
  • cpanellogd
  • cpdavd
  • cphulkd
  • cpsrvd
  • crond
  • dnsadmin
  • exim
  • exim-altport
  • ftpd
  • httpd
  • imap
  • ipaliases
  • lmtp
  • mailman
  • mysql
  • named
  • nscd
  • p0f
  • pop
  • queueprocd
  • rsyslogd
  • spamd
  • sshd
mysql
enabledBoolean

Whether to enable the service.

If you do not use this parameter, the function will not change the enabled status of the service.

Do not use this function to disable the cpsrvd service.


  • 1 — Enable the service.
  • 0 — Disable the service.
 1
monitoredBoolean

Whether to monitor the service in WHM's Service Status interface (Home >> Server Status >> Service Status).

If you do not use this parameter, the function will not change the monitoring status of the service.

  • 1 — Monitor the service.
  • 0 — Do not monitor the service.
 1
exim-altportnum integer

The alternative port or ports on which Exim will listen for inbound connections.

  • The function only uses this parameter if you set exim-altport as the service parameter's value.
  • We introduced this parameter in cPanel & WHM version 68. 

This parameter defaults to 26.

A comma-separated list of integers.26

Returns

This function only returns metadata.