Dashboard Map Device Count

Hi I've been having an issue with the number of devices per location not being correct when displayed on the Dashboard Map. A few of our sites have the correct count, but most do not. From the list view everything is ok. The devices accessible and are set to a location that is geolocating to coordinates, but it's like they're not being counted properly.
Thanks Tony

Hi,
It’s not quite clear what you’re comparing.
Adam.
Sent from my iPhone
On 20 Jan 2022, at 20:35, Anthony Milazzo via observium observium@observium.org wrote:
Hi I’ve been having an issue with the number of devices per location not being correct when displayed on the Dashboard Map. A few of our sites have the correct count, but most do not. From the list view everything is ok. The devices accessible and are set to a location that is geolocating to coordinates, but it’s like they’re not being counted properly.
Thanks Tony
observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium

If you hover over a location its number of devices up are not always correct. [image: image.png] Here my map shows 1 device up and 0 down but when I click on this location and get the list view: [image: image.png] It shows me that 3 devices have this location
/Markus
Den fre 21 jan. 2022 kl 10:24 skrev Adam Armstrong via observium < observium@observium.org>:
Hi,
It’s not quite clear what you’re comparing.
Adam.
Sent from my iPhone
On 20 Jan 2022, at 20:35, Anthony Milazzo via observium < observium@observium.org> wrote:
Hi
I’ve been having an issue with the number of devices per location not being correct when displayed on the Dashboard Map. A few of our sites have the correct count, but most do not. From the list view everything is ok. The devices accessible and are set to a location that is geolocating to coordinates, but it’s like they’re not being counted properly.
Thanks
Tony
observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium

Hi Adam Yes, apologies for the lack of detail in my first email, but Markus described the issue perfectly. The UP/Down count of devices per location is not always accurate on the dashboard map.
For example, in one of our sites, the map displays Up 4 devices, and Down 0
But the actual device list for that location is 84 Up and 2 down.
The location address is the same for all the devices at that site.
Thanks Tony
From: observium observium-bounces@observium.orgmailto:observium-bounces@observium.org On Behalf Of Markus Klock via observium Sent: Friday, January 21, 2022 6:46 AM To: Observium observium@observium.org Cc: Markus Klock markus@best-practice.se Subject: Re: [Observium] Dashboard Map Device Count
[CAUTION: EXTERNAL EMAIL] If you hover over a location its number of devices up are not always correct. [cid:image001.png@01D80EA8.4EB9E590] Here my map shows 1 device up and 0 down but when I click on this location and get the list view: [cid:image002.png@01D80EA8.4EB9E590] It shows me that 3 devices have this location
/Markus
Den fre 21 jan. 2022 kl 10:24 skrev Adam Armstrong via observium <observium@observium.orgmailto:observium@observium.org>: Hi,
It’s not quite clear what you’re comparing.
Adam. Sent from my iPhone
On 20 Jan 2022, at 20:35, Anthony Milazzo via observium <observium@observium.orgmailto:observium@observium.org> wrote: Hi I’ve been having an issue with the number of devices per location not being correct when displayed on the Dashboard Map. A few of our sites have the correct count, but most do not. From the list view everything is ok. The devices accessible and are set to a location that is geolocating to coordinates, but it’s like they’re not being counted properly.
Thanks Tony
_______________________________________________ observium mailing list observium@observium.orgmailto:observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observiumhttps://linkprotect.cudasvc.com/url?a=http%3a%2f%2fpostman.memetic.org%2fcgi-bin%2fmailman%2flistinfo%2fobservium&c=E,1,EDfLrknbR5DMNISz6IiJcp0ME8W6aJBxi2ja9DzLkU5rewsMUFImaw5YEnTGPKLoDkpqGytj5RcUrcAAKhHtCKOA-uxfLlr2pMIxRkew1Nmz6jC0TddsHA,,&typo=1 _______________________________________________ observium mailing list observium@observium.orgmailto:observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observiumhttps://linkprotect.cudasvc.com/url?a=http%3a%2f%2fpostman.memetic.org%2fcgi-bin%2fmailman%2flistinfo%2fobservium&c=E,1,LOBrdJg1O9mfFR_HyNRM3Qd0EoHaqSBhYUrf8H3pflWrsuN1ykmFDZHCk_OUPMYXKtR7xPWGnaBUUx9PrPtSa93s0B0fUnyd5Y41c7nNg6U,&typo=1

