dinger1986 / TRMM-Grafana

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

error in line 1458 of JSON file dashboards/clientdash.json #42

Closed tiiilerteee closed 1 day ago

tiiilerteee commented 7 months ago

Thank you for these great dashboards for TRMM!

Just FYI: there is an error in line 1458 of JSON file dashboards/clientdash.json

There are special characters that are not properly escaped and need double backslashes

suggested to replace line 1458:

"rawSql": "SELECT \n count() as \"count\",\n (CASE \n WHEN wmi_detail->'cpu' IS NOT NULL\n THEN SUBSTRING(agents_agent.wmi_detail->'cpu'->0->0->>'Name','(?:AMD|\d\dth Gen Intel(R)||Intel(R)|Intel)(.)(?:@|Processor||with)')\n ELSE SUBSTRING(agents_agent.wmi_detail->'cpus'->>0,'(?:AMD|\d\dth Gen Intel(R)||Intel(R)|Intel)(.*)(?:@|Processor||with)')\n END) as \"CPU Name\"\nFROM agents_agent\n INNER JOIN clients_site ON agents_agent.site_id = clients_site.id\n INNER JOIN clients_client ON clients_site.client_id = clients_client.id\nWHERE\n clients_client.name IN ($Client)\n AND clients_site.name IN ($Sites)\nGroup by \"CPU Name\"\nOrder by \"count\" desc",

with:

"rawSql": "SELECT \n count() as \"count\",\n (CASE \n WHEN wmi_detail->'cpu' IS NOT NULL\n THEN SUBSTRING(agents_agent.wmi_detail->'cpu'->0->0->>'Name','(?:AMD|\d\dth Gen Intel\(R\)||Intel\(R\)|Intel)(.)(?:@|Processor||with)')\n ELSE SUBSTRING(agents_agent.wmi_detail->'cpus'->>0,'(?:AMD|\d\dth Gen Intel\(R\)||Intel\(R\)|Intel)(.*)(?:@|Processor||with)')\n END) as \"CPU Name\"\nFROM agents_agent\n INNER JOIN clients_site ON agents_agent.site_id = clients_site.id\n INNER JOIN clients_client ON clients_site.client_id = clients_client.id\nWHERE\n clients_client.name IN ($Client)\n AND clients_site.name IN ($Sites)\nGroup by \"CPU Name\"\nOrder by \"count\" desc",

dinger1986 commented 7 months ago

Please PR and I will accept it