Parallels H-Sphere Documentation System Administrator Guide

 

Java Command Line Tools

 

Last modified: 27 Dec 2007

 

WARNING: This documentation covers Parallels H-Sphere versions up to 3.1. For the latest up-to-date Parallels H-Sphere documentation, please proceed to the official Parallels site.

This document lists java command line tools that come with the standard H-Sphere installation.

  1. DNSCreator
  2. IPMigratorFast
  3. PhysicalCreator
  4. PostApacheConfigs
  5. PostFTPConfigs
  6. ServerAliasesRenamer
  7. ChangeLServerId
  8. MIVAEmpresaFix
  9. KeyPairGenerator
  10. PGPEncrypter
  11. PGPMessageSigner
  12. PGPMessageVerify
  13. RepostResellerSSLConfigs
  14. ServiceZoneRenamer
  15. BillingEraser
  16. SetQuota
  17. UrchinReconfig
  18. OffLogs
  19. Reset Balance
  20. RegenerateIpsFile
  21. VPSConvertor24_25
  22. (HS 3.0 Patch 2+) LicenseExtractor
  23. (HS 3.1 Beta 1+) MailRelayCorrector

IMPORTANT:
Before running a Java tool, make sure to log into CP server as the cpanel user:
su -l cpanel

 

DNSCreator

NAME:
          psoft.hsphere.tools.DNSCreator - H-Sphere DNS zones recreator.
USAGE:
          java -Xms64M -Xmx512M psoft.hsphere.tools.DNSCreator -m creation_method [-dz] -z zonename
OPTIONS:
          -m|  creation method. Possible values: db or rand
                db - pick NS servers as they are defined in the H-Sphere database
                rand - pick NS servers randomly
          -dz|--delete_zones - delete zones first.  Add this option only if such zones already exist.
                    With this option, DNS creation will take at least twice more time.
          -lids|--logical-servers - process zones which are on the logical servers with the specified IDs.
          (This option makes sense if you have more than four logical name servers with clearly defined Used By roles)
          -pip|--pServerIP - specifies a physical server by its primary IP. All necessary logical
                    server IDs are chosen automatically. Often -pip is used as an alternative to -lids.
          -z|--zone  - recreate only one specified zone.  Without this option, all zones will be recreated.

   Note:
   - If both lids and -z parameters are specified, the -z parameter will be ignored.
   -  (HS 2.5.0 Patch 7+) The tool also accepts zone names separated by linebreaks:
     java -Xms64M -Xmx512M psoft.hsphere.tools.DNSCreator -m creation_method [-dz] < filename, where
     filename is the name of the file which contains zone names separated by linebreaks.

DNS Creator is used in Single DNS Configuration, Changing IPs on Systems Using NAT, Moving DNS and in Moving Mail Accounts.

 

IPMigratorFast

NAME:
         psoft.hsphere.tools.IPMigratorFast - H-Sphere IP migration utility
SYNOPSIS:
         java -Xms64M -Xmx512M psoft.hsphere.tools.IPMigratorFast [options] ipmigration.
OPTIONS:
        --help  - shows this screen
        --ip-change     -  change IP
        --repost-configs        -  repost IP dependemd resources
        --recreate-zone         -  change and repost DNS records
        --service-zone  -  change service zone server IP
        --custom-rec    -  process service DNS records
        --lServerIds=,,...,      - to specify logical server ids
        --repost-cp-ssl         -  Repost SSL CP VHost configs
        --clear-old-ips         -  remove old ips from database and servers

 

PhysicalCreator

NAME:
     psoft.hsphere.tools.PhysicalCreator - Utility for physical recreation of H-Sphere resources
USAGE EXAMPLE:
     java -Xms64M -Xmx512M psoft.hsphere.tools.PhysicalCreator -rg mail -co -lid 22
SYNOPSIS:
     psoft.hsphere.tools.PhysicalCreator options
OPTIONS:
        -h|--help               - shows this screen
        -rg|--rgroup            - resource group to perform operations on
         The following resource groups are allowed:
                 unixweb:       Unix virtual hosting resources
                 winweb:        Windows virtual hosting resources
                 mysql:         MySQL resources
                 pgsql:         PGSQL resources
                 mail:          Mail resources
        -co|--create-only       - performs creation resources routines only
        -do|--delete-only       - performs delete resources routines only
        -rc|--recreate          - performs both delete and creation resources routines
        -lid|--lserverId        - process accounts on logical server with given number
        -accs|--accounts        - account IDs separated by comma
        -st|--start-from        - account ID. Process will start from this account ID
