Giter Site home page Giter Site logo

blueiris_exporter's Introduction

blueiris_exporter

Prometheus exporter for Blue Iris. Confirmed working on Blue Iris version's 5.5.0.12 to 5.9.2.2

If you increment parse_errors metrics, please send me the details and I will work on adding support for it. Blue Iris has changed it's log format for AI a few times and I'm working on adding support for all of it. Also, if you have any ideas for different metrics, let me know!

Todo

Tests

Flags

Flag Description Default value Required
--telemetry.addr addresses on which to expose metrics :2112 No
--logpath Directory path to the Blue Iris Logs C:\BlueIris\log\ No
--telemetry.path URL path for surfacing collected metrics /metrics No
--service.install Install blueiris_exporter as a Windows service None No
--service.uninstall Uninstall blueiris_exporter Windows service None No
--service.start Start blueris_exporter Windows service None No
--service.stop Stop blueris_exporter Windows service None No
--service.pause Pause blueris_exporter Windows service None No
--service.continue Continue blueris_exporter Windows service None No

Installation and Usage

blueiris_exporter listens on HTTP port 2112 by default. See the --help output for more options.

You need to make sure that Blue Iris is saving the log to a file.

  1. Click the Status Button at the top left of Blue Iris
  2. Select the Log tab
  3. Check the box Save to file

By Default, Blue Iris will break out your log files by month. This means the counter metrics will reset at the beginning of each month. If you don't want this to happen, concider changing the name of your log files.

Windows

The latest release can be downloaded from the releases page. Save blueiris_exporter-amd64.exe to a safe place, it will be required to stay on your system to use blueiris_exporter.

Open a command prompt and change directory to the directory you saved the executiable.

To run the exporter (example):

blueiris_exporter-amd64.exe --logpath=C:\BlueIris\log

You can also run blueiris_exporter as a Windows service in the background. Open command prompt as Administrator (Start ->CMD->right click->Run as administrator) and change directory to the directory you saved the executiable. IMPORTANT: You may need to run the exporter once via command line shown above. A firewall allow window will pop up that you must click allow!

blueiris_exporter-amd64.exe --service.install --logpath=C:\BlueIris\log --telemetry.addr=:1234
blueiris_exporter-amd64.exe --service.start

If you need to update the config for the service, (Update path of the log dir etc) You can do so by uninstalling the service and installing with the new config

blueiris_exporter-amd64.exe --service.stop
blueiris_exporter-amd64.exe --service.uninstall
blueiris_exporter-amd64.exe --service.install --logpath=C:\BI\log --telemetry.addr=:5678
blueiris_exporter-amd64.exe --service.start

RHEL/CentOS/Fedora

Download the latest release from the releases page

wget -O /usr/bin/blueiris_exporter https://github.com/wymangr/blueiris_exporter/releases/download/<release>/blueiris_exporter-amd64-linux
chmod +x /usr/bin/blueiris_exporter
blueiris_exporter --camers=C1,C2,C3 --logpath=/mnt/blueiris/logs

To install as a systemd service, edit and create /etc/systemd/system/blueiris_exporter.service with the following content:

[Unit]
Description=Blue Iris Exporter
After=multi-user.target
[email protected]

[Service]
Type=simple
ExecStart=/usr/bin/blueiris_exporter --logpath=/blue_iris/log --telemetry.addr=:9876
StandardInput=tty-force
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=blueiris_exporter
Restart=always
RestartSec=5s

[Install]
WantedBy=multi-user.target

Then run systemctl start blueiris_exporter

Docker

The Docker image is not hosted yet on Docker Hub, so you will need to build the image.

docker build -t <image_name>:<tag> .

You can then start up the container, passing in the Blue Iris log directory.

docker run -d \
  -p 2112:2112 \
  -v "/path/to/blueiris/log:/path/to/blueiris/log" \
  <image_name>:<tag> \
  --logpath=/path/to/blueiris/log

For Docker compose, see example below.

---
version: '3.8'
services:

  blueiris_exporter:
    restart: unless-stopped
    build:
      context: .
      dockerfile: Dockerfile
    command: ["--logpath=/path/to/blueiris/log"]
    ports:
      - 2112:2112
    volumes:
      - /path/to/blueiris/log:/path/to/blueiris/log

