From 6f20cda5c3071e03d2a56dc8236a530582cad2b7 Mon Sep 17 00:00:00 2001 From: Ebus-at-dockstar Date: Mon, 25 Mar 2013 11:42:52 +0100 Subject: neue datenquellen --- datasources/yves_laserjet_tonerstatus.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 datasources/yves_laserjet_tonerstatus.sh (limited to 'datasources/yves_laserjet_tonerstatus.sh') diff --git a/datasources/yves_laserjet_tonerstatus.sh b/datasources/yves_laserjet_tonerstatus.sh new file mode 100755 index 0000000..6b7628a --- /dev/null +++ b/datasources/yves_laserjet_tonerstatus.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +name=yves.laserjet.tonerstatus +type=int + +curl -s "http://10.1.0.10/hp/device/info_suppliesStatus.html" | + sed -ne 's/.*>\([0-9]*\)%<.*/\1/p' | + ( + read value + curl -s -i -H "Accept: application/json" \ + -X PUT "http://localhost:8000/sensor/${name}" \ + -d "value=${value}&type=${type}" | + grep '"error": null' >/dev/null + ) -- cgit v1.2.1