Closed twixt01 closed 6 years ago
Are you running this command in Bash? The error you're describing could possibly be due to using $()
syntax in csh or tsh which doesn't support it.
I tried running the ipmitool output through the sed command you described and it worked in Bash 4.4.12.
Ah of course. I am trying to troubleshoot this command when it runs in the cron. I think when it runs it is creating a null value so when it runs graph the rrd is creating 7 values but CPU is empty and causing following runs to fail.
When I run it without the sed -n "$((i+1))p" section it shows this. ipmitool -I lanplus -H "192.168.1.5" -U "ADMIN" -f /root/.ipmi sdr elist | sed -Ene 's/^CPU[^ ]+ +Temp +| .* ([^ ]+) degrees C/\1/p'
CPU41 System53 Peripheral47 MB_10G55 DIMMA145
When I run the rrd script: Creating rrdtool db file: /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd Rrdtool arguments: DS:cpu0:GAUGE:120:0:150 DS:ada0:GAUGE:120:0:100 DS:ada1:GAU GE:120:0:100 DS:ada2:GAUGE:120:0:100 DS:ada3:GAUGE:120:0:100 DS:ada4:GAUGE:120:0 :100 DS:ada5:GAUGE:120:0:100 /usr/local/bin/rrdtool create /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd --ste p 60 DS:cpu0:GAUGE:120:0:150 DS:ada0:GAUGE:120:0:100 DS:ada1:GAUGE:120:0:100 DS: ada2:GAUGE:120:0:100 DS:ada3:GAUGE:120:0:100 DS:ada4:GAUGE:120:0:100 DS:ada5:GAU GE:120:0:100 RRA:MAX:0.5:1:3000
root@freenas:~ # /mnt/SSD/Scripts/freenas-temp/rrd.sh --platform "esxi" --ipmitool_username ADMIN --ipmitool_address 192.168.1.5 /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd ERROR: /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd: expected 7 data source readings (got 6) from N ERROR: Couldn't update /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd with the data provided. Running diagnostics... rrd.sh version: 1.0 rrd-graph.sh version: rrd-lib.sh version: 1.0 Testing file permissions... Testing chmod... Testing file field count... The number of fields in the rrd file (7) does not match the number of fields supplied (6) You may need to delete the rrd file and try again Test failed (returned 1)
If I override the temp variable in the script it works fine, (except my temp value is now made up.)
root@freenas:~ # /mnt/SSD/Scripts/freenas-temp/rrd.sh --platform "esxi" --ipmitool_username ADMIN --ipmitool_address 192.168.1.5 /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd -v Script version: 1.0 Platform is set to 'esxi'. Username is 'ADMIN and ip is '192.168.1.5' Rrdtool database filename: /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd Current working directory is: /mnt/SSD/Scripts/freenas-temp Rrdtool database doesn't exist. Creating it. Platform is set to 'esxi'. Attempting to retrieve the list of CPUs using ipmitool with username 'ADMIN and ip 192.168.1.5... drivedevs: ada0 drivedevs: ada0 ada1 drivedevs: ada0 ada1 ada2 drivedevs: ada0 ada1 ada2 ada3 drivedevs: ada0 ada1 ada2 ada3 ada4 drivedevs: ada0 ada1 ada2 ada3 ada4 ada5 numcpus: 1 Sampling every 60 seconds Creating rrdtool db file: /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd Rrdtool arguments: DS:cpu0:GAUGE:120:0:150 DS:ada0:GAUGE:120:0:100 DS:ada1:GAUGE:120:0:100 DS:ada2:GAUGE:120:0:100 DS:ada3:GAUGE:120:0:100 DS:ada4:GAUGE:120:0:100 DS:ada5:GAUGE:120:0:100 /usr/local/bin/rrdtool create /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd --step 60 DS:cpu0:GAUGE:120:0:150 DS:ada0:GAUGE:120:0:100 DS:ada1:GAUGE:120:0:100 DS:ada2:GAUGE:120:0:100 DS:ada3:GAUGE:120:0:100 DS:ada4:GAUGE:120:0:100 DS:ada5:GAUGE:120:0:100 RRA:MAX:0.5:1:3000 Initialized datafile root@freenas:~ # /mnt/SSD/Scripts/freenas-temp/rrd.sh --platform "esxi" --ipmitool_username ADMIN --ipmitool_address 192.168.1.5 /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd -v Script version: 1.0 Platform is set to 'esxi'. Username is 'ADMIN and ip is '192.168.1.5' Rrdtool database filename: /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd Current working directory is: /mnt/SSD/Scripts/freenas-temp Running script: '/mnt/SSD/Scripts/freenas-temp/temps-rrd-format.sh -v --platform esxi --ipmitool_username ADMIN --ipmitool_address 192.168.1.5'
37:38:37:38:37:36
(running script again non-verbosely) Data: 37:38:37:38:37:36
Updating the db: '/usr/local/bin/rrdtool update /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd N:37:38:37:38:37:36' ERROR: /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd: expected 7 data source readings (got 6) from N ERROR: Couldn't update /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd with the data provided. Running diagnostics... rrd.sh version: 1.0 rrd-graph.sh version: rrd-lib.sh version: 1.0 Testing file permissions... Testing chmod... Testing file field count... The number of fields in the rrd file (7) does not match the number of fields supplied (6) You may need to delete the rrd file and try again Test failed (returned 1) root@freenas:~ #
root@freenas:~ # /mnt/SSD/Scripts/freenas-temp/rrd.sh --platform "esxi" --ipmitool_username ADMIN --ipmitool_address 192.168.1.5 /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd -d
verbose=1
'[' -n '' ']'
'[' -n 1 ']'
echo 'Script version: 1.0' Script version: 1.0
case "${PLATFORM}" in
'[' -n 1 ']'
echo 'Platform is set to '\''esxi'\''. Username is '\''ADMIN and ip is '\''192.168.1.5'\''' Platform is set to 'esxi'. Username is 'ADMIN and ip is '192.168.1.5'
'[' -z ADMIN ']'
'[' -z 192.168.1.5 ']'
args=' --platform esxi --ipmitool_username ADMIN --ipmitool_address 192.168.1.5' ++ id -u
'[' 0 '!=' 0 ']'
'[' -z /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd ']'
'[' -n 1 ']'
echo 'Rrdtool database filename: /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd' Rrdtool database filename: /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd +++ dirname /mnt/SSD/Scripts/freenas-temp/rrd.sh ++ cd /mnt/SSD/Scripts/freenas-temp ++ pwd
CWD=/mnt/SSD/Scripts/freenas-temp
'[' -n 1 ']'
echo 'Current working directory is: /mnt/SSD/Scripts/freenas-temp' Current working directory is: /mnt/SSD/Scripts/freenas-temp
. /mnt/SSD/Scripts/freenas-temp/rrd-lib.sh ++ RRDSCRIPTLIBVERSION=1.0 +++ mktemp ++ GETTEMP=/tmp/tmp.YwOaxGuW ++ cat ++ trap '{ rm /tmp/tmp.YwOaxGuW; }' EXIT
'[' -e /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd ']'
'[' -n 1 ']'
echo 'Rrdtool database doesn'\''t exist. Creating it.' Rrdtool database doesn't exist. Creating it.
get_devices
case "${PLATFORM}" in
'[' -n 1 ']'
echo 'Platform is set to '\''esxi'\''. Attempting to retrieve the list of CPUs using ipmitool with username '\''ADMIN and ip 192.168.1.5...' Platform is set to 'esxi'. Attempting to retrieve the list of CPUs using ipmitool with username 'ADMIN and ip 192.168.1.5... ++ ipmitool -I lanplus -H 192.168.1.5 -U ADMIN -f /root/.ipmi sdr elist all ++ grep -c -i 'cpu.*temp'
numcpus=1
drivedevs= ++ /sbin/sysctl -n kern.disks ++ awk '{ for (i=NF; i>1; i--) printf("%s ",$i); print $1; }'
for i in $(/sbin/sysctl -n kern.disks | awk '{ for (i=NF; i>1; i--) printf("%s ",$i); print $1; }') ++ /usr/local/sbin/smartctl -a /dev/da0 ++ awk -f /tmp/tmp.YwOaxGuW
DevTemp=
'[' -n '' ']'
for i in $(/sbin/sysctl -n kern.disks | awk '{ for (i=NF; i>1; i--) printf("%s ",$i); print $1; }') ++ /usr/local/sbin/smartctl -a /dev/da1 ++ awk -f /tmp/tmp.YwOaxGuW
DevTemp=
'[' -n '' ']'
for i in $(/sbin/sysctl -n kern.disks | awk '{ for (i=NF; i>1; i--) printf("%s ",$i); print $1; }') ++ /usr/local/sbin/smartctl -a /dev/da2 ++ awk -f /tmp/tmp.YwOaxGuW
DevTemp=
'[' -n '' ']'
for i in $(/sbin/sysctl -n kern.disks | awk '{ for (i=NF; i>1; i--) printf("%s ",$i); print $1; }') ++ /usr/local/sbin/smartctl -a /dev/ada0 ++ awk -f /tmp/tmp.YwOaxGuW
DevTemp=37
'[' -n 37 ']'
drivedevs=' ada0'
'[' -n 1 ']'
echo 'drivedevs: ada0' drivedevs: ada0
for i in $(/sbin/sysctl -n kern.disks | awk '{ for (i=NF; i>1; i--) printf("%s ",$i); print $1; }') ++ /usr/local/sbin/smartctl -a /dev/ada1 ++ awk -f /tmp/tmp.YwOaxGuW
DevTemp=39
'[' -n 39 ']'
drivedevs=' ada0 ada1'
'[' -n 1 ']'
echo 'drivedevs: ada0 ada1' drivedevs: ada0 ada1
for i in $(/sbin/sysctl -n kern.disks | awk '{ for (i=NF; i>1; i--) printf("%s ",$i); print $1; }') ++ /usr/local/sbin/smartctl -a /dev/ada2 ++ awk -f /tmp/tmp.YwOaxGuW
DevTemp=37
'[' -n 37 ']'
drivedevs=' ada0 ada1 ada2'
'[' -n 1 ']'
echo 'drivedevs: ada0 ada1 ada2' drivedevs: ada0 ada1 ada2
for i in $(/sbin/sysctl -n kern.disks | awk '{ for (i=NF; i>1; i--) printf("%s ",$i); print $1; }') ++ /usr/local/sbin/smartctl -a /dev/ada3 ++ awk -f /tmp/tmp.YwOaxGuW
DevTemp=38
'[' -n 38 ']'
drivedevs=' ada0 ada1 ada2 ada3'
'[' -n 1 ']'
echo 'drivedevs: ada0 ada1 ada2 ada3' drivedevs: ada0 ada1 ada2 ada3
for i in $(/sbin/sysctl -n kern.disks | awk '{ for (i=NF; i>1; i--) printf("%s ",$i); print $1; }') ++ /usr/local/sbin/smartctl -a /dev/ada4 ++ awk -f /tmp/tmp.YwOaxGuW
DevTemp=37
'[' -n 37 ']'
drivedevs=' ada0 ada1 ada2 ada3 ada4'
'[' -n 1 ']'
echo 'drivedevs: ada0 ada1 ada2 ada3 ada4' drivedevs: ada0 ada1 ada2 ada3 ada4
for i in $(/sbin/sysctl -n kern.disks | awk '{ for (i=NF; i>1; i--) printf("%s ",$i); print $1; }') ++ /usr/local/sbin/smartctl -a /dev/ada5 ++ awk -f /tmp/tmp.YwOaxGuW
DevTemp=36
'[' -n 36 ']'
drivedevs=' ada0 ada1 ada2 ada3 ada4 ada5'
'[' -n 1 ']'
echo 'drivedevs: ada0 ada1 ada2 ada3 ada4 ada5' drivedevs: ada0 ada1 ada2 ada3 ada4 ada5
'[' -n 1 ']'
echo 'numcpus: 1' numcpus: 1
export numcpus drivedevs ++ echo /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd ++ sed 's/.temps-(.)min.rrd/\1/'
interval=1
'[' -z 1 ']'
timespan=60
doubletimespan=120
'[' -n 1 ']'
echo 'Sampling every 60 seconds' Sampling every 60 seconds
rrdarg=
(( i=0 ))
(( i < numcpus ))
rrdarg=' DS:cpu0:GAUGE:120:0:150'
(( i++ ))
(( i < numcpus ))
for i in ${drivedevs}
rrdarg=' DS:cpu0:GAUGE:120:0:150 DS:ada0:GAUGE:120:0:100'
for i in ${drivedevs}
rrdarg=' DS:cpu0:GAUGE:120:0:150 DS:ada0:GAUGE:120:0:100 DS:ada1:GAUGE:120:0:100'
for i in ${drivedevs}
rrdarg=' DS:cpu0:GAUGE:120:0:150 DS:ada0:GAUGE:120:0:100 DS:ada1:GAUGE:120:0:100 DS:ada2:GAUGE:120:0:100'
for i in ${drivedevs}
rrdarg=' DS:cpu0:GAUGE:120:0:150 DS:ada0:GAUGE:120:0:100 DS:ada1:GAUGE:120:0:100 DS:ada2:GAUGE:120:0:100 DS:ada3:GAUGE:120:0:100'
for i in ${drivedevs}
rrdarg=' DS:cpu0:GAUGE:120:0:150 DS:ada0:GAUGE:120:0:100 DS:ada1:GAUGE:120:0:100 DS:ada2:GAUGE:120:0:100 DS:ada3:GAUGE:120:0:100 DS:ada4:GAUGE:120:0:100'
for i in ${drivedevs}
rrdarg=' DS:cpu0:GAUGE:120:0:150 DS:ada0:GAUGE:120:0:100 DS:ada1:GAUGE:120:0:100 DS:ada2:GAUGE:120:0:100 DS:ada3:GAUGE:120:0:100 DS:ada4:GAUGE:120:0:100 DS:ada5:GAUGE:120:0:100'
echo 'Creating rrdtool db file: /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd' Creating rrdtool db file: /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd
echo 'Rrdtool arguments: DS:cpu0:GAUGE:120:0:150 DS:ada0:GAUGE:120:0:100 DS:ada1:GAUGE:120:0:100 DS:ada2:GAUGE:120:0:100 DS:ada3:GAUGE:120:0:100 DS:ada4:GAUGE:120:0:100 DS:ada5:GAUGE:120:0:100' Rrdtool arguments: DS:cpu0:GAUGE:120:0:150 DS:ada0:GAUGE:120:0:100 DS:ada1:GAUGE:120:0:100 DS:ada2:GAUGE:120:0:100 DS:ada3:GAUGE:120:0:100 DS:ada4:GAUGE:120:0:100 DS:ada5:GAUGE:120:0:100
echo /usr/local/bin/rrdtool create /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd --step 60 DS:cpu0:GAUGE:120:0:150 DS:ada0:GAUGE:120:0:100 DS:ada1:GAUGE:120:0:100 DS:ada2:GAUGE:120:0:100 DS:ada3:GAUGE:120:0:100 DS:ada4:GAUGE:120:0:100 DS:ada5:GAUGE:120:0:100 RRA:MAX:0.5:1:3000 /usr/local/bin/rrdtool create /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd --step 60 DS:cpu0:GAUGE:120:0:150 DS:ada0:GAUGE:120:0:100 DS:ada1:GAUGE:120:0:100 DS:ada2:GAUGE:120:0:100 DS:ada3:GAUGE:120:0:100 DS:ada4:GAUGE:120:0:100 DS:ada5:GAUGE:120:0:100 RRA:MAX:0.5:1:3000
/usr/local/bin/rrdtool create /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd --step 60 DS:cpu0:GAUGE:120:0:150 DS:ada0:GAUGE:120:0:100 DS:ada1:GAUGE:120:0:100 DS:ada2:GAUGE:120:0:100 DS:ada3:GAUGE:120:0:100 DS:ada4:GAUGE:120:0:100 DS:ada5:GAUGE:120:0:100 RRA:MAX:0.5:1:3000
'[' 0 == 0 ']'
'[' -n 1 ']'
echo 'Initialized datafile' Initialized datafile
exit 0
rm /tmp/tmp.YwOaxGuW root@freenas:~ # /mnt/SSD/Scripts/freenas-temp/rrd.sh --platform "esxi" --ipmitool_username ADMIN --ipmitool_address 192.168.1.5 /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd -d
verbose=1
'[' -n '' ']'
'[' -n 1 ']'
echo 'Script version: 1.0' Script version: 1.0
case "${PLATFORM}" in
'[' -n 1 ']'
echo 'Platform is set to '\''esxi'\''. Username is '\''ADMIN and ip is '\''192.168.1.5'\''' Platform is set to 'esxi'. Username is 'ADMIN and ip is '192.168.1.5'
'[' -z ADMIN ']'
'[' -z 192.168.1.5 ']'
args=' --platform esxi --ipmitool_username ADMIN --ipmitool_address 192.168.1.5' ++ id -u
'[' 0 '!=' 0 ']'
'[' -z /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd ']'
'[' -n 1 ']'
echo 'Rrdtool database filename: /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd' Rrdtool database filename: /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd +++ dirname /mnt/SSD/Scripts/freenas-temp/rrd.sh ++ cd /mnt/SSD/Scripts/freenas-temp ++ pwd
CWD=/mnt/SSD/Scripts/freenas-temp
'[' -n 1 ']'
echo 'Current working directory is: /mnt/SSD/Scripts/freenas-temp' Current working directory is: /mnt/SSD/Scripts/freenas-temp
. /mnt/SSD/Scripts/freenas-temp/rrd-lib.sh ++ RRDSCRIPTLIBVERSION=1.0 +++ mktemp ++ GETTEMP=/tmp/tmp.tSXR2Df1 ++ cat ++ trap '{ rm /tmp/tmp.tSXR2Df1; }' EXIT
'[' -e /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd ']'
func_test_writable /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd
'[' -e /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd ']'
'[' -e /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd ']'
'[' -f /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd ']'
touch /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd
return 0
'[' -n 1 ']'
echo 'Running script: '\''/mnt/SSD/Scripts/freenas-temp/temps-rrd-format.sh -v --platform esxi --ipmitool_username ADMIN --ipmitool_address 192.168.1.5'\''' Running script: '/mnt/SSD/Scripts/freenas-temp/temps-rrd-format.sh -v --platform esxi --ipmitool_username ADMIN --ipmitool_address 192.168.1.5'
'[' -n 1 ']'
echo ''
'[' -n 1 ']'
echo ''
'[' -n 1 ']'
/mnt/SSD/Scripts/freenas-temp/temps-rrd-format.sh --platform esxi --ipmitool_username ADMIN --ipmitool_address 192.168.1.5 37:39:37:38:37:36
'[' -n 1 ']'
echo ''
'[' -n 1 ']'
echo ''
'[' -n 1 ']'
echo '(running script again non-verbosely)' (running script again non-verbosely) ++ /mnt/SSD/Scripts/freenas-temp/temps-rrd-format.sh --platform esxi --ipmitool_username ADMIN --ipmitool_address 192.168.1.5
data=37:39:37:38:37:36
'[' -n 1 ']'
echo 'Data: 37:39:37:38:37:36' Data: 37:39:37:38:37:36
'[' -n 1 ']'
echo ''
'[' -n 1 ']'
echo 'Updating the db: '\''/usr/local/bin/rrdtool update /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd N:37:39:37:38:37:36'\''' Updating the db: '/usr/local/bin/rrdtool update /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd N:37:39:37:38:37:36'
/usr/local/bin/rrdtool update /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd N:37:39:37:38:37:36 ERROR: /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd: expected 7 data source readings (got 6) from N
'[' 1 == 0 ']'
echo 'ERROR: Couldn'\''t update /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd with the data provided. Running diagnostics...' ERROR: Couldn't update /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd with the data provided. Running diagnostics...
func_debug_setup
echo 'rrd.sh version: 1.0' rrd.sh version: 1.0
echo 'rrd-graph.sh version: ' rrd-graph.sh version:
echo 'rrd-lib.sh version: 1.0' rrd-lib.sh version: 1.0
echo 'Testing file permissions...' Testing file permissions...
func_test_writable /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd
'[' -e /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd ']'
'[' -e /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd ']'
'[' -f /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd ']'
touch /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd
return 0
func_debug_setup_return_test 0
'[' 0 == 0 ']'
echo 'Testing chmod...' Testing chmod...
func_test_chmod /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd ++ dd if=/dev/urandom bs=300 count=1 status=noxfer ++ sha256
TEMPFILENAME=137c5de7d5f045477d610a26ecd4da618acc30873a096aeaa0924be21881094a
touch /tmp/chmodtest_137c5de7d5f045477d610a26ecd4da618acc30873a096aeaa0924be21881094a
chmod 600 /tmp/chmodtest_137c5de7d5f045477d610a26ecd4da618acc30873a096aeaa0924be21881094a
rm -f /tmp/chmodtest_137c5de7d5f045477d610a26ecd4da618acc30873a096aeaa0924be21881094a
dir=/mnt/SSD/Scripts/freenas-temp
'[' -d /mnt/SSD/Scripts/freenas-temp ']'
touch /mnt/SSD/Scripts/freenas-temp/chmodtest_137c5de7d5f045477d610a26ecd4da618acc30873a096aeaa0924be21881094a
chmod 600 /mnt/SSD/Scripts/freenas-temp/chmodtest_137c5de7d5f045477d610a26ecd4da618acc30873a096aeaa0924be21881094a
rm -f /mnt/SSD/Scripts/freenas-temp/chmodtest_137c5de7d5f045477d610a26ecd4da618acc30873a096aeaa0924be21881094a
func_debug_setup_return_test 0
'[' 0 == 0 ']'
echo 'Testing file field count...' Testing file field count...
func_compare_data_field_count_to_rrd_gauge_count
'[' -z 37:39:37:38:37:36 ']' ++ /usr/local/bin/rrdtool info /mnt/SSD/Scripts/freenas-temp/temps-1min.rrd ++ grep -c 'type = "GAUGE"'
gauges_in_file=7
colons_from_data=:::::
fields_in_data=6
'[' 7 == 6 ']'
echo 'The number of fields in the rrd file (7) does not match the number of fields supplied (6)' The number of fields in the rrd file (7) does not match the number of fields supplied (6)
echo 'You may need to delete the rrd file and try again' You may need to delete the rrd file and try again
return 1
func_debug_setup_return_test 1
'[' 1 == 0 ']'
echo 'Test failed (returned 1)' Test failed (returned 1)
exit 1
rm /tmp/tmp.tSXR2Df1 root@freenas:~ #
It might be line 40 in rrd-lib.sh
which should be split into 2 export lines. Could you try that, and if it doesn't work, try posting the output of /mnt/SSD/Scripts/freenas-temp/temps-rrd-format.sh -v --platform esxi --ipmitool_username ADMIN --ipmitool_address 192.168.1.5
?
I’m closing this issue since it’s been quiet for a while. If the problem still exists, please reopen it or comment.
When using IPMI tool, sed is not getting the CPU temp properly. supermicro IPMI
stripped sed:
root@freenas:/mnt/SSD/scripts/freenas-temp # ipmitool -I lanplus -H "192.168.1.5" -U "ADMIN" -f /root/.ipmi sdr elist
CPU Temp | 01h | ok | 3.1 | 68 degrees C System Temp | 0Bh | ok | 7.1 | 50 degrees C Peripheral Temp | 0Ch | ok | 7.2 | 48 degrees C MB_10G Temp | 0Dh | ok | 7.4 | 58 degrees C DIMMA1 Temp | B0h | ok | 32.64 | 51 degrees C DIMMA2 Temp | B1h | ns | 32.65 | No Reading DIMMB1 Temp | B4h | ns | 32.68 | No Reading DIMMB2 Temp | B5h | ns | 32.69 | No Reading FAN1 | 41h | ok | 29.1 | 3200 RPM FAN2 | 42h | ns | 29.2 | No Reading FAN3 | 43h | ns | 29.3 | No Reading FAN4 | 44h | ns | 29.4 | No Reading VCCP | 20h | ok | 3.2 | 1.83 Volts VDIMM | 24h | ok | 32.1 | 1.18 Volts 12V | 30h | ok | 7.17 | 12.06 Volts 5VCC | 31h | ok | 7.33 | 4.92 Volts 3.3VCC | 32h | ok | 7.32 | 3.35 Volts VBAT | 33h | ok | 7.18 | 3.17 Volts 5V Dual | 38h | ok | 7.15 | 4.95 Volts 3.3V AUX | 39h | ok | 7.12 | 3.27 Volts Chassis Intru | AAh | ok | 23.1 |
with sed:
ipmitool -I lanplus -H "192.168.1.5" -U "ADMIN" -f /root/.ipmi sdr elist | sed -Ene 's/^CPU[^ ]+ +Temp +| .* ([^ ]+) degrees C/\1/p' | sed -n "$((i+1))p"
Illegal variable name.