ugoviti / zabbix-templates

Misc self made Zabbix templates
48 stars 42 forks source link

Cannot tell sites with same name but different ports apart #9

Closed Taomyn closed 2 years ago

Taomyn commented 3 years ago

I have two web services running on the same server i.e. same FQDN, but on different ports. Although the polling is separating them, the discovery does not for item/trigger names and the names shown in the graphs:

image image

Names have been obfuscated but they are the same.

This probably also affects the latency data, but I have disabled that part of the template as I am only interested in the SSL certificate dates.

ugoviti commented 3 years ago

Hi,

I'm aware of this behavior.

a solution was to use the {#URL} macro instead the {#HOST} macro for the item name, but that make longer items name.

for example when monitoring urls like:

https://www.amazon.it/gp/bestsellers/?ref_=nav_em_cs_bestsellers_0_1_1_2

the items name become very long:

https://www.amazon.it/gp/bestsellers/?ref_=nav_em_cs_bestsellers_0_1_1_2 SSL certificate expiration date

instead of:

www.amazon.it SSL certificate expiration date

anyway I'm evaluating this change.. do you have many hosts to monitor with different ports and same hostname?

Kind regards

ugoviti commented 3 years ago

Hi,

just pushed b9487e0be834057e46163b8ff8dc18a791d1fbef

can you update your url-monitor.sh script and import the new template in your zabbix server?

Let's me know if it's the expected result.

Thankyou

Best Regards

ugoviti commented 3 years ago

forgot to rename triggers prototypes, please update your template using always the latest commit

Taomyn commented 3 years ago

Hi, I gave it a go but now I get when I run a discovery:

image

I also made the same changes to the template disabling all the latency items, but perhaps I made a mistake so I also attach an export of my copy for you to look at.

zbx_export_templates.yaml.txt

ugoviti commented 3 years ago

Strange, have you imported the new template version selecting all "Delete missing" check boxes?

can you try to:

Thank you

Taomyn commented 3 years ago

That's exactly what I did because I had customised the previous one, I removed it from all those places then imported the new one and made the same changes again to disable all the performance/latency checks.

ugoviti commented 3 years ago

Hi,

I can't recreate your problem... Just installed the url-monitor template in a new Zabbix 5.4.2 Server deploy and monitored 26 URLs:

$ cat /etc/zabbix/url-monitor.csv  | wc -l
26

And the discovery doesn't report issues...

do you have a new server installation to test url-monitor template from scratch?

Thank you

Taomyn commented 3 years ago

No I don't have another server at the moment, but did you try the template export of my version to see what happens?

ugoviti commented 3 years ago

Ok, I discovered your problem when importing your template version:

image

You should no delete or change anything from the original template, for example if you want change the {$URL_PATH_CSV} macro, you don't must change the template, ma only modify the macro inside your host configuration:

image

so you don't must delete items and triggers, but only disable after the discovery.

Kind Regards

Taomyn commented 3 years ago

Correcting the default value for the path to the CSV makes no difference, plus it worked before, and I have not deleted any items or triggers, if you actually look they are just disabled.

I always make the change at the template so that multiple uses are all changed at once otherwise maintenance/fixes are a nightmare.

ugoviti commented 2 years ago

closing... not any more a problem? reopen in case