Make sure to specify Xms Xmx parameters to the java command when recreating a big number of accounts.

To learn more, type java -X

This tool is also used in Recovering H-Sphere Services.

For more info about this tool, read our document on Physical Creator.

 

PostApacheConfigs

Usage:
java -Xms64M -Xmx512M psoft.hsphere.tools.PostApacheConfigs [-lid n ] [ -ic ]

        -lid|--lserverid n work only on accounts on logical server with passed number
        -ic|--initcontent initialise content
        -h|--help print this message

 

PostFTPConfigs

NAME:
        psoft.hsphere.tools.PostFTPConfigs - H-Sphere virtual FTP hosts gererator utility
SYNOPSIS:
        java -Xms64M -Xmx512M psoft.hsphere.tools.PostFTPConfigs options
OPTIONS:
        -h|--help               - shows this screen
        -acc|--acountId number  - process only account with given number
        -lid|--lserverId        - process only accounts on logical server with given number
        -all|--all              - process all virtual FTPs

FTPConfig tool is used in ProFTPd 1.2.8p Update.

 

ServerAliasesRenamer

NAME:
      psoft.hsphere.tools.ServerAliasesRenamer
        This H-Sphere tool recreates server aliases for resellers.
SYNOPSIS:
      java -Xms64M -Xmx512M psoft.hsphere.tools.ServerAliasesRenamer [options]
Usage:
      java -Xms64M -Xmx512M psoft.hsphere.tools.ServerAliasesRenamer
OPTIONS:
         --help - shows this screen
         --xml  - run the tool for determined xml file
         --lserver ...  - run the tool for determined Logical Server IDs

 

ChangeLServerId

NAME:
         psoft.hsphere.tools.ChangeLServerId - changing logical server id in H-Sphere database
SYNOPSIS:
         java -Xms64M -Xmx512M psoft.hsphere.tools.ChangeLServerId [options]
OPTIONS:
        --help  - shows this screen
        -a|--account ACCOUNT_ID -f|--from LOGICAL_SERVER_ID_1 -t|--to
LOGICAL_SERVER_ID_2
                where
                ACCOUNT_ID - id of the account you want to change;
                LOGICAL_SERVER_ID_1 - id of the logical server you want to change from;
                LOGICAL_SERVER_ID_2 - id of the logical server you want to change to;
SAMPLE:
        java -Xms64M -Xmx512M psoft.hsphere.tools.ChangeLServerId -a 1000 -f 1 -t 2

This tool is also used in Moving Mail Accounts.

 

MIVAEmpresaFix

"MIVAEmpresaFix" utility.
    Adds MivaEmpresa resource to the plans;
    Adds this resource to users which already has MivaMerchant in use.
    Works for Unix and Windows plans
   Usage:
   java -Xms64M -Xmx512M psoft.hsphere.tools.MIVAEmpresaFix

 

KeyPairGenerator

H-Sphere PGP key pair generator.
USAGE:
    java -Xms64M -Xmx512M psoft.hsphere.tools.KeyPairGenerator
        -i|--identification <youridentification string>
        -s|--subkeyidentification <your session key identification>
        -e|--encryptphrase <phrase for encryption/decryption private key>
        -prf|--privatekeyfile <file where private key will be saved>
        -pcf|--publickeyfile <file where public key will be saved>

This tool is used in PGP Encryption in Trouble Tickets.

 

PGPEncrypter

java -Xms64M -Xmx512M psoft.hsphere.tools.PGPEncrypter
   -m "This is a message to encrypt"
   -f "This is a file where encrypted phrase will be saved"
   -k "/path/to/PGP_Public_Key/file"

This tool is used for PGP Encryption in Trouble Tickets.

 

PGPMessageSigner

Misconfiguration H-Sphere PGP message signer.
Usage: java -Xms64M -Xmx512M psoft.hsphere.tools.PGPMessageSigner
   -m|--message <Message to sign>  or   -mf|--messagefile
