Our documentation is getting an overhaul! We would like your input! Click here to take a look at the beta launch of our new documentation site! Only cPanel & WHM version 82 documentation exists on our beta at this time. 84 will be added to the new site soon! Leave your feedback here: https://go.cpanel.net/docsfeedback
UAPI Functions - ServerInformation::get_information - Developer Documentation - cPanel Documentation
Child pages
  • UAPI Functions - ServerInformation::get_information
Skip to end of metadata
Go to start of metadata

Description

This function returns the status of each cPanel service (daemon), device, and server health check point on your server.

Examples


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess###########/execute/ServerInformation/get_information


Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Retrieve a list of monitored services on the account.
$service_status = $cpanel->uapi(
    'ServerInformation','get_information', 
);


Note:

For more information, read our Guide to the LiveAPI System.

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Retrieve a list of monitored services on the account.
my $service_statuss = $cpliveapi->uapi(
    'ServerInformation','get_information',
);


Note:

For more information, read our Guide to the LiveAPI System.

 Command Line
uapi --user=username ServerInformation get_information


Notes:

  • You must URI-encode values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to UAPI documentation or run the uapi --help command. 
  • If you run CloudLinux™, you must use the full path of the uapi command:

    /usr/local/cpanel/bin/uapi


 Output (JSON)
{  
   "metadata":{  
      "transformed":1
   },
   "errors":null,
   "messages":null,
   "status":1,
   "warnings":null,
   "data":[  
      {  
         "status":1,
         "type":"service",
         "name":"apache_php_fpm",
         "value":"up"
      },
      {  
         "name":"cpanel-dovecot-solr",
         "value":"up",
         "status":1,
         "type":"service"
      },
      {  
         "status":1,
         "type":"service",
         "name":"cpanellogd",
         "value":"up"
      },
      {  
         "value":"up",
         "name":"cpdavd",
         "type":"service",
         "status":1
      },
      {  
         "type":"service",
         "status":1,
         "value":"up",
         "name":"cphulkd"
      },
      {  
         "type":"service",
         "status":1,
         "value":"up",
         "name":"cpsrvd"
      },
      {  
         "value":"up",
         "name":"crond",
         "type":"service",
         "status":1
      },
      {  
         "type":"service",
         "status":1,
         "value":"up",
         "name":"dnsadmin"
      },
      {  
         "version":"exim-4.92-1.cp1180.x86_64",
         "name":"exim",
         "value":"up",
         "status":1,
         "type":"service"
      },
      {  
         "name":"ftpd",
         "value":"up",
         "status":1,
         "type":"service"
      },
      {  
         "value":"up",
         "version":"2.4.39",
         "name":"httpd",
         "type":"service",
         "status":1
      },
      {  
         "name":"imap",
         "value":"up",
         "status":1,
         "type":"service"
      },
      {  
         "name":"ipaliases",
         "value":"up",
         "status":1,
         "type":"service"
      },
      {  
         "value":"up",
         "name":"lmtp",
         "type":"service",
         "status":1
      },
      {  
         "value":"up",
         "name":"mailman",
         "type":"service",
         "status":1
      },
      {  
         "value":"up",
         "name":"mysql",
         "version":"5.7.25",
         "type":"service",
         "status":1
      },
      {  
         "name":"named",
         "value":"up",
         "status":1,
         "type":"service"
      },
      {  
         "status":1,
         "type":"service",
         "name":"nscd",
         "value":"up"
      },
      {  
         "value":"up",
         "name":"pop",
         "type":"service",
         "status":1
      },
      {  
         "value":"up",
         "name":"queueprocd",
         "type":"service",
         "status":1
      },
      {  
         "value":"up",
         "name":"rsyslogd",
         "type":"service",
         "status":1
      },
      {  
         "name":"spamd",
         "value":"up",
         "status":1,
         "type":"service"
      },
      {  
         "status":1,
         "type":"service",
         "name":"sshd",
         "value":"up"
      },
      {  
         "status":1,
         "type":"metric",
         "name":"Server Load",
         "value":"1.73"
      },
      {  
         "value":"2",
         "name":"CPU Count",
         "type":"metric",
         "status":1
      },
      {  
         "status":1,
         "type":"device",
         "name":"Memory Used",
         "value":"44.12%"
      },
      {  
         "value":"0.73%",
         "name":"Swap",
         "type":"device",
         "status":1
      },
      {  
         "status":1,
         "type":"device",
         "name":"Disk / (/)",
         "value":"26%"
      },
      {  
         "value":"0%",
         "name":"Disk /tmp (/tmp)",
         "type":"device",
         "status":1
      },
      {  
         "name":"Disk /var/tmp (/var/tmp)",
         "value":"0%",
         "status":1,
         "type":"device"
      }
   ]
}


Note:

Use cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell) to directly test cPanel API calls.

Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible valuesExample
namestringThe cPanel services, devices, and server health check points on the server.
  • A valid cPanel service.

     Click to view...
    • apache_php_fpm
    • clamd
    • cpanel-dovecot-solr 
    • cpanel_php_fpm
    • cpanellogd
    • cpdavd
    • cpgreylistd 
    • cphulkd
    • cpsrvd
    • crond
    • dnsadmin
    • exim
    • exim-altport
    • ftpd
    • httpd
    • imap
    • ipaliases
    • lmtp
    • mailman
    • mysql
    • named
    • nscd
    • p0f
    • pop
    • postgresql
    • queueprocd
    • rsyslogd
    • spamd 
    • sshd
    • syslogd
    • tailwatchd
    • tomcat
  • CPU Count — the number of CPUs on the server.
  • Disk mount (mount) — The server's disk mounts, where mount represents the disk mount.
  • Server Load — The server's CPU load.
  • Swap — The server's swap space.
cpsrvd
status

Boolean

or

string

Whether the resource is enabled or disabled.
  • 1 — Enabled.
  • 0 — Disabled.
  • unknown — The system couldn't determine the resource's status.
1
typestringThe type of resource.
  • device
  • metric
  • service
service
valuestring or integerThe resource's status.
  • up
  • down
  • unknown
  • An integer value.
up
versionstring

The resource's software version.

Important:

The function only returns this value if a valid software version exists.

A valid software version.
exim-4.92-1.cp1178.x86_64
errorstringThe system couldn't read a resource's status file.A valid error message.nscd is reporting errors.