MassimilianoPasquini97 / zbx_unifi_network

Zabbix Template for Unifi Network
MIT License
61 stars 10 forks source link

Add makro for different sites #35

Closed JustLukassss closed 1 week ago

JustLukassss commented 2 months ago

Template doesnt find devices that are under different site. There is different URL. image image

Instead of /Default/ probably some UUID is used.

Thank you Lukas.

gonzalobellon commented 2 months ago

Hi, +1 to this request, the template is awesome and site compatibility would be great! In the meantime, how can I duplicate the template in order to use it in different sites? Best regards.

SergeyLeongard commented 1 month ago

Привет, +1 к этому запросу, шаблон потрясающий и совместимость с сайтом была бы отличной! В то же время, как я могу дублировать шаблон, чтобы использовать его на разных сайтах? С наилучшими пожеланиями.

dalezorz commented 1 week ago

Template doesnt find devices that are under different site. There is different URL. image image

Instead of /Default/ probably some UUID is used.

Thank you Lukas.

Hi @JustLukassss @gonzalobellon @SergeyLeongard

I believe you add/change the following in the config to change the site from personal to something else. Just ensure the Unifi user account has access to the site that you want to monitor. Change it from api/s/default/stat to api/s/example*/stat

Screenshot 2024-11-13 at 11 25 10 AM Screenshot 2024-11-13 at 11 26 37 AM
gonzalobellon commented 1 week ago

Hi everyone. Indeed, if you replace the word 'default' with the site ID, you can monitor the devices of that site. But, if you want to monitor another site in the same controller, you can't. This is what I'm looking for, I have several sites in my controller, but I can only monitor one. Perhaps you can clone the template, but I don't know how. I appreciate your help. Best regards.

dalezorz commented 1 week ago

Hi everyone. Indeed, if you replace the word 'default' with the site ID, you can monitor the devices of that site. But, if you want to monitor another site in the same controller, you can't. This is what I'm looking for, I have several sites in my controller, but I can only monitor one. Perhaps you can clone the template, but I don't know how. I appreciate your help. Best regards.

@gonzalobellon just add a new host and use the same template, just modify the "default" to the new site ID. It will be the same host IP but give the new host the name of the secondary site. Then repeat for the third and fourth sites etc.

gonzalobellon commented 1 week ago

Hi everyone. Indeed, if you replace the word 'default' with the site ID, you can monitor the devices of that site. But, if you want to monitor another site in the same controller, you can't. This is what I'm looking for, I have several sites in my controller, but I can only monitor one. Perhaps you can clone the template, but I don't know how. I appreciate your help. Best regards.

@gonzalobellon just add a new host and use the same template, just modify the "default" to the new site ID. It will be the same host IP but give the new host the name of the secondary site. Then repeat for the third and fourth sites etc.

Hi dalezorz, thanks for your response. I did as you say, but I'm getting this error: Preprocessing failed for: {}

  1. Failed: cannot extract value from json by path "$.data[3].num_pending": no data matches the specified path

I'm using the same template, the first created site work, but 2 others don't. I'm using the same variables, with the only exception of '{$UNIFI.API.URI}', where I set matching the site ID.

Regards.

dalezorz commented 1 week ago

@gonzalobellon Did you add your Unifi user account to all of the sites you are wanting to monitor via Zabbix?

gonzalobellon commented 1 week ago

@gonzalobellon Did you add your Unifi user account to all of the sites you are wanting to monitor via Zabbix?

Yes, same username and password for all sites.

gonzalobellon commented 1 week ago

@gonzalobellon Did you add your Unifi user account to all of the sites you are wanting to monitor via Zabbix?

Yes, same username and password for all sites.

I just noticed that I didn't create the user account in the other sites, I will try this and keep you posted. Thanks for pointing me in the right direction! Regards

gonzalobellon commented 1 week ago

@gonzalobellon Did you add your Unifi user account to all of the sites you are wanting to monitor via Zabbix?

Yes, same username and password for all sites.

I just noticed that I didn't create the user account in the other sites, I will try this and keep you posted. Thanks for pointing me in the right direction! Regards

Worked. Thank you!!

MassimilianoPasquini97 commented 1 week ago

Thank to all of you 🙏🏻. I have added a section on the README.md that explains how to configure multiple sites based on this issue information.