Comments (5)
This could be solved using something such as path, err := exec.LookPath("binary")
- I'll submit a PR for this (likely on Monday) if this is still open
from ha_cluster_exporter.
Great @ashleyprimo. Thanks!
from ha_cluster_exporter.
regarding PR and issue, I'm not sure if we are embarking on the good direction. Imho we should just use command.exec
. https://golang.org/pkg/os/exec/#Command
In fact we are doing what already the command do , if you look at upstream doc:
If name contains no path separators, Command uses LookPath to resolve name to a complete path if possible. Otherwise it uses name directly as Path. ```
IMHO the best approach would to remove the OS.stat and check if binary, steps and execute the cmd.exec, which will already uses LookPat. If this fail, we can just adapt the error message that either binary was not found or the binary whatsoever wasn't executable. But this will allow us to be more clean without to many checks which we can spare imho in this scenario. (since cmd.exec uses already)
from ha_cluster_exporter.
This is a very good point, makes sense that it would revert to LookPath
natively; however, if were to just rely on the exec
we would lose the ability to check if it's able to find the binary and if the binary is executable - since os.Stat
relies on an absolute path.
Unless I'm missing something?
from ha_cluster_exporter.
ok but on highlevel point this 2 check what they would provide? if we can't execute the binary (because of lack of findings or is not exec) we have an IF which check the error , and an error is throwed.
Ok right that's true, I remember we don't check everytime the error now for other reasons.. valid point.
from ha_cluster_exporter.
Related Issues (20)
- Include Cluster Attributes Metrics
- corosync membership parsing with qdevice enabled HOT 3
- "'corosync' collector scrape failed: corosync parser error: could not parse members in corosync-quorumtool output: could not find membership information" HOT 4
- use crm_mon instead parsing cib with cibadmin for constraint metric HOT 6
- Exporter output when pacemaker is down HOT 7
- Change releases naming HOT 5
- research about addition of codeql
- Node atttributes and Systemd units data not showing up in Grafana HOT 4
- No data from the dashboard
- Issue with `ha_cluster_pacemaker_config_last_change` and timezone HOT 1
- corosync parser error: could not parse node id in corosync-quorumtool output: could not find Node ID line HOT 23
- Compress binaries attached to GH releases
- Error when disabled all cluster nodes HOT 7
- sbd data is not exported if devices in SBD_DEVICE have an space after ;
- Support SSL/TLS connections HOT 1
- Sample Prometheus alerting rules HOT 1
- Pacemaker metrics not available for monitoring HOT 1
- Not able to install Latest 1.3.0 version for prometheus-ha_cluster_exporter HOT 4
- HA Cluster configuration sample is erroneous HOT 2
- regexp parsing corosync-cfgtool output will not work HOT 2
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 ha_cluster_exporter.