dinger1986 / TRMM-Grafana

Grafana Dashboards setup and preconfigured to work with Tactical RMM
30 stars 17 forks source link

Client Map #40

Open mrmrslobos opened 1 year ago

mrmrslobos commented 1 year ago

Hi,

Has there been a fix for the Client map. I get the "db query error: pq: column "stdout" does not exist"

SELECT agents_agentcustomfield.string_value AS "location", concat(agents_agent.hostname, ' / ', agents_agent.description) as "nameAgent", greatest ( CASE --WHEN CAST(substring(stdout from '\, failing: (.+)\, warning') AS DECIMAL ) = 1 THEN 201 WHEN CAST(substring(stdout from '\, failing: (.+)\, warning') AS DECIMAL ) = 0 THEN 0 ELSE 100 END, CASE --WHEN CAST(substring(stdout from '\warning: (.+)\, info') AS DECIMAL ) = 1 THEN 101 WHEN CAST(substring(stdout from '\warning: (.+)\, info') AS DECIMAL ) = 0 THEN 0 ELSE 200 END ) as "finalState" FROM checks_check, agents_agent INNER JOIN clients_site on site_id = clients_site.id LEFT OUTER JOIN agents_agentcustomfield on agents_agent.id = agents_agentcustomfield.agent_id LEFT OUTER JOIN core_customfield on agents_agentcustomfield.field_id = core_customfield.id WHERE (field_id IN (SELECT id FROM core_customfield WHERE name = 'geohas') OR field_id is null) and agents_agentcustomfield.string_value <> '' and checks_check.agent_id = agents_agent.id AND site_id IN (SELECT id FROM clients_site WHERE client_id IN (SELECT id FROM clients_client WHERE name IN ($Client)))

Here is the query that I am using. Has any got this working? The script is setup in the RMM to populate the geohash field. But Grafana can't find the stdout field.

sistemmsn commented 1 day ago

So this is more of an issue with the Grafana map than with the script?

dinger1986 commented 1 day ago

I don't know sorry