A telegraph plugin to gather information from an Icecast 2.4 or 2.5 server.
Download the binary from the latest release.
These instructions assume you have Go installed and configured on your machine
Clone the repository
git clone https://github.com/spacepille/icecast2-telegraf-plugin
cd icecast2-telegraf-pluginBuild the module into an executable
On Unix Linux/Mac:
go build -o icecast2-telegraf-plugin cmd/main.goOn Windows:
go build -o icecast2-telegraf-plugin.exe cmd/main.goReference the executable and config in your telegraf.conf using the execd input plugin
[[inputs.execd]]
command = ["/path/to/icecast2-telegraf-plugin(.exe)", "-config", "/path/to/icecast2-telegraf-config.conf"]More documentation on using Telegraf external plugins can be found here.
External plugins have their own configuration files. The path to the file is defined in the inputs.execd directive in telegraf.conf, as shown above.
[[inputs.icecast2]]
## Icecast2 Admin url
# url = "http://localhost:8000/admin/"
## Icecast2 Admin username
# username = "admin"
## Icecast2 Admin password
# password = "hackme"
## Maximum time to receive response
# response_timeout = "5s"
## Gather Listeners
# gather_listeners = true
## Path to MaxMind GeoLite2 or GeoIP2 city database
# geoip2_path = ""
## Maxmind include the country and city names in English, Simplified Chinese,
## Spanish, Brazilian Portuguese, Russian, Japanese, French, and German
# geoip2_language = "en"-
icecast_server- tags:
adminhostlocationserver_id
- fields:
clientslistenerssourcesstatsserver_startclient_connections- accumulatingfile_connections- accumulatinglistener_connections- accumulatingsource_client_connections- accumulatingsource_relay_connections- accumulatingsource_total_connections- accumulatingstats_connections- accumulating
- tags:
-
icecast_source- tags:
hostmountgenrelisten_urlserver_nameserver_descriptionserver_typeserver_urlsource_ip
- fields:
listenerslistener_peakslow_listenersstream_starttotal_bytes_read- accumulatingtotal_bytes_sent- accumulating
- tags:
-
icecast_listener- tags:
hostmountuser_agentcontinent_code- requires geoip2 dbcountry_code- requires geoip2 dbpostal_code- requires geoip2 dbcontinent_name- requires geoip2 db and geoip2 languagecountry_name- requires geoip2 db and geoip2 languagecity_name- requires geoip2 db and geoip2 language
- fields:
idipconnectedlatitude- requires geoip2 dblongitude- requires geoip2 db
- tags:
icecast_server,admin=icemaster@localhost,host=localhost,location=Earth,server_id=Icecast\ 2.5-beta.3\ xm-1.0 clients=92i,listeners=76i,stats=0i,client_connections=90593i,listener_connections=46646i,source_relay_connections=0i,sources=12i,file_connections=362i,source_client_connections=12i,source_total_connections=12i,stats_connections=0i 1735227248468115646
icecast_source,genre=Ambient\,\ Downbeat,host=localhost,listen_url=http://127.0.0.1:8000/ambient.aac,mount=ambient.aac,server_description=Music\ Radio,server_name=Ambient\ Station,server_type=audio/aacp,server_url=http://localhost,source_ip=127.0.0.1 total_bytes_read=530585047i,total_bytes_sent=4501043i,listeners=0i,listener_peak=1i,slow_listeners=0i 1735227248468169340
icecast_source,genre=Ambient\,\ Downbeat,host=localhost,listen_url=http://127.0.0.1:8000/ambient.ogg,mount=ambient.ogg,server_description=Music\ Radio,server_name=Ambient\ Station,server_type=audio/ogg,server_url=http://localhost,source_ip=127.0.0.1 total_bytes_read=1133264896i,total_bytes_sent=20652068461i,listeners=27i,listener_peak=30i,slow_listeners=40i 1735227248468391286
icecast_listener,city_name=Belgrade,continent_code=EU,continent_name=Europe,country_code=RS,country_name=Serbia,host=localhost,ip=188.120.1.1,mount=ambient.ogg,user_agent=GStreamer\ souphttpsrc\ 1.24.2\ libsoup/3.4.4 connected="7591",latitude=44.8046,longitude=20.4637 1735227248965060403
icecast_listener,city_name=San\ Luis\ Potosí\ City,continent_code=NA,continent_name=North\ America,country_code=MX,country_name=Mexico,host=localhost,ip=201.152.1.1,mount=ambient.ogg,postal_code=78250,user_agent=GStreamer\ souphttpsrc\ 1.16.2\ libsoup/2.70.0 longitude=-100.997,connected="7186",latitude=22.1615 1735227249000092134