Language selection:
Skip to main navigation Skip to main content Skip to page footer

Sensor values download script for Linux bash.

Edit correct HOSTIP, and PARAM (if needed) and save the file (“sensors.sh” for example). Execute it from the Linux console. 

Sensors values are saved in a “dump.xml” file.

Parameters:

  • id - Dump for sensor with the specified ID;

  • txt=true - CSV dump;

#!/bin/sh
# measurements result script
# host address
HOSTIP="192.168.1.190"
# user name
USERNAME="guest"
# user password
PASSWORD="guest"
# dumplog file
DUMPFILE="dump.xml"
# parametrs
PARAM=""
#here: dump - in text form, only for sensor with id=1001
# PARAM="&txt=true&id=1001"
# 1) hash

HASH=`echo -n ${PASSWORD} | openssl dgst -sha1 | awk '{print $NF}'`
# 2) authorization
RESPONSE=`curl -s -d "querytype=auth&name=${USERNAME}&h=${HASH}"
"${HOSTIP}/engine.htm"`
# 3) session key
KEY=`echo -n ${RESPONSE} | awk -F"\"" '{print $4}'`
# 4) unloading dump
curl -s "${HOSTIP}/dump.htm?k=${KEY}${PARAM}" -o ${DUMPFILE}

This website uses cookies

This website uses cookies to improve user experience. By using our website you consent to all cookies in accordance with our Cookie Policy.

Essential cookies enable basic functions and are necessary for the website to function properly.
Statistics cookies collect information anonymously. This information helps us to understand how our visitors use our website.
Marketing cookies are used by third parties or publishers to display personalized advertisements. They do this by tracking visitors across websites.