little big problem. My calculated $z doesnt work for Cacti (no values to seen). If I define $z directly (i.e. z=8) everything is fine.
Script is in 777 and in the Cacti script folder
Here the whole script
bash print out:#!/bin/bash
#Datei einlesen
d=$(head -2 ../share/cacti/site/scripts/ESA1000WZ-log.txt)
#echo $d
#Reinen METER-Wert rauscutten
c=$(echo CGET CUX2711110:1 | nc localhost 6770 -q 1 | awk -F " " '{print $2}' | awk -F ":" '{print $2}')
echo $c >../share/cacti/site/scripts/ESA1000WZ-log.txt
z=$(echo "$c $d" | awk '{ print(($1 - $2) * 1000) }')
x=1
#Gesamtausgabe:
echo "METER:"$c" DIFF:"$z" TEST:"$x" "
root@cacti01:/usr/bin/X11# ../share/cacti/site/scripts/ESA1000WZforCacti.sh
METER:43010.59 DIFF:140 TEST:1
root@cacti01:/usr/bin/X11# ../share/cacti/site/scripts/ESA1000WZforCacti.sh
METER:43010.95 DIFF:360 TEST:1
root@cacti01:/usr/bin/X11# ../share/cacti/site/scripts/ESA1000WZforCacti.sh
METER:43010.95 DIFF:0 TEST:1
root@cacti01:/usr/bin/X11#
Cacti (see picture)