Show Cpanel Service Status On External PHP Page

Drewley

Member
Oct 30, 2006
16
0
151
Has it been done?
Is it possible?

If so could someone point me in the right direction?

thanks in advance.
 

CoreISP.net

Active Member
May 25, 2006
43
0
156
cPanel Access Level
DataCenter Provider
Has it been done?
Is it possible?

If so could someone point me in the right direction?

thanks in advance.
Well...

I did that once a couple of years back by including the script using PHP, making it login to cPanel and obtain the info with a POST command.

I do think however, that there are way more better ways then this option :P
I thought cPanel even had a function included for this somewhere.
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
I thought cPanel even had a function included for this somewhere.
AFAIK, there's no entry in the XML API or API2 (which you can use via the XML API) to access service status via cPanel/WHM.

What we do have is the ability to add services to chkservd to be checked routinely by cPanel/WHM.

Creating your own script to do this would not be difficult, especially with connection-based monitoring. Just attempt to open a socket to a port and send some data and if the data you get back is what you expected then your server is online. You'll have to figure out the code for that yourself ;).

Check out /etc/chkserv.d/ for the data chkservd sends and expects on connection-based monitoring. Of course you can also do command-based monitoring like chkservd supports.

For details on the syntax of that file, you can refer to my Customizing cPanel presentation (PDF) from the 2007 cPanel Training Seminar. Information on this begins at slide/page 41.