Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

sudden unary operator expected errors

Featured Replies

I've recently upgraded the PERC6i card in my Dell R710 to a H300 card flashed to IT mode.

The array has been recreated successfully, all docker containers are running with no data loss etc.

 

The only things that're broken completely inexplicably, is my fan-temp control script, and the IPMI sensor readings.

 

When it's run, it logs this:

Quote

Script location: /tmp/user.scripts/tmpScripts/Fan Speed/script
Note
/tmp/user.scripts/tmpScripts/Fan Speed/script: line 45: [: -ge: unary operator expected
/tmp/user.scripts/tmpScripts/Fan Speed/script: line 48: [: -le: unary operator expected
/tmp/user.scripts/tmpScripts/Fan Speed/script: line 52: [: -le: unary operator expected
/tmp/user.scripts/tmpScripts/Fan Speed/script: line 56: [: -le: unary operator expected
/tmp/user.scripts/tmpScripts/Fan Speed/script: line 60: [: -le: unary operator expected
/tmp/user.scripts/tmpScripts/Fan Speed/script: line 64: [: -le: unary operator expected

If I manually run the command to change fan speed, that particular command works fine and adjusts fan speed as expected.

The script code (minus the IDRAC section) is here:
 

# TEMPERATURE
# Change this to the temperature in celcius you are comfortable with.
# If the temperature goes above the set degrees it will send raw IPMI command to enable dynamic fan control
MAXTEMP=33
TEMP_STEP1=22
TEMP_STEP2=24
TEMP_STEP3=28
TEMP_STEP4=30
TEMP_STEP5=32

# 22 -> 1200 RPM
# 24 -> 1560 RPM
# 28 -> 20%
# 30 -> 30%
# 32 -> 40%
# 33 -> Automatic control


# This variable sends a IPMI command to get the temperature, and outputs it as two digits.
# Do not edit unless you know what you do.
TEMP=$(ipmitool -I lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW sdr type temperature |grep Ambient |grep degrees |grep -Po '\d{2}' | tail -1)

echo $TEMP

if [ $TEMP -ge $MAXTEMP ]; then
        echo " $TEMP is > $MAXTEMP. Switching to automatic fan control "
        ipmitool -I lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW raw 0x30 0x30 0x01 0x01
elif [ $TEMP -le $TEMP_STEP1 ]; then
        echo " $TEMP is < $TEMP_STEP1. Switching to manual 1200 RPM "
        ipmitool -I lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW raw 0x30 0x30 0x01 0x00
        ipmitool -I lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW raw 0x30 0x30 0x02 0xff 0x01    
elif [ $TEMP -le $TEMP_STEP2 ]; then
        echo " $TEMP is < $TEMP_STEP2. Switching to manual 1560 RPM "
        ipmitool -I lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW raw 0x30 0x30 0x01 0x00
        ipmitool -I lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW raw 0x30 0x30 0x02 0xff 0x03
elif [ $TEMP -le $TEMP_STEP3 ]; then
        echo " $TEMP is < $TEMP_STEP3. Switching to manual 20% control "
        ipmitool -I lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW raw 0x30 0x30 0x01 0x00
        ipmitool -I lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW raw 0x30 0x30 0x02 0xff 0x14
elif [ $TEMP -le $TEMP_STEP4 ]; then
        echo " $TEMP is < $TEMP_STEP4. Switching to manual 30% control "
        ipmitool -I lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW raw 0x30 0x30 0x01 0x00
        ipmitool -I lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW raw 0x30 0x30 0x02 0xff 0x1e
elif [ $TEMP -le $TEMP_STEP5 ]; then
        echo " $TEMP is < $TEMP_STEP5. Switching to manual 40% control "
        ipmitool -I lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW raw 0x30 0x30 0x01 0x00
        ipmitool -I lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW raw 0x30 0x30 0x02 0xff 0x28
fi

 

I've attached the diagnostics.

 

If someone could take a look and tell me how I've managed to make this break so hard, and how to fix it, I'd be very grateful.

poweredge-diagnostics-20230327-2325.zip

Edited by minkshaman

Solved by minkshaman

  • Author
  • Solution

So I've resolved the issue:

I left the IT mode card installed and controlling the HDDs, then installed the PERC6i into the integrated slot with no HDD.

I disabled all the functionality of the PERC card in it's BIOS, and booted again.

 

Magically, the IPMI sensors are back, and the scripts work properly again.

 

WTF Dell. WTF.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.