Is there any way to use remote api to get a number of websites on each server

Discussion in 'Developers' Forum' started by webguyz, Apr 30, 2015.

  1. webguyz

    webguyz Member HowtoForge Supporter

    I have a multiserver setup would like to determine number of websites on each server so I can write a script to create a new acct/website on the least busy (least number of websites).

    Is there a routine in api that can be used to determine that?

    Thanks!
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    you can query all records from web_domain table with the api by server id plus type vhost, so the number of records in the resulting array is the number of sites on that server, use the extended query syntax of the sites_domain_get function for that where you pass an array as primary id.
     

Share This Page