Tag: whmapi1

  • Check if Cpanel Server need reboot from command line

    To check if Cpanel/WHM server need reboot from command line, run

    whmapi1 system_needs_reboot
    

    Example

    On a server with latest kernal

    [root@ns522466 ~]# whmapi1 system_needs_reboot
    --- 
    data: 
      details: {}
    
      needs_reboot: 0
    metadata: 
      command: system_needs_reboot
      reason: OK
      result: 1
      version: 1
    [root@ns522466 ~]# 
    

    On a server that need reboot

    [root@server22 ~]# whmapi1 system_needs_reboot
    --- 
    data: 
      details: 
        kernel: 
          boot_version: 3.10.0-962.3.2.lve1.5.42.el7.x86_64
          running_version: 3.10.0-962.3.2.lve1.5.39.el7.x86_64
        updates: 
          glibc: 2.17-323.el7_9
          linux-firmware: 20200421-80.git78c0348.el7_9
          openssl-libs: 1:1.0.2k-21.el7_9
      needs_reboot: 1
    metadata: 
      command: system_needs_reboot
      reason: OK
      result: 1
      version: 1
    [root@server22 ~]# 
    

    See Getting WHM Access from SSH on Cpanel Server

  • Configure Cpanel Server service using whmapi1

    To disable monitoring of MySQL service, run

    whmapi1 configureservice service=mysql enabled=1 monitored=0
    

    This wil prevent MySQL service get auto started.

    To enable Monitoring for MySQL service, run

    whmapi1 configureservice service=mysql enabled=1 monitored=1
    

    If you want to disable a service, change enabled=1 to enabled=0

    See whmapi1

  • Getting WHM Access from SSH on Cpanel Server

    To get WHM access from SSH, run

    whmapi1 create_user_session user=root service=whostmgrd locale=en
    

    This is useful when you have SSH key access to server, but no root password.

    whmapi1

    Open the URL you get in terminal in a browser, you have WHM root access with out password.

    For Cpanel, use

    whmapi1 create_user_session user=CPANEL-USERNAME service=cpaneld locale=en
    

    Check if Cpanel Server need reboot from command line

    See Cpanel, Configure Cpanel Server service using whmapi1