SNMP to MQTT bridge for PDU in our hackspace's serverroom
Open "pdu-snmp-to-mqtt-bridge.py" in editor and configuration variables for mqtt and snmp server.
- apt-get install python-netsnmp python-dateutil python-stdeb dh-python python-all snmp
- wget -O /usr/share/snmp/mibs/powernet410.mib "https://raw.githubusercontent.com/b4d/APC/master/powernet410.mib"
- sed -i "s/^mibs :/# mibs :/g" /etc/snmp/snmp.conf
- pypi-download paho-mqtt
- py2dsc paho-mqtt-1.2.tar.gz
- dpkg -i deb_dist/python-paho-mqtt_1.2-1_all.deb
- install -m755 pdu-snmp-to-mqtt-bridge.py /usr/local/bin
- install -m644 pdu-snmp-to-mqtt-bridge.service /etc/systemd/system
- systemctl enable pdu-snmp-to-mqtt-bridge.service
- systemctl start pdu-snmp-to-mqtt-bridge.service