Created
May 20, 2021 07:55
-
-
Save yegle/5aa8fbb1bd1ad868ba654d91a96ceb83 to your computer and use it in GitHub Desktop.
Blackbox Exporter scraping Transmission BitTorrent Server RPC Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Caveat: | |
# 1. query_response support regex capture group, but you have to write expect/send in the same YAML item. | |
# 2. When send the "send" line, Blackbox Exporter will automatically add a \n. | |
transmission_rpc: | |
prober: tcp | |
timeout: 30s | |
tcp: | |
query_response: | |
- send: "GET /transmission/rpc/ HTTP/1.1\r\nAuthorization: Basic YOUR_BASIC_AUTH_HEADER\r\n\r" | |
- expect: "X-Transmission-Session-Id: ([A-Za-z0-9]+)$" | |
send: "POST /transmission/rpc HTTP/1.1\r\nX-Transmission-Session-Id: ${1}\r\nAuthorization: Basic YOUR_BASIC_AUTH_HEADER\r\nContent-Length: 55\r\nContent-Type: application/x-www-form-urlencoded\r\n\r\n{\"method\":\"torrent-get\",\"arguments\":{\"fields\":[\"id\"]}}" | |
- expect: '.*"result":"success".*' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment