Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting to work with influx v2.7.4 flux queries #39

Open
c-stewa20 opened this issue Aug 26, 2024 · 3 comments
Open

Getting to work with influx v2.7.4 flux queries #39

c-stewa20 opened this issue Aug 26, 2024 · 3 comments

Comments

@c-stewa20
Copy link

I have a majority of all the queries working, but can't seem to get the System Overview, Global Status Map, Physical Disks, System Logs to work quite right.

When I import the file, nothing is imported for the queries, so not sure what the grafana setting are for those panels.

Here is the query for the Status Map

from(bucket: v.defaultBucket)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "idrac-hosts")
|> filter(fn: (r) => r["_field"] == "system-globalstatus")
|> filter(fn: (r) => r["agent_host"] =~ /${idrac_host:regex}/)
|> group(columns: ["_field", "system-name"]) // Group by field and system name
|> last() // Get the last value within each group
|> keep(columns: ["_time", "_value", "_field", "system-name"]) // Keep only the relevant columns
|> yield(name: "last")

In influx Data Explorer it shows

Screenshot 2024-08-26 092554

Any help would be appreciated.

@Cybaen13
Copy link

Cybaen13 commented Sep 15, 2024

Hi,
Here is what i've done for the global status map:
I forked and modified the whole dashboard with flux queries if interested (the dashboard was not working at all on my instance)

from(bucket: "${bucket}")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "${hostslist_key}")
|> filter(fn: (r) => r["_field"] == "system-globalstatus")
|> group(columns: ["_field", "system-name"]) // Group by field and system name
|> keep(columns: ["_time", "_value", "system-name"])
|> sort(columns: ["system-name", "_time"], desc: false)
|> aggregateWindow(every:5m, fn:last)

@c-stewa20
Copy link
Author

I would very much be interested in the whole dashboard.

@Cybaen13
Copy link

I would very much be interested in the whole dashboard.

https://grafana.com/grafana/dashboards/21915-idrac-host-stats/
Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants