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.

Does it exist? Script to remotely restart service(s) on selected server.

Discussion in 'cPanel Developers' started by electric, Sep 26, 2012.

  1. electric

    electric Well-Known Member

    Joined:
    Nov 5, 2001
    Messages:
    697
    Likes Received:
    1
    Trophy Points:
    18
    Hello,

    We frequently need to restart mysql/ftp/http/whatever on one of our servers. This task currently involves connecting to the server using ssh or WHM and then issuing or clicking the appropriate restart command.

    Does there exist a simple script that lists all configured servers, and for each service on each server there is a "restart" link?

    The idea is that when we need to restart a service, it would be easier to just click a single link on a webpage then suffer through remembering individual server logins, etc. Also, often when a service needs to be restarted load is very high and ssh and WHM are slow. Would maybe be faster to issue a direct API command? (Assuming load is not too high to disallow the api command to be received and processed.)

    (The webpage would be hosted in-house, so I'm not worried about security..)

    Does anyone know if this script already exists?
     
  2. cPanelDavidN

    cPanelDavidN Integration Developer
    Staff Member

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Re: Does it exist? Script to remotely restart service(s) on selected serve

    hi electric

    You can check and restart services using the Remote API. The calls are documented here: XML and JSON APIs

    Regards,
    -DavidN
     
  3. electric

    electric Well-Known Member

    Joined:
    Nov 5, 2001
    Messages:
    697
    Likes Received:
    1
    Trophy Points:
    18
    Re: Does it exist? Script to remotely restart service(s) on selected serve

    Thanks DavidN -- We have created a few apps already for internel use using the APIs. The api method is sometimes easier then using WHM or ssh...

    And that is why I was asking about this particular issue... because it seems a simple conolidated "restart services" page for multiple servers would be something a lot of hosts (with multiple servers) would find useful.

    I'm sure this must already exist, and I hate to re-invent the wheel... so I figured I'd ask.

    Anyone know of such a script that already exists?
     
  4. cPanelDavidN

    cPanelDavidN Integration Developer
    Staff Member

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Re: Does it exist? Script to remotely restart service(s) on selected serve

    Ah Sorry, I mis-interpreted your post. You're soliciting for existing scripts that others have written. No worries.

    If you can't find one, no one replies, or you simply decide to make your own, the documentation I pointed to will likely be the what you or your developer needs to provide the functionality you've described.

    Best Regards,
    -DavidN
     
Loading...

Share This Page