Managing HAPEE Using the Command Line Interface (CLI)

A HAPEE Command Line Interface (formely CLI) is available from the package hapee-1.7r1-cli and allows you to:

  • report information about the current HAPEE deployment
  • manage HAPEE processes
  • interact with hapee-1.7r1-lb stats socket to report statistics, current sessions, errors
  • open a shell on running hapee-1.7r1-lb
  • print help

Install HAPEE CLI

When installed, the package hapee-1.7r1-cli adds a bash completion script in the file /etc/profile.d: /etc/profile.d/hapee-1.7-completion.sh.

This script executes when you log into the server and enables a new command called hapee. To use it, type hapee and press the [TAB] key twice:

hapee
condrestart   force-reload  help          lb            reload
restart       start         status        stop          try-restart   version
The hapeecommand becomes available at the next login. To use it right after installation, run source /etc/profile.d/hapee-1.7r1-completion.sh in your current shell.

Retrieve an information report

To get an information report, enter the HAPEE version for the CLI reports your want to retrieve:

  • the HAPEE version
  • installed HAPEE packages
  • installed HAPEE packages versions

Example on Debian/Ubuntu:

hapee version
HAPEE version 1.7r1
ii  hapee-1.7r1-base 1.7...   all          HAPEE BASE : Common dependencies
ii  hapee-1.7r1-cli  1.7...   amd64        HAPEE CLI : Command line interfac
dpkg-query: no packages found matching hapee-1.7r1-cli-lb
ii  hapee-1.7r1-lb   1.7...   amd64        HAPEE LB : Layer 7 load-balancing
dpkg-query: no packages found matching hapee-1.7r1-lb-sanitize
dpkg-query: no packages found matching hapee-1.7r1-lb-update
dpkg-query: no packages found matching hapee-1.7r1-log
dpkg-query: no packages found matching hapee-1.7r1-rhi
dpkg-query: no packages found matching hapee-1.7r1-route
dpkg-query: no packages found matching hapee-1.7r1-snmp
dpkg-query: no packages found matching hapee-1.7r1-vrrp

Example on CentOS/RedHat:

hapee version
HAPEE version 1.7apee-1.7r1-base-1.7....noarch
hapee-1.7r1-cli-1.7....x86_64
package hapee-1.7r1-cli-lb is not installed
hapee-1.7r1-lb-1.7....x86_64
package hapee-1.7r1-lb-sanitize is not installed
package hapee-1.7r1-lb-update is not installed
package hapee-1.7r1-log is not installed
package hapee-1.7r1-rhi is not installed
package hapee-1.7r1-route is not installed
package hapee-1.7r1-snmp is not installed
package hapee-1.7r1-vrrp is not installed

Manage HAPEE processes

You can manage HAPEE processes with the command: hapee <action> [<service name>.

CLI can execute the following actions on any daemon installed by HAPEE:

  • condrestart: restart a service only if it was already running
  • force-reload: reload a service configuration
  • reload : reload service configuration
  • restart : restart a service
  • start : start a service
  • stop : stop a service
  • try-restart : like condrestart

If you don’t specify a service name, the command executes the action on all HAPEE services. It is the shortened version of the service name, such lb, log, rhi, route, vrrp, etc.

Examples

  • Start all HAPEE services: hapee start
  • Reload hapee-1.7r1-lb configuration: hapee reload lb

Check HAPEE status

The HAPEE CLI can report on the status of each daemon with the command hapee status [<service name>]

If you do not specify the service name, the command reports on all statuses of all daemons.

Example: Display the status of HAProxy:

hapee status lb
hapee-1.7r1-lb (pid  1136) is running...

Example: Display the status of all HAPEE services:

hapee status
hapee-1.7r1-vrrp (pid  1120) is running...
hapee-1.7r1-lb (pid  1136) is running...
rsyslogd (pid  1145) is running...
hapee-1.7r1-rhi is not installed
hapee-1.7r1-route is not installed
hapee-1.7r1-route6 is not installed
hapee-1.7r1-snmp is not installed

Get Help

You can also use the HAPEE CLI to get help about installed components, such as:

  • Daemon options
  • Configuration
  • Use cases

To use this command: enter hapee help <service name>, then press [TAB] key to get the list of available help.

Example:

  • Read HAProxy’s documentation: hapee help lb config
  • Read VRRP’s configuration: hapee help lb config