Skip to content

nlamirault/kodi_exporter

Repository files navigation

kodi_exporter

License Apache 2 GitHub version

Master :

  • Circle CI

Develop :

  • Circle CI

Installation

You can download the binaries :

Usage

First, test your Kodi API using bash:

$ curl -X POST -H "Content-Type: application/json" \
        -d '{"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"add you title here","message":"add your message here"},"id":1}'  http://192.168.1.10:8080/jsonrpc
{"id":1,"jsonrpc":"2.0","result":"OK"}

Then Launch the Prometheus exporter :

$ kodi_exporter -log.level=debug -kodi.server 192.168.1.10 -kodi.port 8080

Debug

You could try your Kodi API :

  • Artists:

      $ curl': curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"AudioLibrary.GetArtists","params":{},"id":1}'  http://10.10.10.10:8080/jsonrpc
    
  • Albums:

      $ curl': curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"AudioLibrary.GetAlbums","params":{},"id":1}'  http://10.10.10.10:8080/jsonrpc
    
  • Songs:

      $ curl': curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"AudioLibrary.GetSongs","params":{},"id":1}'  http://10.10.10.10:8080/jsonrpc
    

Development

  • Initialize environment

      $ make init
    
  • Build tool :

      $ make build
    
  • Launch unit tests :

      $ make test
    

Local Deployment

  • Launch Prometheus using the configuration file in this repository:

      $ prometheus -config.file=prometheus.yml
    
  • Launch exporter:

      $ kodi_exporter -log.level=debug -kodi.server 192.168.1.10 -kodi.port 8080
    
  • Check that Prometheus find the exporter on http://localhost:9090/targets

Contributing

See CONTRIBUTING.

License

See LICENSE for the complete license.

Changelog

A changelog is available

Contact

Nicolas Lamirault nicolas.lamirault@gmail.com