Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

Excerpt

This function enables or disables a service and its monitoring.


Panel
bgColor#F2F2F2
borderStylenone

Examples


Panel
bgColor#FFFFFF
borderStylenone


Expand
titleJSON API


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



Expand
titleXML API


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



Expand
titleCommand Line


Code Block
languagebash
whmapi1 configureservice service=mysql enabled=1 monitored=1

Include Page
_WHMAPI1CLINote
_WHMAPI1CLINote


Expand
titleOutput (JSON)


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



Expand
titleOutput (XML)


Code Block
languagetext
linenumberstrue
<result>
    <metadata>
        <version>1</version>
        <reason>Enabled monitoring for mysql.</reason>
        <result>1</result>
        <command>configureservice</command>
    </metadata>
</result>


Include Page
LIB:_WHMAPIShellNote
LIB:_WHMAPIShellNote


   

Parameters

ParameterTypeDescriptionPossible valuesExample
servicestring

Required

The service to configure.

Note titled

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.

Warning
titleWarning:

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.

Note
titleNotes:
  • 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.