Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Current »

Sensor values download script for Linux bash.

Edit correct HOSTIP, PARAM (if needed) and save the file (sensors.sh for example). Execute it from Linux console. Sensors values saved in 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}
  • No labels