OPNsense Forum

International Forums => Portuguese - Português => Topic started by: ludarkstar99 on January 13, 2024, 12:41:48 PM

Title: Template Zabbix
Post by: ludarkstar99 on January 13, 2024, 12:41:48 PM
TL;DR
Template Zabbix para monitoramento do OPNsense: https://github.com/sysadminbr/zabbix-templates.


Olá pessoal,

Passando para anunciar que construí um template zabbix para monitoramento de itens do OPNsense.

O template é baseado na API do OPNSense e não tem nenhuma dependência.

Long live to opensource 🌌

log
2024-11-01: link updated as github repo was migrated.
2024-03-10: repositório novo sem herdar código legado do rbicelli.
Title: Re: Template Zabbix
Post by: ludarkstar99 on February 15, 2024, 03:06:47 PM
2024-02-15: Template atualizado e implementado o monitoramento via API do OPNSense.
Title: Re: Template Zabbix
Post by: burghy on February 24, 2024, 11:50:27 AM
great job. monitoring ipsec?
Your approach doesn't seem bad to me

i test your template, for ipsec i have modify status because, 0 is disconnect and 1 is connect.

the tunnel phase 2 is corret data, but the tunnel status i have no data.



there is another user who is developing the template agent for zabbix.  you could join forces!

https://github.com/dblanque/opnsense-zabbix/tree/main
Title: Re: Template Zabbix
Post by: ludarkstar99 on March 10, 2024, 07:59:33 PM
Hi burghy, sorry for the delay.
I could not reproduce the problem, using ipsec instances or "old tunnel config".
In both configuration types i had the correct tunnel data (0 for tunnel connected), and 1 for disconnect.

Attach 1: data received for the item.
Attach 2: item data for fase2 disconnect.
Attach 3: after the tunnel gets offline the triggers screams.

Title: Re: Template Zabbix
Post by: ludarkstar99 on March 10, 2024, 08:05:07 PM
Regarding P1 not receiving any data, after i disconnect the tunnel that's expected behavior: P1 no data, P2 triggers a disconnection.
After reconnecting the tunnel, P1 starts receiving data again, and P2 shows connected (again).
Title: Re: Template Zabbix
Post by: burghy on March 14, 2024, 12:05:19 PM
i have create a issue on github. thanks you so much
Title: Re: Template Zabbix
Post by: juliocbc on March 15, 2024, 11:26:11 AM
Hey Guys! Nice to see that things are going well on this topic, but I want to ask you a favor: move this thread to the general forum (English). This session is dedicated to Portuguese language discussions.

Thanks!
Title: Re: Template Zabbix
Post by: burghy on July 23, 2024, 09:04:20 PM
citrait offline project
Title: Re: Template Zabbix
Post by: ludarkstar99 on November 01, 2024, 03:29:35 PM
EN
sorry about that. the github account was split from personal/business projects.
-----------------------------------------------------------------------------------------
PT
o repositório foi movido devido a divisão de projetos pessoais/da empresa.

https://github.com/sysadminbr/zabbix-templates
Title: Re: Template Zabbix
Post by: azasly on November 21, 2024, 02:20:02 PM
Quote from: ludarkstar99 on November 01, 2024, 03:29:35 PM
EN
sorry about that. the github account was split from personal/business projects.
https://github.com/sysadminbr/zabbix-templates
Thx, bro
you saved me)
Title: Re: Template Zabbix
Post by: azasly on November 21, 2024, 05:35:19 PM
There is one question though, how to connect opnsense, for zabbix proxy?
Title: Re: Template Zabbix
Post by: burghy on November 21, 2024, 05:49:34 PM
Quote from: azasly on November 21, 2024, 05:35:19 PM
There is one question though, how to connect opnsense, for zabbix proxy?
work without problem. i have zabbix proxy and agent installed on opn
Title: Re: Template Zabbix
Post by: azasly on November 22, 2024, 05:49:07 AM
Quote from: burghy on November 21, 2024, 05:49:34 PM
Quote from: azasly on November 21, 2024, 05:35:19 PM
There is one question though, how to connect opnsense, for zabbix proxy?
work without problem. i have zabbix proxy and agent installed on opn
I am seeing this error
Cannot evaluate function nodata(/opnsensehost/opnsense.gateways.status,3m): item does not have enough data after server start or item creation.
Title: Re: Template Zabbix
Post by: azasly on November 22, 2024, 06:36:21 AM
pls help :(
Title: Re: Template Zabbix
Post by: ludarkstar99 on November 29, 2024, 05:50:48 AM
Validated on zabbix 7.0.
the setup is straightforward.

1. import the template in zabbix.
2. create a new user in OPNsense named after zabbix-monitoring.
3. set the user above to have the read privileges on all *status pages and firmware pages.
4. create a api key for this user.
5. in the host, associate the template and fill the MACROS with the api key and secret. do not forget to set the url too (without leading "/")
6. make sure there is an "agent interface" with valid address in the host (on zabbix of course) for the opnsense host.
7. that's it.

video on youtube (pt-br): https://youtu.be/errEM7atMlw
https://github.com/sysadminbr/zabbix-templates