Comments (4)
Hi @prasenforu
Please use 2.0.0
version of exporter from Docker or from releases.
You can use a script like this:
#!/bin/bash
hnm=`hostname`
if [ true ]
then
result=1
else
result=0
fi
if [ $result=1 ]
then
echo "{\"labels\": {\"host\": \"$hnm\"}, \"results\": {\"my_system_health\": 1} }"
else
echo "{\"labels\": {\"host\": \"$hnm\"}, \"results\": {\"my_system_health\": 0} }"
fi
exit 0
And run bash-exporter
like this, pointing to the folder with this script:
$ ./bash-exporter -path ../scripts -labels host
Note the flag -labels
. Here you must specify all the custom labels you want to use, comma-separated.
Then, your metrics will be available for Prometheus at :9300
:
$ curl 127.1:9300/metrics -s | grep ^bash
bash{host="my-hostname",job="job-3",verb="my_system_health"} 1
from bash-exporter.
Thanks for your valuable input ...
My target environment is Kubernetes and I want to use this script in a kubernetes configmap
so I can modify as much as possible without pushing script inside the container and rebuild container.
I just need to confirm that all scripts goes to /scripts/
inside the container. right!
And I can push multiple scripts...
one quick question is "bash" is default prefix for each metric.
is there anyway we can customized (as per my own choice)?
Let me deployed in my kubernetes cluster, may be will comeback again :)
from bash-exporter.
Looks like there are missing file job-3.sh in docker image version 2.0.0
from bash-exporter.
there was a problem with missing bash within the image, not script file
from bash-exporter.
Related Issues (9)
- Actually does not support string output, can you add string output function, thank you.
- Doesn't support multiple json output from a script
- issue with example scripts HOT 1
- Info request: Can execution of the scripts be triggered by a scrape? HOT 1
- deprecated prometheus.Handler is failing builds HOT 1
- Docker build not working - missing dependencies HOT 1
- Provided Docker container does not have bash installed (only sh)
- Setup difficulties + remedies
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bash-exporter.