Metrics

Name Description
ai_duration Duration (ms) of the last Blue Iris alert for each camera. This metric will continue to expose the last duration each time it's scraped
ai_duration_distinct Duration (ms) of the last Blue Iris alert for each camera. This metric will only show new alerts and will disapear the next scrpe
ai_count Count of the number of times IA analyzed and image
ai_restarted Number of times Blue Iris restarted the AI in the current logfile
ai_timeout Number of AI timeouts in the current logfile
ai_servererror Count of Deepstack server not responding errors in the current logfile
ai_notresponding Count of AI not responding errors in the current logfile
ai_starting Count of AI is being started log lines
ai_started Count of AI has been started log lines
logerror Count of unique errors in the current logfile
logerror_total Count of total errors in the logs
camera_status Status of each camera. 0=up, 1=down
triggers Count of camera triggers
push_notifications Count of push notifications sent
logwarning Count of unique warnings in the current logfile
logwarning_total Count all warnings in the current logfile
folder_disk_free Free space of the disk the folder is using in bytes
folder_used Size percentage of the limit a folder is using
hours_used Hour percentage of the limit a folder is using
parse_errors Lines in the Blue Iris log that this exporter was unable to parse. Open an issue to add support
parse_errors_total Total number of lines in the Blue Iris log that this exporter was unable to parse
profile Count of activation of profiles
ai_error Count of AI error log lines

Grafana Dashboard

https://grafana.com/grafana/dashboards/17432-blueiris/ Grafana Dashboard

blueiris_exporter's People

Contributors

wymangr avatar julesl2 avatar

Stargazers

Chris Vick avatar David U avatar  avatar Vladimir Pichugin avatar  avatar  avatar Buxton avatar VoxLuna avatar  avatar  avatar Chris Ktenas avatar Chase Bolt avatar  avatar

Watchers

VoxLuna avatar  avatar  avatar

Forkers

zm0rf julesl2

blueiris_exporter's Issues

[Windows .exe] panic: runtime error: index out of range [1] with length 0

I'm having issues setting this up with the Windows .exe executable. Sorry in advance, I'm not a prometheus power user, or Github regular so I'll try my best.

My log location is C:\BlueIris\log however when I add that to the cmd line I get an error when navigating to http://localhost:2112/metrics
image

Steps to replicate:

  1. new command window with the command blueiris_exporter-amd64.exe --cameras=letterboxes --logpath=C:\BlueIris\log, then execute
    image
  2. On a browser open http://localhost:2112/metrics
  3. In the cmd window a fatal error shows up, and the browser errors out
    image

Interestingly if I use an incorrect log path (eg. C:\BlueIris\loglogloglog) then instead of fatal error, a warning shows in the cmd window and the browser shows some /metrics info (obviously missing the BI log info as the log path is wrong).
image

Happy to provide whatever extra detail would be helpful

Windows 10 Pro 21H2

[BUG] blueiris_exporter crashes when BI log file contains many move/delete log entries

Describe the bug

I have particularly large Blue iris log files which retain all file delete/move actions. For example, my August 2024 log file was up to date 173 MB large.
blueiris_exporter crashes every time I start it with "concurrent map writes" error.
After removing hundreds of thousands of lines containing "Delete:" and "Move:" words and reducing the log file to manageable levels, the application (and service, subsequentially) started without errors.
I am not sure whether this was caused by attempting to read the whole file at once at start or its size only, however this month's log file size is currently 23 MB and I have unchecked logging of file move/deletes.

EDIT: I have just noticed the Grafana "Parse Errors" panel contains a bunch of "Delete" entries which I probably missed. If Delete lines are not parsed properly, this might cause the observed crash.

To Reproduce
Steps to reproduce the behavior:

  1. You need a large Blue Iris log file
  2. Start the exporter as usual
  3. See error.

Expected behavior
Resilience for large log files

Screenshots
Not Applicable

Desktop (please complete the following information):

  • OS: Windows 11 Pro
  • Blue Iris Version 5.9.4.11
  • blueiris_exporter Version [e.g. 1.x.x]