</path/to/file/with/message/to/sign>
   -f|--file </path/to/file/for/signed/message>
   -k|--key </path/to/private/key/file>
   -p|--codephrase <private code phrase>

 

PGPMessageVerify

Misconfiguration H-Sphere PGP message verify.
Usage: java -Xms64M -Xmx512M psoft.hsphere.tools.PGPMessageVerify
   -f|--messagefile </path/to/file/for/signed/message>
   -k|--key </path/to/public/key/file>

 

RepostResellerSSLConfigs

NAME:
    psoft.hsphere.tools.RepostResellerSSLConfigs
        This H-Sphere tool recreates virtual host  config files for resellers.
SYNOPSIS:
    java -Xms64M -Xmx512M psoft.hsphere.tools.RepostResellerSSLConfigs [options]
OPTIONS:
        --help - shows this screen
        --process - run the tool for all config files
        --reseller <res_name_1> <res_name_2>...<res_name_n> - run the tool for determined reseller user names.

 

ServiceZoneRenamer

Utility for changing service zone name. Changes zone name, LServers names, rebuilds DNS.
WARNING: USE ONLY ON EMPTY INSTALLATION OF H-SPHERE.
Usage java -Xms64M -Xmx512M psoft.hsphere.tools.ServiceZoneRenamer -oz zone_name -nz
zone_name
    -oz|--old_zone Name of the currently present service zone
    -nz|--new_zone Name which should be set to service zone

 

BillingEraser

Permanently erases billing history of accounts.
Before running this utility, stop H-Sphere and back up H-Sphere system database.

SYNOPSIS:
    java -Xms64M -Xmx512M psoft.hsphere.tools.BillingEraser --accounts list_of_account_ids --resellers list_of_reseller_ids

NOTE:
    When --resellers option is used, the utility erases billing history for the specified reseller and all his users.
    There is no possibility to do it only for a reseller account (without touching users).
    Using --accounts and --resellers parameters simultaneously is disabled.
    Specified accounts and reseller ids are delimited with commas.

 

SetQuota

 NAME:
   java -Xms64M -Xmx512M psoft.hsphere.tools.SetQuota
        This H-Sphere tool resets quota on a web box according to the data
        found in H-Sphere DB for each account located on each logical server.

 SYNOPSIS:
    psoft.hsphere.tools.SetQuota [options]

 OPTIONS:
        --help              - shows help
        -lid|--lserverid    - process accounts located on Logical Server with specified ID only

 

UrchinReconfig

NAME:
         psoft.hsphere.tools.UrchinReconfig
                - Regenerate Urchin config. Used, for example, after account migration to restore Urchin settings
                  for moved domains.
SYNOPSIS:
         java -Xms64M -Xmx512M psoft.hsphere.tools.UrchinReconfig [options]
OPTIONS:
        --help        - shows help
        -a|--accounts - list of account IDs delimited with ',', or 'all' for all accounts
        -s|--servers  - list of logical server IDs delimited with ',', or 'all' for all servers
SAMPLE:
        java -Xms64M -Xmx512M psoft.hsphere.tools.UrchinReconfig -a '1002,8383,1237' -s '12,35,37'
        java -Xms64M -Xmx512M psoft.hsphere.tools.UrchinReconfig -a all -s all

 

OffLogs

          -bash-2.05b$ java -Xms64M -Xmx512M psoft.hsphere.tools.OffLogs --help
 NAME:
          psoft.hsphere.tools.OffLogs
                   - Regenerate users' logs and stats config
 SYNOPSIS:
          java -Xms64M -Xmx512M psoft.hsphere.tools.OffLogs [options]
 OPTIONS:
          --help - shows this screen
          -a|--accounts list of account IDs, or all for 'all' accounts, ',' - delimiter
          -s|--servers list of logical server IDs, or 'all' for all servers, ',' - delimiter
          -e|--errorlog re-generate errorlog only
          -ag|--agentlog re-generate agentlog only
          -r|--referrerlog re-generate referrerlog only
          -t|--transferlog re-generate transferlog only
          -w|--webalizer re-generate webalizer only
          -m|--modlogan re-generate modlogan only
          -aw|--awstats re-generate awstats only
 SAMPLE:
          java -Xms64M -Xmx512M psoft.hsphere.tools.OffLogs -a '1002,8383,1237' -s '12,35,37'
          java -Xms64M -Xmx512M psoft.hsphere.tools.OffLogs -a all -s all
          java -Xms64M -Xmx512M psoft.hsphere.tools.OffLogs -s 24 -aw -w

 

