bugGNU FreeIPMI - Bugs: bug #64824, Can't collect data with hostname...


bug #64824: Can't collect data with hostname is more 64 chara

Submitter:  jeremy planckeel <jplanckeel>
Submitted:  Fri 27 Oct 2023 07:54:13 AM UTC
Category:  ipmi-sensors-config Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Improper Behaviour
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open
Operating System:  GNU/Linux
* Mandatory Fields

Add a New Comment Rich Markup

Sun 17 Dec 2023 09:31:16 PM UTC, comment #2: 

I got an experimental branch with a fix


git clone https://github.com/chu11/freeipmi-mirror.git
git checkout freeipmi-1-6-0-stable-maxhostnamelen_increase
cd ipmi-sensors (or whatever tool you want to test with)
./ipmi-sensors -h REALLYLONGHOSTNAME ...

PLMK if it works for you, thanks!

Albert Chu <chu11>
Group administrator
Sun 19 Nov 2023 08:30:23 PM UTC, comment #1: 

(sorry for late response, was on leave)

Googling around, I guess the issue has been that gethostname() (on almost all systems) returns a max of 64 bytes (it's a linux kernel definition), so most people use MAXHOSTNAMELEN as their "max hostname" buffer size (which I did here).

But technically, that need not be the case, as when you input a hostname on the command line, that's not related to gethostname() at all.

I agree on a fix, but it will take a little time to peel MAXHOSTNAMELEN away and ensure things are portable (b/c MAXHOSTNAMELEN is defined in headers on most systems).

Albert Chu <chu11>
Group administrator
Fri 27 Oct 2023 07:54:13 AM UTC, original submission:  


We have a a problem when we use FreeIPMI, when we specified a hostname with more 64 characters, freeipmi can't collect data.

We use FreeIPMI with ipmi-exporter project. https://github.com/prometheus-community/ipmi_exporter

Can we grow to 126 the var MAXHOSTNAMELEN in code ? or add var to grow this params ?

{"level":"error","msg":"Failed to collect ipmimonitoring data from host.name.example: exit status 1","source":"collector.go:376","time":"2020-08-18T13:11:02Z"}

jeremy planckeel <jplanckeel>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by chu11 (Posted a comment)
  • -email is unavailable- added by jplanckeel (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.


    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code