We have a new documentation site for cPanel & WHM! You can find our new documentation site at docs.cpanel.net.

We will continue to maintain our API documentation on this server.

Child pages
  • WHM API 1 Functions - get_server_node_status
Skip to end of metadata
Go to start of metadata

Description

This function returns the status of a linked remote server node. It returns the linked remote server's status with the WHM API 1 version and get_current_profile functions.

Important:

This function requires that the remote server node uses cPanel & WHM version 76 or later.

Examples


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/get_server_node_status?api.version=1&api_token=23ZX8RA1FTE1IVJRL90MB5CREDS4UE2H&hostname=example.com&username=root&skip_tls_verification=1
 Command Line
whmapi1 get_server_node_status api_token=23ZX8RA1FTE1IVJRL90MB5CREDS4UE2H hostname=example.com username=root skip_tls_verification=1


Notes:

  • Unless otherwise noted, you must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)
{
	"metadata": {
		"result": 1,
		"command": "get_server_node_status",
		"version": 1,
		"reason": "OK"
	},
	"data": {
		"enabled_services": [
			"apache_php_fpm",
			"cpanellogd",
			"cpdavd",
			"cpgreylistd",
			"cphulkd",
			"cpsrvd",
			"crond",
			"dnsadmin",
			"exim",
			"httpd",
			"imap",
			"ipaliases",
			"lmtp",
			"mailman",
			"mysql",
			"named",
			"nscd",
			"pop",
			"queueprocd",
			"rsyslogd",
			"spamd",
			"sshd",
			"tailwatchd"
		],
		"system_settings": {
			"Mail": {
				"globalspamassassin": "1"
			}
		},
		"tls_verified": 0,
		"remote_node_linkages": [{
			"worker_capabilities": {
				"Mail": {}
			},
			"version": "11.86.0.1",
			"hostname": "mailnode.example.com",
			"system_settings": {
				"Mail": {
					"globalspamassassin": "1"
				}
			},
			"tls_verified": 0,
			"last_check": 1583934071,
			"username": "root",
			"enabled_services": [
				"apache_php_fpm",
				"cpanellogd",
				"cpdavd",
				"cpgreylistd",
				"cphulkd",
				"cpsrvd",
				"crond",
				"dnsadmin",
				"exim",
				"imap",
				"ipaliases",
				"lmtp",
				"mailman",
				"mysql",
				"named",
				"nscd",
				"pop",
				"queueprocd",
				"rsyslogd",
				"spamd",
				"sshd",
				"tailwatchd"
			],
			"alias": "MailNode"
		}],
		"version": "11.86.0.1"
	}
}


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample

api_token

string

Required

The required API token to make API calls to the remote server node.

Note:

The API token must have root-level access on the remote server node.

A valid API token.23ZX8RA1FTE1IVJRL90MB5CREDS4UE2H
hostnamestring

Required

The remote server node's hostname.

A valid hostname or IP address.

Note:

If you use an IP address, you must use the skip_tls_verification=1 parameter.

example.com

username

string

Required

The username required to make API calls to the remote server node.

A valid username.

Note:

The username must have root-level access on the remote server node.

root
skip_tls_verificationBoolean

Whether to skip SSL/TLS verification. The system performs this action when it queries the remote server node.

This value defaults to 0.

  • 1 — Skip SSL/TLS verification.
  • 0 — Do not skip SSL/TLS verification.
1

Returns

ReturnTypeDescriptionPossible valuesExample

enabled_services

array

A hash of the remote server node's enabled services.

A comma-separated list of services.

apache_php_fpm
system_settingshashA hash of the remote server's child node system settings.A valid remote server's child's system settings.
 Click to view...
			"Mail": {
				"globalspamassassin": "1"
remote_node_linkagesarray of hashes

A hash of the remote server's child nodes. This function returns this information via the list_linked_server_nodes function.

Note:

If you call this function on a parent node for its child node, this function returns an empty hash.

A valid remote server's child node data.
 Click to view...
"worker_capabilities" : {
               "Mail" : {}
            },
            "version" : "11.86.0.1",
            "hostname" : "mailnode.example.com",
            "system_settings" : {
               "Mail" : {
                  "globalspamassassin" : "1"
               }
            },
            "tls_verified" : 0,
            "last_check" : 1583934071,
            "username" : "root",
            "enabled_services" : [
               "apache_php_fpm",
               "cpanellogd",
               "cpdavd",
               "cpgreylistd",
               "cphulkd",
               "cpsrvd",
               "crond",
               "dnsadmin",
               "exim",
               "imap",
               "ipaliases",
               "lmtp",
               "mailman",
               "mysql",
               "named",
               "nscd",
               "pop",
               "queueprocd",
               "rsyslogd",
               "spamd",
               "sshd",
               "tailwatchd"
            ],
            "alias" : "MailNode"

tls_verified

Boolean

Whether the remote server node has a valid SSL certificate.

  • 1 — The remote server node has a valid SSL certificate.
  • 0 — The remote server node does not have a valid SSL certificate.
1

version

string

The installed version of cPanel & WHM on the remote server node.

A valid cPanel & WHM version number.

11.86.0.0