Reset Balance

NAME:
        psoft.hsphere.tools.ResetBalance
            This H-Sphere tool resets billing balance using different criteria.
            By default, the tool runs only in information mode. To fix balances, run utility with --process option.
SYNOPSIS:
        java -Xms64M -Xmx512M  psoft.hsphere.tools.ResetBalance options
OPTIONS:

    -h|--help - shows this screen
    -acc|--acountId number - process only accounts with given number
    -all|--all - process all accounts
    -b|--balance <ld balance> - process accounts with balance equal to <balance for process>
    -n|--newbalance <new balance> - set balance to <balance for process>
    -d|--description  - <credit description> - notes which will be added to credit operation
    --process - to force process, otherwise only affected accounts will show

 

RegenerateIpsFile

NAME:
        psoft.hsphere.tools.RegenerateIpsFile
            This H-Sphere tool regenerates file /hsphere/local/network/ips on Unix physical box

SYNOPSIS:
        java -Xms64M -Xmx512M psoft.hsphere.tools.RegenerateIpsFile options

OPTIONS:
          --help - shows this screen
          -all - regenerate on all physical boxes
          -pid - regenerate on physical servers with specified IDs

 

VPSConvertor24_25

(H-Sphere 2.5 RC 3 and up)

A tool to convert VPS plans and accounts during the update from H-Sphere 2.4.x to H-Sphere 2.5 and up.

NAME:
        psoft.hsphere.tools.VPSConvertor24_25
            Converts VPS plans and accounts during the update from H-Sphere 2.4.x to H-Sphere 2.5 and up
SYNOPSIS:
        java -Xms64M -Xmx512M psoft.hsphere.tools.VPSConvertor24_25 [options]

OPTIONS:
            --help - show this help
            --all - convert all VPS plans and accounts (recommended)

EXAMPLE:
        su -l cpanel
        java -Xms64M -Xmx512M psoft.hsphere.tools.VPSConvertor24_25 --all

Important: VPS converter leaves mail quota value blank in converted plans. To add DNS zones to VPS accounts afterwards, please make sure you set mail quota value in the plan.

 

LicenseExtractor

(H-Sphere 3.0 Patch 2 and up)

A tool to import License info to a file or print it to console screen.

NAME:
        psoft.hsphere.tools.LicenseExtractor -
            Imports License info to a file or prints it to console screen.
SYNOPSIS:
        java psoft.hsphere.tools.LicenseExtractor [options]

OPTIONS:
        --help - shows this screen
        --file </path/to/file>
         </path/to/file> - absolute path to the file and file name where license info will be imported;
         without options - shows license info to console screen.

 

MailRelayCorrector

(H-Sphere 3.1 Beta 1+)

If you've updated H-Sphere to 3.1 Beta 1, run this tool to create virtual users for every mail resource: mailbox, alias, forward, autoresponder, mailing list, and mail sms if mail relay is enabled for mail domain.

NAME:

        psoft.hsphere.tools.MailRelayCorrector -
            Processes all mail resources (mailbox, forward, alias, autoresponder, mailing list, sms)
            for maildomains with enabled mail relays and creates vitrtual users for each of them.

USAGE EXAMPLES:

        java -Xms64M -Xmx512M psoft.hsphere.tools.MailRelayCorrector -a 1233,1254
        java -Xms64M -Xmx512M psoft.hsphere.tools.MailRelayCorrector -lid 7
        java -Xms64M -Xmx512M psoft.hsphere.tools.MailRelayCorrector -d my_maildomain.com
        java -Xms64M -Xmx512M psoft.hsphere.tools.MailRelayCorrector --all

OPTIONS:

        -h|--help - shows this screen
        --all or without any parameter - process all accounts
        -a|--accounts - process accounts' IDs separated by comma
        -lid|--lserverId - process accounts on logical server with given number
        -d|--domains - process domains separated by comma


© Copyright 2017. Parallels Holdings. All rights reserved.