[Plugin] Prometheus unRAID Plugins


Recommended Posts

4 hours ago, ich777 said:

This is all that you've got from the exporter or is this just a part?

It was just for example. The following is what I get from the exporter. Seems that these are the standard metrics from prometheus, right?:

# HELP go_gc_duration_seconds A summary of the pause duration of garbage collection cycles.
# TYPE go_gc_duration_seconds summary
go_gc_duration_seconds{quantile="0"} 2.692e-05
go_gc_duration_seconds{quantile="0.25"} 2.9898e-05
go_gc_duration_seconds{quantile="0.5"} 8.6085e-05
go_gc_duration_seconds{quantile="0.75"} 9.2229e-05
go_gc_duration_seconds{quantile="1"} 0.000146322
go_gc_duration_seconds_sum 0.000465349
go_gc_duration_seconds_count 6
# HELP go_goroutines Number of goroutines that currently exist.
# TYPE go_goroutines gauge
go_goroutines 13
# HELP go_info Information about the Go environment.
# TYPE go_info gauge
go_info{version="go1.16.3"} 1
# HELP go_memstats_alloc_bytes Number of bytes allocated and still in use.
# TYPE go_memstats_alloc_bytes gauge
go_memstats_alloc_bytes 4.585536e+06
# HELP go_memstats_alloc_bytes_total Total number of bytes allocated, even if freed.
# TYPE go_memstats_alloc_bytes_total counter
go_memstats_alloc_bytes_total 1.7187472e+07
# HELP go_memstats_buck_hash_sys_bytes Number of bytes used by the profiling bucket hash table.
# TYPE go_memstats_buck_hash_sys_bytes gauge
go_memstats_buck_hash_sys_bytes 1.44732e+06
# HELP go_memstats_frees_total Total number of frees.
# TYPE go_memstats_frees_total counter
go_memstats_frees_total 30808
# HELP go_memstats_gc_cpu_fraction The fraction of this program's available CPU time used by the GC since the program started.
# TYPE go_memstats_gc_cpu_fraction gauge
go_memstats_gc_cpu_fraction 9.487412532269557e-06
# HELP go_memstats_gc_sys_bytes Number of bytes used for garbage collection system metadata.
# TYPE go_memstats_gc_sys_bytes gauge
go_memstats_gc_sys_bytes 4.95464e+06
# HELP go_memstats_heap_alloc_bytes Number of heap bytes allocated and still in use.
# TYPE go_memstats_heap_alloc_bytes gauge
go_memstats_heap_alloc_bytes 4.585536e+06
# HELP go_memstats_heap_idle_bytes Number of heap bytes waiting to be used.
# TYPE go_memstats_heap_idle_bytes gauge
go_memstats_heap_idle_bytes 6.0817408e+07
# HELP go_memstats_heap_inuse_bytes Number of heap bytes that are in use.
# TYPE go_memstats_heap_inuse_bytes gauge
go_memstats_heap_inuse_bytes 5.7344e+06
# HELP go_memstats_heap_objects Number of allocated objects.
# TYPE go_memstats_heap_objects gauge
go_memstats_heap_objects 6209
# HELP go_memstats_heap_released_bytes Number of heap bytes released to OS.
# TYPE go_memstats_heap_released_bytes gauge
go_memstats_heap_released_bytes 5.812224e+07
# HELP go_memstats_heap_sys_bytes Number of heap bytes obtained from system.
# TYPE go_memstats_heap_sys_bytes gauge
go_memstats_heap_sys_bytes 6.6551808e+07
# HELP go_memstats_last_gc_time_seconds Number of seconds since 1970 of last garbage collection.
# TYPE go_memstats_last_gc_time_seconds gauge
go_memstats_last_gc_time_seconds 1.6481599131176507e+09
# HELP go_memstats_lookups_total Total number of pointer lookups.
# TYPE go_memstats_lookups_total counter
go_memstats_lookups_total 0
# HELP go_memstats_mallocs_total Total number of mallocs.
# TYPE go_memstats_mallocs_total counter
go_memstats_mallocs_total 37017
# HELP go_memstats_mcache_inuse_bytes Number of bytes in use by mcache structures.
# TYPE go_memstats_mcache_inuse_bytes gauge
go_memstats_mcache_inuse_bytes 4800
# HELP go_memstats_mcache_sys_bytes Number of bytes used for mcache structures obtained from system.
# TYPE go_memstats_mcache_sys_bytes gauge
go_memstats_mcache_sys_bytes 16384
# HELP go_memstats_mspan_inuse_bytes Number of bytes in use by mspan structures.
# TYPE go_memstats_mspan_inuse_bytes gauge
go_memstats_mspan_inuse_bytes 71536
# HELP go_memstats_mspan_sys_bytes Number of bytes used for mspan structures obtained from system.
# TYPE go_memstats_mspan_sys_bytes gauge
go_memstats_mspan_sys_bytes 81920
# HELP go_memstats_next_gc_bytes Number of heap bytes when next garbage collection will take place.
# TYPE go_memstats_next_gc_bytes gauge
go_memstats_next_gc_bytes 7.681904e+06
# HELP go_memstats_other_sys_bytes Number of bytes used for other system allocations.
# TYPE go_memstats_other_sys_bytes gauge
go_memstats_other_sys_bytes 922720
# HELP go_memstats_stack_inuse_bytes Number of bytes in use by the stack allocator.
# TYPE go_memstats_stack_inuse_bytes gauge
go_memstats_stack_inuse_bytes 557056
# HELP go_memstats_stack_sys_bytes Number of bytes obtained from system for stack allocator.
# TYPE go_memstats_stack_sys_bytes gauge
go_memstats_stack_sys_bytes 557056
# HELP go_memstats_sys_bytes Number of bytes obtained from system.
# TYPE go_memstats_sys_bytes gauge
go_memstats_sys_bytes 7.4531848e+07
# HELP go_threads Number of OS threads created.
# TYPE go_threads gauge
go_threads 11
# HELP process_cpu_seconds_total Total user and system CPU time spent in seconds.
# TYPE process_cpu_seconds_total counter
process_cpu_seconds_total 0.24
# HELP process_max_fds Maximum number of open file descriptors.
# TYPE process_max_fds gauge
process_max_fds 40960
# HELP process_open_fds Number of open file descriptors.
# TYPE process_open_fds gauge
process_open_fds 10
# HELP process_resident_memory_bytes Resident memory size in bytes.
# TYPE process_resident_memory_bytes gauge
process_resident_memory_bytes 2.1041152e+07
# HELP process_start_time_seconds Start time of the process since unix epoch in seconds.
# TYPE process_start_time_seconds gauge
process_start_time_seconds 1.64815964972e+09
# HELP process_virtual_memory_bytes Virtual memory size in bytes.
# TYPE process_virtual_memory_bytes gauge
process_virtual_memory_bytes 1.356128256e+09
# HELP process_virtual_memory_max_bytes Maximum amount of virtual memory available in bytes.
# TYPE process_virtual_memory_max_bytes gauge
process_virtual_memory_max_bytes 1.8446744073709552e+19
# HELP promhttp_metric_handler_requests_in_flight Current number of scrapes being served.
# TYPE promhttp_metric_handler_requests_in_flight gauge
promhttp_metric_handler_requests_in_flight 1
# HELP promhttp_metric_handler_requests_total Total number of scrapes by HTTP status code.
# TYPE promhttp_metric_handler_requests_total counter
promhttp_metric_handler_requests_total{code="200"} 32
promhttp_metric_handler_requests_total{code="500"} 0
promhttp_metric_handler_requests_total{code="503"} 0

 

4 hours ago, ich777 said:

Have you waited a bit or is this right after you've connected to PiHole?

Now I've waited ca. 20 min. How long does it take before the metrics show up normally?

 

4 hours ago, ich777 said:

Are you sure that the API Key is right?

Yes, I doubled checked it again right now. I took it from the pihole Settings > API/Web Interface > Show API Token and copied the RAW API Token into the pihole exporter configuration.

 

4 hours ago, ich777 said:

Why? This won't work...

I wanted just to be on the safe side :)

Link to comment
5 hours ago, ich777 said:

It may be possible that you have to disable and enable Docker one time to actually activate it once more.

Additionally, I disabled and enabled the docker in the settings. I restarted pihole, pihole exporter and prometheus as well. But unfortunately without changes.

Link to comment

The March 29 version, prometheus_wireguard_exporter-2022.03.29.tgz,  is broken, in that the tgz file that gets downloaded is only a few KB and is missing the plugin itself.  It only contains a single image file.

 

The previous version works without any issue for me.

Link to comment
45 minutes ago, loftyDan said:

The March 29 version, prometheus_wireguard_exporter-2022.03.29.tgz,  is broken, in that the tgz file that gets downloaded is only a few KB and is missing the plugin itself.  It only contains a single image file.

 

The previous version works without any issue for me.

Thank you for the report, should now be fixed, please update the plugin.

Link to comment
  • 3 weeks later...

I'm running the adguard-exporter, but it keeps stopping. I've verified that it is able to start, and it is able to pull data from AdGuard, but after about 10 seconds, it stops. I can restart it, but it never stays running.

AdGuard is running in Docker, but I have it set up in a VLAN with an IP separate from my Unraid host. I've confirmed this issue occurs both when running in a host network, and when running in a custom network under a VLAN. Are there any logs I can find to diagnose why it might be stopping?

Link to comment
2 minutes ago, ApatheticRiku said:

Are there any logs I can find to diagnose why it might be stopping?

No, but you can try to run it from a terminal from Unraid:

HOSTNAME="$(cat /boot/config/plugins/prometheus_adguard_exporter/settings.cfg | grep "adguard_hostname=" | cut -d '=' -f2-)"
USERNAME="$(cat /boot/config/plugins/prometheus_adguard_exporter/settings.cfg | grep "adguard_username=" | cut -d '=' -f2-)"
PASSWORD="$(cat /boot/config/plugins/prometheus_adguard_exporter/settings.cfg | grep "adguard_password=" | cut -d '=' -f2-)"
PROTO="$(cat /boot/config/plugins/prometheus_adguard_exporter/settings.cfg | grep "adguard_protocol=" | cut -d '=' -f2-)"
PORT="$(cat /boot/config/plugins/prometheus_adguard_exporter/settings.cfg | grep "adguard_port=" | cut -d '=' -f2-)"
EXP_PORT="$(cat /boot/config/plugins/prometheus_adguard_exporter/settings.cfg | grep "exporter_port=" | cut -d '=' -f2-)"
INTERV="$(cat /boot/config/plugins/prometheus_adguard_exporter/settings.cfg | grep "exporter_interval=" | cut -d '=' -f2-)"

prometheus_adguard_exporter -adguard_hostname ${HOSTNAME} -adguard_port ${PORT} -adguard_protocol ${PROTO} -adguard_username ${USERNAME} -adguard_password ${PASSWORD} -server_port ${EXP_PORT} -interval ${INERV}s

 

Simply copy and paste this and it should start and you should get an error message if something went wrong, make sure that you've stop the exporter on the plugin page first.

Link to comment
Just now, simo241 said:

I was trying to install prometheus by when i am trying to start the docker container is not starting , i correctly configured the yaml file in etc folder 

Please head over to the support thread from the Prometheus container and post there, also include the logs, I‘ve only written the tutorial so that everyone has a starting point.

Link to comment
On 4/19/2022 at 12:09 PM, ich777 said:

No, but you can try to run it from a terminal from Unraid:

HOSTNAME="$(cat /boot/config/plugins/prometheus_adguard_exporter/settings.cfg | grep "adguard_hostname=" | cut -d '=' -f2-)"
USERNAME="$(cat /boot/config/plugins/prometheus_adguard_exporter/settings.cfg | grep "adguard_username=" | cut -d '=' -f2-)"
PASSWORD="$(cat /boot/config/plugins/prometheus_adguard_exporter/settings.cfg | grep "adguard_password=" | cut -d '=' -f2-)"
PROTO="$(cat /boot/config/plugins/prometheus_adguard_exporter/settings.cfg | grep "adguard_protocol=" | cut -d '=' -f2-)"
PORT="$(cat /boot/config/plugins/prometheus_adguard_exporter/settings.cfg | grep "adguard_port=" | cut -d '=' -f2-)"
EXP_PORT="$(cat /boot/config/plugins/prometheus_adguard_exporter/settings.cfg | grep "exporter_port=" | cut -d '=' -f2-)"
INTERV="$(cat /boot/config/plugins/prometheus_adguard_exporter/settings.cfg | grep "exporter_interval=" | cut -d '=' -f2-)"

prometheus_adguard_exporter -adguard_hostname ${HOSTNAME} -adguard_port ${PORT} -adguard_protocol ${PROTO} -adguard_username ${USERNAME} -adguard_password ${PASSWORD} -server_port ${EXP_PORT} -interval ${INERV}s

 

Simply copy and paste this and it should start and you should get an error message if something went wrong, make sure that you've stop the exporter on the plugin page first.

@ich777 I ran the supplied command in the Unraid console and the HTTP server started up and ran for over 3 minutes with no errors. I also was able to get metrics in Grafana for the first time while letting it run. I stopped the process and went back to the UI and clicked Start, but the same issue I always have happened again. It came up saying "Running", but went back to "Stopped" after about 5 seconds. So running through console works flawlessly, but not through UI.
I'll also point out, your command you sent had one typo in it. At the end, you refer to a variable named ${INERV} instead of ${INTERV}.

Here's the output of the command before I stopped it:

prometheus_adguard_exporter -adguard_hostname ${HOSTNAME} -adguard_port ${PORT} -adguard_protocol ${PROTO} -adguard_username ${USERNAME} -adguard_password ${PASSWORD} -server_port ${EXP_PORT} -interval ${INTERV}s
2022/04/30 17:52:54 ---------------------------------------
2022/04/30 17:52:54 - AdGuard Home exporter configuration -
2022/04/30 17:52:54 ---------------------------------------
2022/04/30 17:52:54 AdguardProtocol : http
2022/04/30 17:52:54 AdguardHostname : 192.168.10.250
2022/04/30 17:52:54 AdguardUsername : tony
2022/04/30 17:52:54 AdGuard Authentication Method : AdguardPassword
2022/04/30 17:52:54 AdguardPort : 3000
2022/04/30 17:52:54 ServerPort : 9617
2022/04/30 17:52:54 Interval : 10s
2022/04/30 17:52:54 LogLimit : 1000
2022/04/30 17:52:54 ---------------------------------------
2022/04/30 17:52:54 New Prometheus metric registered: avg_processing_time
2022/04/30 17:52:54 New Prometheus metric registered: num_dns_queries
2022/04/30 17:52:54 New Prometheus metric registered: num_blocked_filtering
2022/04/30 17:52:54 New Prometheus metric registered: num_replaced_parental
2022/04/30 17:52:54 New Prometheus metric registered: num_replaced_safebrowsing
2022/04/30 17:52:54 New Prometheus metric registered: num_replaced_safesearch
2022/04/30 17:52:54 New Prometheus metric registered: top_queried_domains
2022/04/30 17:52:54 New Prometheus metric registered: top_blocked_domains
2022/04/30 17:52:54 New Prometheus metric registered: top_clients
2022/04/30 17:52:54 New Prometheus metric registered: query_types
2022/04/30 17:52:54 New Prometheus metric registered: running
2022/04/30 17:52:54 New Prometheus metric registered: protection_enabled
2022/04/30 17:52:54 Starting HTTP server
2022/04/30 17:53:04 New tick of statistics: 2329 ads blocked / 46397 total DNS queries
2022/04/30 17:53:14 New tick of statistics: 2330 ads blocked / 46404 total DNS queries
2022/04/30 17:53:24 New tick of statistics: 2332 ads blocked / 46411 total DNS queries
2022/04/30 17:53:34 New tick of statistics: 2332 ads blocked / 46412 total DNS queries
2022/04/30 17:53:44 New tick of statistics: 2332 ads blocked / 46419 total DNS queries
2022/04/30 17:53:54 New tick of statistics: 2333 ads blocked / 46424 total DNS queries

 

