Skip to content

Commit

Permalink
remove sensitive info and update readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Silvio Fragata da Silva committed Mar 8, 2024
1 parent 65e071c commit 2b74edd
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 65 deletions.
65 changes: 42 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# plex_exporter
[Plex](https://www.plex.tv) prometheus exporter
# adguardhome_exporter
[Adguard home](https://github.com/AdguardTeam/AdGuardHome) prometheus exporter

![Golang CI](https://github.com/sfragata/plex_exporter/workflows/Golang%20CI/badge.svg)
![Golang CI](https://github.com/sfragata/adguardhome_exporter/workflows/Golang%20CI/badge.svg)

## Installation

Expand All @@ -10,38 +10,57 @@
```
brew tap sfragata/tap
brew install sfragata/tap/plex_exporter
brew install sfragata/tap/adguardhome_exporter
```

### Linux and Windows

get latest release [here](https://github.com/sfragata/plex_exporter/releases)
get latest release [here](https://github.com/sfragata/adguardhome_exporter/releases)

## Usage

```
plex_exporter - Prometheus exporter for plex
adguardhome_exporter - Prometheus exporter for Adguard home
Flags:
Flags:
--version Displays the program version string.
-h --help Displays help with available flag, subcommand, and positional value parameters.
-H --host Plex address (default: 127.0.0.1)
-p --port Plex port (default: 32400)
-t --token Plex token (if PLEX_TOKEN env variable is set, it will be used)
-l --listen-address Plex exporter metrics port (default: 2112)
-H --host Adguard home address (default: 127.0.0.1)
-p --port Adguard home port (default: 80)
-t --token Adguard home token (if ADGUARD_HOME_TOKEN env variable is set, don't need to pass it)
-l --listen-address Adguard home exporter metrics port (default: 9311)
```
## Output
```
# HELP plex_active_sessions_count show number active sessions
# TYPE plex_active_sessions_count gauge
plex_active_sessions_count 2
# HELP plex_active_sessions_count_user_device show number active sessions by user and device
# TYPE plex_active_sessions_count_user_device gauge
plex_active_sessions_count_user_device{device="OSX",user="xxx"} 1
plex_active_sessions_count_user_device{device="iPhone",user="yyy"} 1
# HELP plex_library_count show number medias
# TYPE plex_library_count gauge
plex_library_count{name="Rock",type="artist"} 6
plex_library_count{name="Movies",type="movie"} 97
plex_library_count{name="Series",type="show"} 2
# HELP adguard_dns_query_types show dns query types
# TYPE adguard_dns_query_types gauge
adguard_dns_query_types{type="A"} 3182
adguard_dns_query_types{type="AAAA"} 356
adguard_dns_query_types{type="CNAME"} 2533
# HELP adguard_exporter_build_info A metric with a constant '1' value labeled by adguard version and adguardhome_exporter version from which adguard/adguard_exporter was built.
# TYPE adguard_exporter_build_info gauge
adguard_exporter_build_info{adguard_exporter_version="v1.0.0",adguard_version="v0.107.45",protection_enabled="1",running="1"} 1
# HELP adguard_filtering_status show adguard filters
# TYPE adguard_filtering_status gauge
adguard_filtering_status{enable="1",last_update="2024-03-07T21:01:58-05:00",name="AdAway Default Blocklist",url="https://adguardteam.github.io/HostlistsRegistry/assets/filter_2.txt"} 6540
adguard_filtering_status{enable="1",last_update="2024-03-07T21:01:58-05:00",name="AdGuard DNS filter",url="https://adguardteam.github.io/HostlistsRegistry/assets/filter_1.txt"} 62819
# HELP adguard_stats show adguard stats
# TYPE adguard_stats gauge
adguard_stats{name="avg_processing_time"} 0.023511
adguard_stats{name="num_blocked_filtering"} 16765
adguard_stats{name="num_dns_queries"} 340190
adguard_stats{name="num_replaced_parental"} 0
adguard_stats{name="num_replaced_safebrowsing"} 0
adguard_stats{name="num_replaced_safesearch"} 25312
# HELP adguard_top_blocked_domains show adguard top blocked domains
# TYPE adguard_top_blocked_domains gauge
adguard_top_blocked_domains{domain="4421.api.swrve.com"} 38
adguard_top_blocked_domains{domain="youtubei.googleapis.com"} 333
# HELP adguard_top_clients show adguard top clients
# TYPE adguard_top_clients gauge
adguard_top_clients{hostname="192.168.2.10"} 340190
# HELP adguard_top_queried_domains show adguard top queried domains
# TYPE adguard_top_queried_domains gauge
adguard_top_queried_domains{domain="10.195.225.13.in-addr.arpa"} 2296
adguard_top_queried_domains{domain="111.195.225.13.in-addr.arpa"} 2296
```
7 changes: 4 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"log"
"net/http"
"os"
"runtime"
"time"

Expand Down Expand Up @@ -36,14 +37,14 @@ func main() {
flaggy.SetDescription("Prometheus exporter for Adguard home")
flaggy.SetVersion(info)

var adguardHost = "192.168.1.44"
var adguardHost = "127.0.0.1"
flaggy.String(&adguardHost, "H", "host", "Adguard home address")

var adguardPort = 80
flaggy.Int(&adguardPort, "p", "port", "Adguard home port")

var adguardToken = "c2ZyYWdhdGE6QTF6WjkvNVojP05iMCo2cGQyaw==" //os.Getenv("ADGUARD_HOME_TOKEN") // username:password in base64
flaggy.String(&adguardToken, "t", "token", "Adguard home token (if ADGUARD_HOME_TOKEN env variable is set, it will be used)")
var adguardToken = os.Getenv("ADGUARD_HOME_TOKEN") // username:password in base64
flaggy.String(&adguardToken, "t", "token", "Adguard home token (if ADGUARD_HOME_TOKEN env variable is set, don't need to pass it)")

var metricsPort = "9311"
flaggy.String(&metricsPort, "l", "listen-address", "Adguard home exporter metrics port")
Expand Down
39 changes: 0 additions & 39 deletions temp.txt

This file was deleted.

0 comments on commit 2b74edd

Please sign in to comment.