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

Client Map #40

Open
mrmrslobos opened this issue Sep 27, 2023 · 0 comments
Open

Client Map #40

mrmrslobos opened this issue Sep 27, 2023 · 0 comments

Comments

@mrmrslobos
Copy link

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.

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

1 participant