I have a windows program that probes a server room temperature sensor called sensor_check.exe. The program spits back the following example output to a specified file and to the console.
I have created the following check to parse out the Variable2: temperature value of 19.2. Note I added the windows ports of grep and cut.
UserParameter=system.tempcheck,c:\sensor_check.exe -L tempcheck.log -C COM 1 | grep "TEMPERATURE (0.1" | cut -C:44 -L:4
The check works fine and from a dos prompt I can enter the following
c:\>zabbix_agentd -t sytem.tempcheck
and receive the following response,
system.tempcheck [t|19.8]
I can tell from the "t" that the value returned is text but this does not allow me to graph or trend these values. Is there anyway to have the agent or server change or cast this value from text to a double? Alternatively is there a better way of cutting the value out of the returned text or the file that is created?
Device Model = Temperature Sensor
Device Status = Normal
Firmware Version = 3.22
Number of variables = 3
Variable 1: TEMPERATURE (0.5 C RESOLUTION) 20 C
Variable 2: TEMPERATURE (0.1 C RESOLUTION) 19.9 C
Variable 3: HASH ID 998
Device Status = Normal
Firmware Version = 3.22
Number of variables = 3
Variable 1: TEMPERATURE (0.5 C RESOLUTION) 20 C
Variable 2: TEMPERATURE (0.1 C RESOLUTION) 19.9 C
Variable 3: HASH ID 998
I have created the following check to parse out the Variable2: temperature value of 19.2. Note I added the windows ports of grep and cut.
UserParameter=system.tempcheck,c:\sensor_check.exe -L tempcheck.log -C COM 1 | grep "TEMPERATURE (0.1" | cut -C:44 -L:4
The check works fine and from a dos prompt I can enter the following
c:\>zabbix_agentd -t sytem.tempcheck
and receive the following response,
system.tempcheck [t|19.8]
I can tell from the "t" that the value returned is text but this does not allow me to graph or trend these values. Is there anyway to have the agent or server change or cast this value from text to a double? Alternatively is there a better way of cutting the value out of the returned text or the file that is created?
Comment