The logic is super simple to build the array for the geojson:
foreach ($GLOBALS['cache']['devices']['id'] as $device)
{
if (!$config['web_show_disabled'] && $device["disabled"]) { continue; }
$lat = (is_numeric($device['location_lat']) ? $device['location_lat'] : $config['geocoding']['default']['lat']);
$lon = (is_numeric($device['location_lon']) ? $device['location_lon'] : $config['geocoding']['default']['lon']);
if ($device["status"] == "0")
{
if ($device["ignore"] == "0")
{
$locations[$lat][$lon]["down_hosts"][] = $device;
}
} else {
$locations[$lat][$lon]["up_hosts"][] = $device;
}
}
We then iterate over each lat/lon pair and build the geojson entry for it. If the devices aren’t ending up in the same lat/lon pair, they probably don’t have the same lat/lon values.
Check the location information tab for the device in its settings, make sure the lat/lon coordinates match for all 3.
Adam.
From: observium observium-bounces@observium.org On Behalf Of Anthony Milazzo via observium Sent: 21 January 2022 14:36 To: Observium observium@observium.org Cc: Anthony Milazzo amilazzo@gtweed.com Subject: Re: [Observium] Dashboard Map Device Count
Hi Adam
Yes, apologies for the lack of detail in my first email, but Markus described the issue perfectly. The UP/Down count of devices per location is not always accurate on the dashboard map.
For example, in one of our sites, the map displays Up 4 devices, and Down 0
But the actual device list for that location is 84 Up and 2 down.
The location address is the same for all the devices at that site.
Thanks
Tony
From: observium observium-bounces@observium.org mailto:observium-bounces@observium.org On Behalf Of Markus Klock via observium Sent: Friday, January 21, 2022 6:46 AM To: Observium <observium@observium.org mailto:observium@observium.org > Cc: Markus Klock <markus@best-practice.se mailto:markus@best-practice.se > Subject: Re: [Observium] Dashboard Map Device Count
[CAUTION: EXTERNAL EMAIL]
If you hover over a location its number of devices up are not always correct.
Here my map shows 1 device up and 0 down but when I click on this location and get the list view:
It shows me that 3 devices have this location
/Markus
Den fre 21 jan. 2022 kl 10:24 skrev Adam Armstrong via observium <observium@observium.org mailto:observium@observium.org >:
Hi,
It’s not quite clear what you’re comparing.
Adam.
Sent from my iPhone
On 20 Jan 2022, at 20:35, Anthony Milazzo via observium <observium@observium.org mailto:observium@observium.org > wrote:
Hi
I’ve been having an issue with the number of devices per location not being correct when displayed on the Dashboard Map. A few of our sites have the correct count, but most do not. From the list view everything is ok. The devices accessible and are set to a location that is geolocating to coordinates, but it’s like they’re not being counted properly.
Thanks
Tony
_______________________________________________ observium mailing list observium@observium.org mailto:observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fpostman.memetic.org%2fcgi-bin%2fmailman%2flistinfo%2fobservium&c=E,1,EDfLrknbR5DMNISz6IiJcp0ME8W6aJBxi2ja9DzLkU5rewsMUFImaw5YEnTGPKLoDkpqGytj5RcUrcAAKhHtCKOA-uxfLlr2pMIxRkew1Nmz6jC0TddsHA,,&typo=1
_______________________________________________ observium mailing list observium@observium.org mailto:observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fpostman.memetic.org%2fcgi-bin%2fmailman%2flistinfo%2fobservium&c=E,1,LOBrdJg1O9mfFR_HyNRM3Qd0EoHaqSBhYUrf8H3pflWrsuN1ykmFDZHCk_OUPMYXKtR7xPWGnaBUUx9PrPtSa93s0B0fUnyd5Y41c7nNg6U,&typo=1
participants (3)
-
Adam Armstrong
-
Anthony Milazzo
-
Markus Klock