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.

php / check script domains

Discussion in 'General Discussion' started by richenou, Jan 26, 2008.

  1. richenou

    richenou Well-Known Member
    PartnerNOC

    Joined:
    Feb 17, 2004
    Messages:
    86
    Likes Received:
    0
    Trophy Points:
    6
    hi all
    I need your help for a script very usefull for all cpanel managers.

    host is: ns1.server.com

    I need to get the list of all domains on WHM and then to ping it
    then, display them in a webpage if the domains don't ping on this host (ns1.server.com)

    ex: ping toto.com if dont ping on ns1.server.com then display it in the page

    can you make it in php?

    thanks for your help.
     
  2. richenou

    richenou Well-Known Member
    PartnerNOC

    Joined:
    Feb 17, 2004
    Messages:
    86
    Likes Received:
    0
    Trophy Points:
    6
    <?php $domaine = 'domain.com';

    echo gethostbyname($domaine); ?>


    i tried this

    but how can I get the list of my 100 domains in whm?

    :rolleyes:
     
  3. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    You can use the listaccts XML-API call to list the primary domain of each cPanel account on the server. Documentation for the XML-API can be found at: http://www.cpanel.net/plugins/devel
     
Loading...

Share This Page