Accessing prometheus metrics for opnsense plugin
I am running OPNsense 25.7.6-amd64 on FreeBSD 14.3-RELEASE-p4 with OpenSSL 3.0.18 and have installed the os-crowdsec 1.0.12 plug in. I have registered the security engine and enabled acquisition of caddy logs and certain selected loki logs. Notifications for telegram have been configured and tested.
I have amended
/usr/local/etc/crowdsec/config.yaml as follows and restarted the crowdsec service:
When I access my opnsense router at either http://192.168.1.1:6060/metrics or https://192.168.1.1:6060/metrics I receive a timeout error.
What should the address be to expose crowdsec metrics for prometheus with the os-crowdsec plugin?6 Replies
Important Information
Thank you for getting in touch with your support request. To expedite a swift resolution, could you kindly provide the following information? Rest assured, we will respond promptly, and we greatly appreciate your patience. While you wait, please check the links below to see if this issue has been previously addressed. If you have managed to resolve it, please use run the command
/resolve or press the green resolve button below.Log Files
If you possess any log files that you believe could be beneficial, please include them at this time. By default, CrowdSec logs to /var/log/, where you will discover a corresponding log file for each component.
Guide Followed (CrowdSec Official)
If you have diligently followed one of our guides and hit a roadblock, please share the guide with us. This will help us assess if any adjustments are necessary to assist you further.
Screenshots
Please forward any screenshots depicting errors you encounter. Your visuals will provide us with a clear view of the issues you are facing.
© Created By WhyAydan for CrowdSec ❤️
I searched on the discourse forums and in the discord. I reviewed the log files for any references. I followed the opnsense guide at https://docs.crowdsec.net/docs/getting_started/install_crowdsec_opnsense/.
OPNsense | CrowdSec
The CrowdSec plugin for OPNsense is installed from the official repositories.
@Instant Dreams you made sure to allow the port on your opnsense firewall to internal traffic?
That's an interesting idea. 192.168.1.1 should be on the LAN, but I'll add a floating rule for port 6060 and see what happens
Added a floating rule and applied it, waited, then tried again. Connection still timed out.
I had previously done a sudo service crowdsec reload so this time I also did a service restart from the GUI and metrics are now being served on http://192.168.1.1:6060/metrics
I am going to remove the floating rule and restart the service to confirm if it was the rule, the gui restart, or both
Testing:
1. Removed the floating rule and applied change to firewall - metrics served
2. Restarted crowdsec service via gui - metrics served
I'll write this up on the forum
This is resolved now