Custom charts
Hi,
Long time Cacti user here, but we all know that Cacti can sometimes get to be hairy.
I tried beszel and the experience is great.
From some research I could not find a way to, for example count http connections to my servers. So...
My suggestion is having a VERY simple plugin system where the agent would read a directory of files before sending them to the server and these files are named for example: http_num_conns_min, sql_exec_min, etc.
These files are overwritten by scripts that are written in whatever language the system admin likes and are also reusable from other systems such as Cacti.
On the beszel server side we would see the graph of http_num_conns_min and maybe have an option to put an alias of "HTTP connections per minute" and other metadata if you feel like adding some more inputs.
Let me know if you like this and/or close this enhancement issue if it's a duplicate.
Bless you for writing software like this and keep up the great work!
That's a good idea. Maybe we can use YAML config to let you define extra charts / sources.
I don't mind how it is done as long as there's a possibility to add it. However I do have some opinions. Why not have a simple modal here:
near "Add System" | {if system} "Add Graph" {/if}
This then opens a simple modal that asks for file name and graph name.
On the agent side, provide a tack -watch <dir> or config where scripts output numeric values to the files. Of course agent should parse the contents of the file and ignore if it's not a numerical value since we don't want to lug around garbage.
What do you think?
Sorry for the late reply, I'm not on the computer much because I'm visiting family over the holidays.
Currently the hub cannot pass any information to the agent, and all custom configuration for the agent is defined on the agent side.
Perhaps this will change in the future, which would open the door to features like web SSH and control of Docker containers.
But there are security issues that need to be worked out before this is implemented. It would probably be in a 1.0.0 release much farther down the road.
I think the simplest way to do this as it stands now is to allow the agent to define some options in a yaml file and supply it to the agent with CONFIG=/path/to/config.yml.
How do you feel about something like this?
# monitor network services / devices
services:
- name: paperless
host: 192.168.8.8:8000
type: http
- name: security-camera
host: 192.168.8.14
type: ping
# define custom charts
charts:
- name: HTTP Connections
desc: Current number of HTTP connections to the server
cmd: example-command | grep xxx | sed 's/xxx/xxx/'
- name: Another Chart
desc: Lorem ipsum dolor sit amet consectetur
file: /path/to/file
Looks good :)
I would love if we could use the ubiquitous monitoring-plugins in beszel - they already cover a wide range of usecases and somebody tried wrote a specification draft for the interface
I'd love to see this and be able to add specific min/max values for the returned command.
So the user could specify custom script in the yaml:
#!/bin/bash
do some commands here and echo the value that should be reported to Beszel
See PR #792 for my proposed implementation of this. My approach uses the Pocketbase API store the custom data and the chart information. I don't see a need to use a separate YAML config rather than using the database to hold the information.
Another option is to include a statsd server in the agent. It's a really simple and convenient way to create charts on the fly with zero configuration. That's also the best way I found to pass custom application metrics to Netdata.
+1 this would be great even if i have to manually add config to the agent yes. Thanks for a great light weight monitoring alternative. Discovered it pretty recently but its a good fit for home lab monitoring etc as apposed to Grafana and Influx