Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: could not convert string to float: "System Board Inlet Temp" #35

Open
mattpoel opened this issue Aug 20, 2017 · 1 comment

Comments

@mattpoel
Copy link

Hi,

I've an interesting issue with check_idrac on one of our Dell servers (out of probably 100). When I'm running check_idrac, it successfully executes until "System Board Inlet Temp" and then it raises the following exception:

--PDisk 12 (0:1:12) 278.88 GB: ONLINE, PowerStat: SPUNUP, HotSpare: no [HGST, HDD, S/N: XXXXXXXX]
--PDisk 13 (0:1:13) 278.88 GB: ONLINE, PowerStat: SPUNUP, HotSpare: no [HGST, HDD, S/N: YYYYYYYY]
Traceback (most recent call last):
  File "/etc/icinga2/scripts/idrac", line 842, in <module>
    result, tmp_code = PARSER().main()
  File "/etc/icinga2/scripts/idrac", line 688, in main
    hw_dict, exit_code = self.raise_alert(hw_dict, value_on_alert)
  File "/etc/icinga2/scripts/idrac", line 576, in raise_alert
    tmp[key][stat_t] = float(tmp[key][stat_t].strip('(!)'))/10
ValueError: could not convert string to float: "System Board Inlet Temp"

On other servers the output looks like:

--PDisk 14 (0:1:13) 278.88 GB: ONLINE, PowerStat: SPUNUP, HotSpare: no [HGST, HDD, S/N: YYYYYYYY]
--System Board Inlet Temp: 21.0 C ENABLED/OK | Temperature=21.0;;;;

I did some debugging and it looks like that tmp[key][stat_t] holds different values on a working and non-working server:

  • Working server: 210
  • Non-working server: "System Board Inlet Temp"

Thank you,
Matthias

@mattpoel
Copy link
Author

mattpoel commented Aug 20, 2017

After some further debugging, found out that the temperature sensor is actually missing or broken on my Dell server:

  • Broken:
    broken_

  • Working:
    working

I've added something to the code starting from 568 - 570 to avoid the exception and provide the complete output:

elif self.hardware[2] == 'Sensor':
    if (tmp[key][stat_t] == '"System Board Inlet Temp"'):
        # print("WARNING: System Board Inlet Temp can not be processed. Will set it to 0!")
        tmp[key][stat_t] = "0"
    tmp[key][stat_t] = float(tmp[key][stat_t].strip('(!)'))/10

The rest of the script will take care to exit in WARNING state and will now report all info. It's a quick and dirty workaround which might should be changed to something else ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant