-
Notifications
You must be signed in to change notification settings - Fork 18
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
Comments
So this is more of an issue with the Grafana map than with the script? |
I don't know sorry |
Hi everybody, after a huge code audit, I get rid off the error presented, and the view are fully functional. This is all the changes I have made: First: changed the "stout" with the table used to get the values: From: "WHEN CAST(SUBSTRING(stdout from '\, failing: (.+)\, warning') AS DECIMAL ) = 0 THEN 0" From: "WHEN CAST(SUBSTRING(stdout from '\warning: (.+)\, info') AS DECIMAL ) = 0 THEN 0" Another change I made to present all the geohas was simplify the query, I wipe off the clause with null condition to show only the nodes with information, From: and excluded the "and checks_check.agent_id = agents_agent.id" condition. In my case the dashboard is working fine. Hope helps someone. Thanks a lot!! |
But what script do you run on the server side so you get the coordinates. |
Do you want to submit a PR? |
Community scripts: https://github.com/amidaware/community-scripts/blob/main/scripts_wip/Win_Location_Get |
As you wish. How I do? |
fork the repo, make the changes then pr it back |
Hi, I've been doing some tests, but the teams don't appear on the Grafana maps. It seems that it does bring the data, but I don't know what happens with Grafana I also used this one but it doesn't show anything in grafana https://github.com/amidaware/community-scripts/blob/main/scripts_wip/Win_Location_Get.ps1 mmmm... I don't know but something isn't working right hehehe |
Hi @sistemmsn if you use location coords (lat and long) needs work with two fields, "latitude" and "longitude" separately, and in grafana change the Location Mode to Coords. |
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.
The text was updated successfully, but these errors were encountered: