mirror of https://github.com/lumapu/ahoy.git
				
				
			
				 8 changed files with 227 additions and 4 deletions
			
			
		@ -0,0 +1,38 @@ | 
				
			|||||
 | 
					version: '3.3' | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					services: | 
				
			||||
 | 
					  prometheus: | 
				
			||||
 | 
					    container_name: prometheus | 
				
			||||
 | 
					    image: prom/prometheus | 
				
			||||
 | 
					    volumes: | 
				
			||||
 | 
					      - ./prometheus:/etc/prometheus | 
				
			||||
 | 
					    networks: | 
				
			||||
 | 
					      hoymiles_net: | 
				
			||||
 | 
					        ipv4_address: 172.18.0.3 | 
				
			||||
 | 
					    ports: | 
				
			||||
 | 
					      - 9090:9090 | 
				
			||||
 | 
					    restart: always  | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					  grafana: | 
				
			||||
 | 
					    container_name: grafana | 
				
			||||
 | 
					    image: grafana/grafana | 
				
			||||
 | 
					    ports: | 
				
			||||
 | 
					      - 3000:3000 | 
				
			||||
 | 
					    restart: always  | 
				
			||||
 | 
					    volumes: | 
				
			||||
 | 
					      - grafana-storage:/var/lib/grafana | 
				
			||||
 | 
					    networks: | 
				
			||||
 | 
					      hoymiles_net: | 
				
			||||
 | 
					        ipv4_address: 172.18.0.2 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					volumes: | 
				
			||||
 | 
					  data: | 
				
			||||
 | 
					  grafana-storage: | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					networks: | 
				
			||||
 | 
					  hoymiles_net: | 
				
			||||
 | 
					    ipam: | 
				
			||||
 | 
					      driver: default | 
				
			||||
 | 
					      config: | 
				
			||||
 | 
					        - subnet: "172.18.0.0/24" | 
				
			||||
 | 
					
 | 
				
			||||
@ -0,0 +1,30 @@ | 
				
			|||||
 | 
					global: | 
				
			||||
 | 
					  scrape_interval: 15s | 
				
			||||
 | 
					  scrape_timeout: 10s | 
				
			||||
 | 
					  evaluation_interval: 15s | 
				
			||||
 | 
					alerting: | 
				
			||||
 | 
					  alertmanagers: | 
				
			||||
 | 
					    - static_configs: | 
				
			||||
 | 
					        - targets: [] | 
				
			||||
 | 
					      scheme: http | 
				
			||||
 | 
					      timeout: 10s | 
				
			||||
 | 
					      api_version: v1 | 
				
			||||
 | 
					scrape_configs: | 
				
			||||
 | 
					  - job_name: prometheus | 
				
			||||
 | 
					    honor_timestamps: true | 
				
			||||
 | 
					    scrape_interval: 15s | 
				
			||||
 | 
					    scrape_timeout: 10s | 
				
			||||
 | 
					    metrics_path: /metrics | 
				
			||||
 | 
					    scheme: http | 
				
			||||
 | 
					    static_configs: | 
				
			||||
 | 
					      - targets: | 
				
			||||
 | 
					          - localhost:9090 | 
				
			||||
 | 
					  - job_name: hoymiles | 
				
			||||
 | 
					    honor_timestamps: true | 
				
			||||
 | 
					    scrape_interval: 15s | 
				
			||||
 | 
					    scrape_timeout: 10s | 
				
			||||
 | 
					    metrics_path: / | 
				
			||||
 | 
					    scheme: http | 
				
			||||
 | 
					    static_configs: | 
				
			||||
 | 
					      - targets: | 
				
			||||
 | 
					          - 172.18.0.1:9233 | 
				
			||||
@ -1 +1,2 @@ | 
				
			|||||
influxdb-client>=1.28.0 | 
					influxdb-client>=1.28.0 | 
				
			||||
 | 
					prometheus_client | 
				
			||||
 | 
				
			|||||
@ -0,0 +1,14 @@ | 
				
			|||||
 | 
					[Unit] | 
				
			||||
 | 
					Description=Hoymiles Exporter | 
				
			||||
 | 
					After=network.target | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					[Service] | 
				
			||||
 | 
					WorkingDirectory=/home/rpi/hoymiles_exporter | 
				
			||||
 | 
					ExecStart=/usr/bin/bash -c 'cd /home/rpi/hoymiles_exporter ; /usr/bin/python3 -um hoymiles --config ahoy.yml' | 
				
			||||
 | 
					User=rpi | 
				
			||||
 | 
					KillMode=process | 
				
			||||
 | 
					Restart=on-failure | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					[Install] | 
				
			||||
 | 
					WantedBy=multi-user.target | 
				
			||||
 | 
					Alias=hoymiles.service | 
				
			||||
					Loading…
					
					
				
		Reference in new issue