⚙️ Configuration Files

The ConHive Agent is designed with flexibility in mind. Each module has its own JSON configuration file, located in the configs directory within the agent’s workspace. If no configuration file is found for a module, default settings will be applied.

Example Configuration Files in workdir/configs:

  • agentmanager.json
  • filemanager.json
  • … and others as needed.

🌐 Viewing and Editing Configuration via the Web Interface

The ConHive Agent includes an embedded web interface that lets you view and modify configuration settings with ease:

  1. Open the ConHive Web Interface in your browser.
  2. Navigate to the Modules page.
Module Overview
  1. Select the module you wish to configure.
  2. Modify the settings as required.
  3. Click Save to apply the changes.
Configuration Editor

📝 Configuration File Structure

The configuration files use JSON format. Below is an example from agentmanager.json:

{
  "server": {
    "host": "0.0.0.0",
    "port": 5050,
    "tls": false,
    "cors": ["*"],
    "username": "admin",
    "password": "------"
  },
  "logging": {
    "level": "info",
    "format": "text",
    "toFile": true,
    "maxSizeMb": 50,
    "maxBackups": 3,
    "maxAgeDays": 30
  },
  "database": {
    "enabled": false,
    "folder": "backup",
    "maxAgeDays": 7,
    "intervalHours": 12
  }
}

Note: Changes made to configuration files will only take effect after restarting the ConHive Agent.


🛠️ Managing Configuration

The ConHive Agent provides several commands to manage its configuration. Below are some common operations:

Create a Default Configuration

To generate a new default configuration file, run:

./conhive-agent config create

Display the Current Configuration

To print the current configuration to the command line, run:

./conhive-agent config get

Show the Configuration File Location

To view the location of the configuration file, run:

./conhive-agent config location

Edit the Configuration Manually

  1. Open the desired configuration file in your favorite text editor, for example:

    nano workdir/configs/agentmanager.json
    
  2. Make your changes.

  3. Save the file and restart the agent to apply the changes:

    sudo systemctl restart conhive-agent.service
    

This guide provides an overview of the data structure and configuration management for the ConHive Agent. With a well-organized workspace and flexible configuration options, you can tailor the agent to meet your unique device management needs.