Skip to content

Prometheus Exporter that acquires temperature and humidity from the sensor AM2320.

License

Notifications You must be signed in to change notification settings

yudaishimanaka/am2320_exporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

am2320_exporter

am2320_exporter

Prometheus Exporter that acquires temperature and humidity from the sensor AM2320.

Description

This Exporter is created on the assumption that it will run on a Raspberry Pi.
For temperature and humidity monitoring using Raspberry Pi and Docker.
It is also possible to deploy on Kubernetes.

Exported metrics

metric description labels
am2320_temperature_gauge temperature obtained from am2320
am2320_humidity_gauge humidity obtained from am2320

Requirements

  • Go 1.12.x ~ (Your computer or Raspberry Pi)
  • Docker (Raspberry Pi)

Usage

The connection between the Raspberry Pi and the AM2320 sensor has been completed in advance.

Go

Build the program on your computer or Raspberry Pi.
export GO111MODULE=on
GOOS=linux GOARCH=arm GOARM=7 go build

Binary execution.
sudo ./am2320-exporter

Docker

docker run -i -t -d --name am2320_exporter -p 9430:9430 --privileged yudaishimanaka/am2320-exporter-armv7l

Kubernetes

Configure Pod Affinity according to your Kubernetes cluster and deploy appropriately.

example

# Configuration example when deploying to a cluster consisting of only Master and Edge nodes.
apiVersion: extensions/v1beta1
kind: Daemonset
metadata:
  name: am2320-exporter
  namespace: monitoring
  labels:
    name: am2320-exporter
spec:
  template:
    metadata:
      labels:
        app: am2320-exporter
      annotations:
        prometheus.io/scrape: 'true'
        prometheus.io/port: '9430'
        prometheus.io/path: /metrics
    spec:
      containers:
      - name: am2320-exporter
        image: yudaishimanaka/am2320-exporter-armv7l:latest
        imagePullPolicy: Always
        securityContext:
          privileged: true
        ports:
        - containerPort: 9430
      hostNetwork: true
      hostPID: true

License

The MIT License (MIT) -see LICENSE for more details.

About

Prometheus Exporter that acquires temperature and humidity from the sensor AM2320.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published