![]() |
What is Prometheus Script Exporter?
Prometheus Script Exporter can be used to expose all those metrics that other exporters cannot get for you. You can configure these exporters according to your requirements and get custom data. But this exporter only exposes data to Prometheus in the form of 0 and 1.
Note: If you have not yet installed Prometheus, please follow Setup Prometheus for Monitoring to get started.
Today's Agenda
In
this post, we will learn how to install and configure Prometheus Script Exporter to expose custom metrics to Prometheus for visualization.
Prerequisite
This post has been prepared for the audience who :
- Have access to a Linux-based system although the steps are almost similar in other platforms like CentOS or MacOS.
- Have a basic understanding of Linux based systems and their commands.
- Have Setup Prometheus for Monitoring.
Let's get started
Run the below shell script with the root user on the server. You will see Script Exporter running as a service on port 9100 in your machine.
Note: You can update the version of the Script Exporter in the shell script in shaded regions.
You can also create a new user for Script Exporter to make the necessary changes in the script.
If you want to know how you can create a new user in Linux, please go through our post on Setup Prometheus for Monitoring posts and follow Step 1 of the post.
Finally, run the below command to check if Script Exporter has started exposing the system metrics at port 9469.
![]() |
Prometheus Script Exporter running on port 9469 |
To verify your scripts are running and providing correct results run the commands mentioned in below screenshots.
![]() |
Script Exporter exposing metrics for script "success" |
![]() |
Script Exporter exposing metrics for script "failure" |
For more details, you can also refer to the Github repository of Script Exporter for Prometheus.
Please follow our post Configure Exporters in Prometheus to understand how to connect Blackbox Exporter with Prometheus to start getting the system metrics.
That's all, you did a great job !!
If you face any issues or need any suggestions, please comment down below and hit the like button to appreciate the efforts.
You can also read:
- Shell Script to configure Fluentd logs agent.
- Shell Script to setup Telegraf metrics agent.
- Shell script to setup InfluxDb and Grafana for monitoring stack.
- Shell Script to install Logstash agent.
Comments
Post a Comment