Categraf Exec plugin script usage guide, for scenarios where custom monitoring scripts are used to collect data.
Although Categraf already includes many built-in collection plugins, there are always scenarios where custom monitoring data needs to be collected. In such cases, you can consider using Categraf’s input.exec plugin. This plugin can execute user-specified scripts (Shell, Python, Perl scripts, or even Go / C++ binaries — anything that is executable), then capture the script’s stdout and parse it into monitoring data.
Some community users have previously contributed sample plugin scripts you can reference: Categraf Exec Plugin Script Samples. Contributions of additional samples are welcome.
Common Questions
Q1: How do I collect data via custom scripts?
A: Use Categraf’s exec plugin — it executes your script on a schedule and converts the output (Prometheus or InfluxDB format) into time-series metrics for reporting.
Q2: Are there requirements for the script output format?
A: By default, InfluxDB Line Protocol. Prometheus text format is also supported:
# HELP my_metric_name help text
# TYPE my_metric_name gauge
my_metric_name{label="value"} 42