The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

cpanel api

Discussion in 'cPanel Developers' started by eugui, Aug 6, 2008.

  1. eugui

    eugui Member

    Joined:
    Dec 10, 2007
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Marília, SP, Brazil
    Hi,

    I have "cPanel 11.18.6-STABLE" and have a link to verify the server status (http://www.xxx.com.br:2082/frontend/x3/status.html) i want to know if its possible to aply this service at cpanel api. I have 10 servers and i want to create one page with all 11 servers status. This status is important to me.

    Thanks
     
  2. eugui

    eugui Member

    Joined:
    Dec 10, 2007
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Marília, SP, Brazil
    i got one script to do this:
    Code:
    
    $user = "";
    $pass = "";
    $servidor = "xx.xx.xx.xx";
    
    	$page = @file_get_contents("https://$user:$pass@$servidor:2087/scripts/servup");
    
    	$int = preg_match("/<center>\s+?<table>.*?<\/table><\/center>/is",$page, $match);
    	echo '<html>
    			<head>
    			<style>
    			.tbcell {
    			  font: normal 11px Arial, Helvetica, Tahoma, Verdana, sans-serif;
    			  text-decoration: none;
    			  color: #4B4B4B;
    			}
    			</style>
    			</head>
    			<body>
    
    			<table width="100%">
    				<tr>
    					<td align="center" class="tbcell">
    						<b>Status do Servidor:</b> '.$servidor.'<br><br>';
    
    	if($int) { 
    	  echo str_replace('src=/','src=',$match[0]);
    	}
    	else {
    	  echo 'Unable to access server status. Please try again later.';
    	}
    
    	echo '</td>
    			</tr>
    				</table>';
    
     
  3. djbob2

    djbob2 Well-Known Member

    Joined:
    May 14, 2005
    Messages:
    100
    Likes Received:
    0
    Trophy Points:
    16
  4. eugui

    eugui Member

    Joined:
    Dec 10, 2007
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Marília, SP, Brazil
    i know, i use cpanel api, but i'm searching server status scripts cpanel api.

    but now i have a code

    []´z
     
Loading...

Share This Page