Additional context
This is not a request for fix, but merely informational. The user-facing fix most likely consists in not logging file moves/deletes in Blue Iris, however it might be a (low-priority) good idea to add code in the application which would avoid crashing if such a large log file is encountered.

Thank you for creating this great application!

Missing metrics

Hello, I'm using BlueIris 5.9.2.2. The exporter works without errors except for the below metrics:

Describe the bug
The following metrics do not show in the Prometheus status page:
ai_duration_distinct
folder_disk_free
folder_used
hours_used
push_notifications
triggers

The following do show in the status page but are not listed as metrics on the git splash page:
collector_duration_seconds
exporter_errors

All other splash page listed metrics appear and function normally.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Prometheus Status Targets and choose BlueIris exporter.
  2. See error

Expected behavior
I'd especially like to see the triggers metric

Desktop (please complete the following information):

  • OS: Windows 11
  • Blue Iris Version 5.9.2.2
  • blueiris_exporter Version latest

Thanks for the exporter, and it works very well.

Many `Unable to parse log line:` show each load (Windows .exe version)

Describe the bug
In the cmd window I'm getting many Unable to parse log line:

2022.11.04 19:35:44 - [console] - Unable to parse log line:
0       4/11/2022 7:33:35.017 PM        FrontDoor               AI: [Objects] person:90% [90,228 429,570] 261ms
2022.11.04 19:36:14 - [console] - Unable to parse log line:
0       4/11/2022 7:34:31.104 PM        NVR-SIDE2-MASK          AI: Alert cancelled [nothing found] 371ms
2022.11.04 19:36:14 - [console] - Unable to parse log line:

Attached is

  • Todays BI Log
  • Output from v1.0.4 windows .exe with the errors showing

blueiris_exporter-amd64 v1.0.4 cmd log.txt
blue_iris_log.txt

To Reproduce
Steps to reproduce the behavior:

  1. With the attached BI Log run blueiris_exporter
  2. Wait a few seconds after load, cmd window will then show all the Unable to parse log line: lines

Expected behavior
All log items in the BI log can be parsed without error.

Screenshots
image

Desktop:

  • OS: Window 10
  • Blue Iris Version: Blue Iris 5.6.2.10 x64 (25/10/2022)
  • blueiris_exporter Version 1.0.4 windows cmd

Additional context
N/A

Unable to parse log line [BUG]

Describe the bug
Good Day, i have installed and configure your exported. when i run the tool i get Unable to parse log line command that runs continually

To Reproduce
Steps to reproduce the behavior:

  1. installed the .exe on my c:\ drive
  2. opened the command prompt in admin mode.
  3. navigated the to the location were the .exe is located.
  4. ran this line to start : blueiris_exporter-amd64.exe --logpath=C:\BlueIris\log
  5. confirmed log is writing to /metric directory

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
image
image

Desktop (please complete the following information):

  • Windows Server 2019 - HP Gen10 Proliant
  • Blue Iris Version 5.7.9.14 (2023/11/01)
  • blueiris_exporter Version [e.g. 1.2.0 latest]

Additional context
Even though there is the parse error, the data still writes to my influxdb until the exporter tool times out.

"Unable to parse logfile" regarding RTSP errors[BUG]

Describe the bug
Getting many lines like this - which mighte well be and are legit errors due to "reasons" - unclear, if you might want to parse them at all, as they are not AI related:

2022.11.17 18:32:01 - [console] - Unable to parse log line:
1 16.11.2022 09:09:14.681 Cam1 Signal: RTSP: 503 Service Unavailable
2022.11.17 18:32:01 - [console] - Unable to parse log line:
1 16.11.2022 09:09:57.372 Cam1 Signal: RTSP: 404 Not Found
2022.11.17 18:32:01 - [console] - Unable to parse log line:
1 16.11.2022 09:12:09.922 Cam2 Signal: HTTP: 12002 Timeout

BlueIris on Windows, Cameras are Reolink cameras using the proprietary "Baichuan" protocol, getting an RTSP stream with 'neolink'.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.