Command line operations

Command line operations#

Endpoint Analytics supports command line operations for certain appliance-level administration actions and functions, even after the system has been fully deployed and configured.

To access the command line, start a console or SSH session to the management interface (ens160) of the Endpoint Analytics appliance.

As a security measure, attempts to log in as the root user will be blocked by the appliance. To issue commands requiring root privileges, initiate the SSH session as the beacon user before elevating to root.

Hint

The password for the beacon appliance user account can be changed using the passwd beacon command.

beaconctl command set#

The beaconctl command set is used to initiate various system-level operations from the command line. These commands primarly control the appliance software and run certain configuration scripts.

Note

All commands apart from help and status require root privileges.

The beaconctl script is located in /user/beacon on the appliance and can be used with the following options:

Option

Function

status

Returns the appliance software version and the current state of each system component as either running or not running

start

Starts all of Endpoint Analytics’ software components

stop

Stops all of Endpoint Analytics’ software components

restart

Stops all software components and restarts them immediately after

config

Re-runs the Endpoint Analytics appliance’s initial configuration script

setupnetwork

Re-runs the script to configure Endpoint Analytics’ network interface settings (ens160 IP, mask, gateway, and name server)

setupntp

Re-runs the script to configure Endpoint Analytics’ NTP server settings

help

Displays help for beaconctl command usage

When re-running any of the configuration scripts, the user will be prompted to confirm whether to proceed with the re-configuration. At the end of the script, the system will automatically be restarted.

Additional CLI operations#

In addition to the functions supported by the beaconctl command set, there are several other appliance-level operations that can only be performed via command line:

Clean appliance reboot or shutdown

These commands are used to gracefully shut down the Endpoint Analytics appliance (physical or VM) prior to powering it off. Performing a clean shut down or restart will ensure that the system is able to complete all running disk operations and close the database before it is powered down.

To completely shut down or power off the appliance, issue the following command with root privileges:

shutdown -p now

To reboot/restart the appliance, issue the following command with root privileges:

shutdown -r now
Database restoration

The Endpoint Analytics database is automatically backed up on a daily basis and can also be backed up manually from the System Summary page of the Endpoint Analytics web interface.

To restore the database from a backup, follow these steps:

  1. Copy the database backup file to /backup on the appliance (if not already present there) using secure copy protocol (SCP)

Hint

To perform a system restore from the most recent database backup, use the symbolic link dailyDB-latest.gz in the /backup directory.

  1. Open an SSH session to the appliance, change directory to usr/beacon/scripts/maint and run the following script:

    ./restoreDB.pl /backup/<backup_filename>
    
  2. After running the script, navigate to Configuration > Data Processing in the web interface, and then click the Re-model button to refresh the system using the restored database.

By default, the script will automatically restart all system modules before it finishes running. To disable this, add the -nostart switch to the command line.

Database autotuning

The Endpoint Analytics database is automatically tuned to suit available system resources during the initial installation process.

The autotuning script can also be run manually when and as needed via CLI.

To run the script, open an SSH session to the appliance and change directory to /usr/beacon/scripts/maint.

From there, run the following script:

./db_config_manager

The database autotuning script has the following settings that can be changed:

Setting

Description

Flag

Auto

Adjusts postgresql.conf

-a

automatically based on

hardware

Reset

Resets postgresql.conf

-r

to factory default

Size

Deploys preconfigured

-s

postgresql.conf based on

(S|M|L)

standard database sizing

Help

Displays command help

-h