Enable or disable a service and its monitoring

This function enables or disables a service and its monitoring.

Note:

In cPanel & WHM version 88, if the user only possesses the clustering Access Control List (ACL), then this function can only act on the named service.

Authorizations:
query Parameters
service
required
string

The service to configure. For more information about each service, read our Service Manager documentation.

Enum: "apache_php_fpm" "cpanel-dovecot-solr" "cpanel_php_fpm" "cpanellogd" "cpdavd" "cphulkd" "cpsrvd" "crond" "dnsadmin" "exim" "exim-altport" "ftpd" "httpd" "imap" "ipaliases" "lmtp" "mailman" "mysql" "named" "nscd" "p0f" "pop" "postgresql" "queueprocd" "rsyslogd" "spamd" "sshd"
Example: service=mysql
enabled
integer

Whether to enable the service.

  • 1 — Enable.
  • 0 — Disable.

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

Warning:

Do not use this function to disable the cpsrvd service.

Enum: 0 1
Example: enabled=1
exim-altportnum
string
Default: 26

A port or list of comma-separated ports on which Exim will listen for inbound connections.

Note:

The function only uses this parameter if you set exim-altport as the service parameter's value.

Example: exim-altportnum=26, 5000, 6000
monitored
integer

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

  • 1 — Monitor.
  • 0 — Do not monitor.

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

Enum: 0 1
Example: monitored=1

Responses

Response Schema: application/json
object

Request samples

whmapi1 --output=jsonpretty \
  configureservice \
  service='mysql'

Response samples

Content type
application/json
{
  • "metadata": {
    • "command": "configureservice",
    • "reason": "Enabled monitoring for mysql.",
    • "result": 1,
    • "version": 1
    }
}