summaryrefslogtreecommitdiff
path: root/datasources/yves_laserjet_tonerstatus.sh
diff options
context:
space:
mode:
authorEbus-at-dockstar <ebus@dockstar>2013-03-25 11:42:52 +0100
committerEbus-at-dockstar <ebus@dockstar>2013-03-25 11:43:05 +0100
commit6f20cda5c3071e03d2a56dc8236a530582cad2b7 (patch)
tree0aec854bc129ccf44bf35b70aac86b50bd24fa85 /datasources/yves_laserjet_tonerstatus.sh
parent862282ce99760832d3e9e5b4b1171b861105e004 (diff)
downloadebus-alt-6f20cda5c3071e03d2a56dc8236a530582cad2b7.tar.gz
ebus-alt-6f20cda5c3071e03d2a56dc8236a530582cad2b7.zip
neue datenquellen
Diffstat (limited to 'datasources/yves_laserjet_tonerstatus.sh')
-rwxr-xr-xdatasources/yves_laserjet_tonerstatus.sh14
1 files changed, 14 insertions, 0 deletions
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
+ )