Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# License Information

This repository contains multiple components, each with its own licensing terms. Please refer to the LICENSE file in each subdirectory for specific licensing information.

## Subdirectory Licenses

- **dashboard-deployments/** - Licensed under the Elastic License 2.0. See [dashboard-deployments/LICENSE](./dashboard-deployments/LICENSE) for full terms.
- **Other components** - Each subdirectory may have its own specific license. Check individual subdirectories for their respective LICENSE files.

## General Guidelines

Before using any component from this repository:

1. Navigate to the specific subdirectory you plan to use
2. Read the LICENSE file in that subdirectory
3. Ensure compliance with the specific license terms

For questions about licensing, please contact the FixedIT team.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# fixedit-data-agent-dashboards
# FixedIT Data Agent Examples

This repository contains an InfluxDB + Grafana stack with provisioned dashboards for Axis camera monitoring with the FixedIT Data Agent edge application.
This repository provides resources for the [FixedIT Data Agent ACAP](https://fixedit.ai/products-data-agent/) for the Axis network cameras and other Axis devices.

**📊 Server-side dashboards** - The [dashboard-deployments](./dashboard-deployments) directory contains visualization dashboards that work with the FixedIT Data Agent. Some work directly with the bundled configurations (just spin them up and start visualizing), while others can be used as-is or customized for your needs. Advanced users often combine edge device customization with dashboard modifications to visualize new data types.

The dashboard stack in the image below is the system monitoring example for the bundled configuration in the FixedIT Data Agent, for more details see the [README](./dashboard-deployments/system-monitoring-influxdb2-flux-grafana/README.md) in the dashboard-deployments directory.

![Grafana Dashboard Overview](./dashboard-deployments/system-monitoring-influxdb2-flux-grafana/.images/laptop-with-grafana-for-monitoring.png)

**🛠️ Edge device customization** - Project implementation examples that show how to extend and customize the FixedIT Data Agent by uploading custom configuration files and scripts. This makes it easy to create tailored edge applications for Axis devices without starting from scratch using the AXIS ACAP SDK.

[Comming soon...]
55 changes: 55 additions & 0 deletions dashboard-deployments/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
Elastic License 2.0

URL: https://www.elastic.co/licensing/elastic-license

Acceptance

By using the software, you agree to all of the terms and conditions below.

Copyright License

The licensor grants you a non-exclusive, royalty-free, worldwide, non-sublicensable, non-transferable license to use, copy, distribute, make available, and prepare derivative works of the software, in each case subject to the limitations and conditions below.

Limitations

You may not provide the software to third parties as a hosted or managed service, where the service provides users with access to any substantial set of the features or functionality of the software.

You may not move, change, disable, or circumvent the license key functionality in the software, and you may not remove or obscure any functionality in the software that is protected by the license key.

You may not alter, remove, or obscure any licensing, copyright, or other notices of the licensor in the software. Any use of the licensor's trademarks is subject to applicable law.

Patents

The licensor grants you a license, under any patent claims the licensor can license, or becomes able to license, to make, have made, use, sell, offer for sale, import and have imported the software, in each case subject to the limitations and conditions in this license. This license does not cover any patent claims that you cause to be infringed by modifications or additions to the software. If you or your company make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.

Notices

You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms.

If you modify the software, you must include in any modified copies of the software prominent notices stating that you have modified the software.

No Other Rights

These terms do not imply any licenses other than those expressly granted in these terms.

Termination

If you use the software in violation of these terms, such use is not licensed, and your licenses will automatically terminate. If the licensor provides you with a notice of your violation, and you cease all violation of this license no later than 30 days after you receive that notice, your licenses will be reinstated retroactively. However, if you violate these terms after such reinstatement, any additional violation of these terms will cause your licenses to terminate automatically and permanently.

No Liability

As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.

Definitions

The licensor is the entity offering these terms, and the software is the software the licensor makes available under these terms, including any portion of it.

you refers to the individual or entity agreeing to these terms.

your company is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. control means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.

your licenses are all the licenses granted to you for the software under these terms.

use means anything you do with the software requiring one of your licenses.

trademark means trademarks, service marks, and similar rights.
28 changes: 28 additions & 0 deletions dashboard-deployments/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Dashboard examples for the FixedIt Data Agent

This directory contains example dashboard deployments for the FixedIT Data Agent. Depending on what the Data Agent is used for, different stacks of e.g. InfluxDB and Grafana are used together with provisioned dashboards. This makes it easy to try a setup to start visualizing the data from your Axis devices running the FixedIT Data Agent.

## [System monitoring with InfluxDB (v2) and Grafana](./system-monitoring-influxdb2-flux-grafana)

This example shows how to set up advanced dashboards for Axis device system monitoring. These dashboards works with the bundled configuration files in the FixedIT Data Agent. The dashboards are built using InfluxDB 2.x as a database and Flux as the query language.

## Open source licenses

The dashboards in this repository are open source for your convenience and are licensed under the Elastic License 2.0. This means that in most cases you can use them for both commercial and non-commercial purposes, but there are some exceptions.

- By default, you are not allowed to use the dashboards to provide a service to third parties. If you want to do that, you need to contact the FixedIT team to get a license.
- When redistributing the dashboards, you need to include our license notice in the redistributed files, source us as the original authors and include any copyright notices.

For full license details, see the [LICENSE](./LICENSE) file.

### Can I use the dashboards internally in my own business?

Yes, you are allowed to use the dashboards internally in your own business (including commercial purposes).

### Can I setup these dashboards and sell access to them to our customers?

You will need to contact the FixedIT team to get our approval, which we in most cases are happy to give.

### Can I use the dashboards internally to monitor a service we sell to customers?

Yes, you are allowed to use the dashboards internally in your own business, also for monitoring a service you sell to customers.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
# InfluxDB and Grafana Monitoring Stack

This directory contains a complete system monitoring stack designed to work with the **FixedIT Data Agent** running on Axis devices. The stack includes InfluxDB for time-series data storage and Grafana with pre-built dashboards for visualizing system metrics and device health from your Axis device fleet.

![Grafana Monitoring Overview](.images/laptop-with-grafana-for-monitoring.png)

## What This Stack Provides

This monitoring solution gives you comprehensive visibility into your Axis devices through three specialized dashboards:

- **System Overview**: Fleet-wide metrics including connected devices, recently lost devices, and performance outliers
- **Overview of Devices**: Individual device information with detailed metrics, IP addresses, and system health
- **Device Details**: Deep-dive into specific device performance including CPU, RAM, network, and geo-location data

The stack is designed for DevOps and IT professionals who want to deploy monitoring infrastructure for devices running the FixedIT Data Agent, without needing to create dashboards from scratch.

## The Database and Query Language

This monitoring stack uses **InfluxDB 2** with the **Flux query language** for all data queries and dashboard visualizations.

**Important Note**: InfluxDB 3 has moved away from Flux to SQL-based queries. However, we chose to use InfluxDB 2 with Flux for this stack because:

- InfluxDB 2 with Flux is still the most widely adopted version in the community
- Most existing time-series monitoring setups use Flux
- The Flux query language is well-suited for time-series data analysis

If you're already using InfluxDB 3 in your environment, you would need to adapt the dashboard queries from Flux to SQL syntax.

## Prerequisites

- Docker and Docker Compose installed on your server
- Network connectivity between your Axis devices (running FixedIT Data Agent) and the server hosting this stack
- Basic familiarity with InfluxDB and Grafana (helpful but not required)

## Quick Start

Choose one of the deployment options below:

### Option A: Simple Demo (Recommended for Testing)

This is the quickest way to test the monitoring stack on your local machine. Everything is pre-configured with hardcoded values.

1. **Start the stack:**

```bash
docker compose up -d
```

2. **Verify it's running:**
- **InfluxDB**: [http://127.0.0.1:8086](http://127.0.0.1:8086) - login with username `test` and password `testtest`
- **Grafana**: [http://127.0.0.1:3000](http://127.0.0.1:3000) - login with username `admin` and password `test`

⚠️ **Note**: This uses hardcoded credentials and ports. Only use for local testing.

### Option B: Production-Like Example

This provides a more secure example with environment variables and additional monitoring features. It's still an **example to build upon**, not a complete production solution.

1. **Generate secure environment variables:**

```bash
./helper_scripts/generate-env.sh
source env.sh
```

2. **Start the enhanced stack:**
```bash
docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d
```

This example includes:

- Environment variables for all sensitive data
- Configurable ports for multiple instances
- Health checks for both services (needs some more work)

⚠️ **Note**: This is still an example configuration. For actual production use, you'll need additional security hardening, backup strategies, and monitoring.

### Port Configuration

The production-like setup uses configurable ports to allow running multiple instances on the same server. The demo setup uses hardcoded ports (8086 for InfluxDB, 3000 for Grafana) for simplicity. You can change the production ports by editing the `env.sh` file after generation with the `helper_scripts/generate-env.sh` script or by manually setting the environment variables before launching the stack.

### Deployment Organization

This dashboard stack can be deployed multiple times to the same server. This is useful if you want to monitor multiple sites and have them completely isolated from each other. To enable this, you need to use the production override file (`docker-compose.prod.yml`) with the generated environment variables. This will make sure that the ports are not the same and that a project specific prefix will be used for the container names.

The intended deployment pattern is to use **separate folders for different deployments**:

- Copy the content of this directory to separate folders (e.g., `site-1-dashboard/`, `site-2-dashboard/`, etc.)
- Each folder contains the same code and has its own `env.sh` file with unique credentials and ports
- Data volumes mount to consistent folder names within each deployment directory
- This makes it easy to see which code version was used for each deployment and keeps credentials isolated.

## Configure Your FixedIT Data Agent

After deploying the stack, configure your Axis devices to send data to it:

**For Simple Demo (Option A):**

- **InfluxDBHost**: `http://YOUR_SERVER_IP:8086`
- **InfluxDBToken**: `KLoG_Z0NsDIbVzS7zVn_VwhgxUgvwaGWE1wwO9SsGfNEeMaopLMsAA2aAGbCshpetVdu86Ig3-WTKugv6Srg6w==` (demo admin token)
- **InfluxDBOrganization**: `Whisperer`
- **InfluxDBBucket**: `Cameras`

_Note: The demo uses the admin token for simplicity. For any real testing beyond local evaluation, create dedicated tokens as described below._

**For Production-Like Example (Option B):**

- **InfluxDBHost**: `http://YOUR_SERVER_IP:${INFLUXDB_PORT}` (check your env.sh for port)
- **InfluxDBToken**: Create a dedicated token in InfluxDB (see security note below)
- **InfluxDBOrganization**: `Whisperer` (hardcoded in docker-compose.yml)
- **InfluxDBBucket**: `Cameras` (hardcoded in docker-compose.yml)

⚠️ **Security Best Practice**: Do NOT use `${INFLUXDB_ADMIN_TOKEN}` for your cameras. Instead, log into InfluxDB and create dedicated tokens with write-only permissions to the `Cameras` bucket. Ideally create one token per camera, or at minimum a shared token with restricted permissions.

**To create a camera token in InfluxDB:**

1. Log into InfluxDB UI with admin credentials
2. Go to "Data" → "API Tokens" → "Generate API Token"
3. Choose "Custom API Token"
4. Grant only "Write" permission to the `Cameras` bucket
5. Use this token for your FixedIT Data Agent configuration

**⚠️ Grafana Security Note**: Grafana also uses the admin token by default (configured via environment variables in docker-compose files). For better security, you should:

1. Create a separate token for Grafana with only "Read" permission to the `Cameras` bucket
2. Log into Grafana → Configuration → Data Sources → InfluxDB
3. Update the token field with your new read-only token
4. Test the connection to ensure it works

**Summary of recommended tokens for secure setup:**

- **Admin token**: Keep for InfluxDB administration only
- **Camera tokens**: Write-only access to `Cameras` bucket (one per camera ideally)
- **Grafana token**: Read-only access to `Cameras` bucket

Once configured, metrics will appear in the Grafana dashboards within a few minutes.

## Grafana Dashboards

Open the Grafana UI to access the pre-built dashboards. The URL and credentials depend on your deployment option:

- **Option A (Simple Demo)**: [http://127.0.0.1:3000](http://127.0.0.1:3000) - login with username `admin` and password `test`
- **Option B (Production-Like)**: Check your `env.sh` file for the port and admin password

### Accessing the Dashboards

After logging into Grafana, navigate to the dashboards by clicking on the Grafana icon and selecting "Dashboards":

![Dashboards tab in Grafana](.images/dashboards-tab.png)

The dashboards are organized in a "Cameras" folder for easy organization:

![Dashboard folder containing camera dashboards](.images/dashboard-folder-cameras.png)

### Pre-built Dashboard Overview

This stack includes three comprehensive dashboards designed specifically for monitoring Axis devices running the FixedIT Data Agent:

#### 1. System Overview Dashboard

Provides fleet-wide visibility including connected device counts, recently lost devices, and performance outliers. This dashboard is designed to give you a high-level view of your entire device ecosystem without overwhelming detail on individual devices.

![System Overview Dashboard](.images/dashboard-system-overview.png)

#### 2. Overview of Devices Dashboard

Shows detailed information for all connected devices including last report times, AXIS OS versions, IP addresses, and individual device performance metrics. Perfect for monitoring the health and status of your device fleet.

![Overview of Devices Dashboard](.images/dashboard-overview-of-devices.png)

#### 3. Device Details Dashboard

Provides deep-dive analytics for individual devices, including detailed system metrics, geographic tagging information, and network performance data. Access this dashboard by clicking on any device identifier from the other dashboards.

![Device Details Dashboard](.images/dashboard-device-details.png)

### Integration with FixedIT Data Agent

These dashboards are designed to work seamlessly with the default configuration of the FixedIT Data Agent. The agent automatically collects and sends system metrics to InfluxDB, which are then visualized through these Grafana dashboards. No additional configuration is needed beyond setting up the InfluxDB connection details in your FixedIT Data Agent settings.

## Known Issues and Limitations

**A note on efficiency**: Some of the dashboard visualizations are rather compute-intensive and may perform slowly when used with many cameras, a large amount of data or insufficient server resources. We will continue to optimize the dashboards and the data model to improve performance.

## Helper Scripts

The directory [helper_scripts](./helper_scripts/) contains scripts that can assist with deployment, see the [README](./helper_scripts/README.md) for more details.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This override file:
# - Adds healthchecks to InfluxDB and Grafana
# - Overrides production secrets for InfluxDB and Grafana
# - Supports multiple deployments on same host using COMPOSE_PROJECT_NAME
#
# This stack is only intended as an example.

version: "3.8"

services:
influxdb:
container_name: influxdb-${COMPOSE_PROJECT_NAME:-default}
environment:
- DOCKER_INFLUXDB_INIT_USERNAME=admin
- DOCKER_INFLUXDB_INIT_PASSWORD=${INFLUXDB_PASSWORD}
- DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=${INFLUXDB_ADMIN_TOKEN}
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8086/health"]
interval: 30s
timeout: 5s
retries: 3
labels:
- "com.ouroboros.enable=true" # Explicitly allow monitoring
restart: unless-stopped

grafana:
container_name: grafana-${COMPOSE_PROJECT_NAME:-default}
environment:
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PASSWORD}
- INFLUXDB_TOKEN=${INFLUXDB_ADMIN_TOKEN}
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"]
interval: 30s
timeout: 5s
retries: 3
labels:
- "com.ouroboros.enable=true" # Explicitly allow monitoring
restart: unless-stopped
Loading