1

I have a bash script which runs on a linux server which stores the data to a csv file and send it via email. This script runs every week. The output of the script is of the format

12/21/2022: 300
19/12/2022: 450

I have promethuese server running on same server and grafana as well in a centralised server. Is there a way where I can graphically represents this csv output in grafana?

so instead of email, people can just see the graph and corelate the data ?

Promethuese is running as kubernetes pods in a seperate namespace and the shell script is running in kubernetes master node

I found a way to manually imports google sheet, but is there a way to automate it via script where I can push the results directly to promethuese server and then use promethuese as a datasource in grafana and create dashboard ?

markalex
  • 8,623
  • 2
  • 7
  • 32

1 Answers1

0

This can be achieved in a couple of different ways:

  • If produced csv file is reachable form Grafana (it's not quite clear you are speaking about your own centalized server or grafana.com in question) you could use CSV plugin. This way Grafana could query data for visualization straight from csv, no additional steps.
  • If host where script is run has node_exporter and it is possible to change format of output of the script: change output format to Pormetheus' text-based metris and enable textfile collector in node_exporter.
  • If host has not node_exporter, but changing of script feasible you could use pushgateway to push metrics into Prometheus.
  • If all other routes not available, you always could write your own exporter and expose/push parsed from CSV (by very same exporter) metrics.
markalex
  • 8,623
  • 2
  • 7
  • 32