Edited by ApatheticRiku
Link to comment

I think I just figured out the AdGuard issue by myself. I dove through docker logs and saw an error on the AdGuard-Home container mentioning invalid Basic Authorization value. So I reset my AdGuard password to a new one that did not contain any special characters, and updated the exporter plugin. Using the UI, it started up and stayed running. Grafana now shows all of the content I would expect as well.

I'm not sure what the difference would be between the UI and the console command, but somewhere along the line, the UI is not parsing the password value correctly and is failing authentication if it contains special characters.

Thank you @ich777 for making a great plugin, but I think this warrants looking into in the codebase as special characters are supported by AdGuard and are a generally recommended part of a secure password.

  • Like 1
Link to comment
5 hours ago, ApatheticRiku said:

So I reset my AdGuard password to a new one that did not contain any special characters, and updated the exporter plugin. Using the UI, it started up and stayed running. Grafana now shows all of the content I would expect as well.

Some special characters are not supportet that's true but that's also true for some sites where you can't just simply use for example : $, \,...

 

7 hours ago, ApatheticRiku said:

I'll also point out, your command you sent had one typo in it. At the end, you refer to a variable named ${INERV} instead of ${INTERV}.

Sorry about that I've worte that when I was on the go...

 

5 hours ago, ApatheticRiku said:

but I think this warrants looking into in the codebase as special characters are supported by AdGuard and are a generally recommended part of a secure password.

I really hope you don't exposed the WebGUI from AdGuard to the web? If so why?

It's common to use strong passwords for services that you can reach from the Internet but for services on your local network it won't be that big of a deal except you have hackers in your local network but then I think a password would be your lowest priority problem... :D

Link to comment
11 hours ago, ich777 said:

I really hope you don't exposed the WebGUI from AdGuard to the web? If so why?

It's common to use strong passwords for services that you can reach from the Internet but for services on your local network it won't be that big of a deal except you have hackers in your local network but then I think a password would be your lowest priority problem... :D

No, AdGuard is not exposed to the web. It's just a generally accepted best practice to have unique secure passwords for everything. I use a password manager to generate my passwords, so I enforce the same strict requirements no matter where I am creating accounts. What I was getting at was that AdGuard clearly supports all of the special characters that were in my previous password, as is evident by the fact that I had no issue authenticating normally. I would just recommend looking into the plugin to see if you are doing anything that might be mishandling the characters that AdGuard supports as valid.

Again, I really like the plugin, and everything it manages to do, just some feedback.

  • Like 1
Link to comment
Yes, but only via the command line or better speaking by editing a file.
Do you experience any issues with how it works now?
Yes I cannot reach my Fritzbox. It has a 10.x.x.x IP and is not reachable via "fritz.box" in that Network. I guess that is the problem.

Gesendet von meinem SM-N986B mit Tapatalk

Link to comment
6 minutes ago, shiz said:

Yes I cannot reach my Fritzbox. It has a 10.x.x.x IP and is not reachable via "fritz.box" in that Network. I guess that is the problem.

Open up the file /boot/config/plugins/prometheus_firtzbox_exporter/settings.cfg and edit the line where it says "fritz_additional=" so that it looks like:

fritz_additional=-gateway-url http://YOURIP:49000 -gateway-luaurl http://YOURIP

 

Of course insert the IP of your Fritzbox where it says YOURIP and stop the exporter first before doing this.

  • Like 1
Link to comment

In tpoint # 3 of prometheus Adguard  exporter i indicated to:

 

"Enter your IP from AdGuard and also your API Token and click on "Confirm & Start":

 

I am not able to find this api token , this instruction is similar to pi-hole where the api token is very simple to find.

Is all configured as instruction i miss only this apy token, so when i start the ad guard exporter is stopping after few second because i need to insert the right api token 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.