Project

General

Profile

Bug #6711

Hostname in inventory may sometimes be wrongfully in lowercase

Added by Nicolas CHARLES over 5 years ago. Updated over 5 years ago.

Status:
Released
Priority:
N/A
Category:
Web - Nodes & inventories
Target version:
Severity:
User visibility:
Effort required:
Priority:

Description

On some systems (especially AIX), the hostname in the inventory is always on lowercase; which is wrong
Command

/opt/rudder/bin/rudder-perl -e "use Sys::Hostname; print Sys::Hostname::hostname();" 

returns the proper hostname, while sys.fqhost returns an hostname with invalid case

We should use the perl approch, when available (not on Android then) for the hostname


Subtasks

Bug #6744: Modify technique to remove manually added HOSTNAME in inventoryReleasedMatthieu CERDA2015-06-11Actions

Related issues

Related to Rudder - Bug #6782: Broken inventory - missing 'FQDN'ReleasedFrançois ARMAND2015-06-23Actions
Related to Rudder - Bug #7001: If domain name is not set in resolv.conf, the inventory generated is invalidReleasedVincent MEMBRÉ2015-07-21Actions
Related to Rudder - Bug #7015: Some inventories have empty FQDN attribute, mandatory in 3.1ReleasedFrançois ARMAND2015-07-21Actions
Related to Rudder - Bug #7031: Inventory <FQDN> content differs from hostname --fqdn and may lead to unauthorised nodesReleasedJonathan CLARKE2015-12-08Actions
#1

Updated by Nicolas CHARLES over 5 years ago

another solution could be to use hostname in fusioninventory inventory

#2

Updated by Nicolas CHARLES over 5 years ago

  • Assignee set to François ARMAND
  • Target version changed from 2.11.12 to 3.1.0~rc1

this change is too big to go to 2.11, but it would go in 3.1: it is safer to use reliable hostname from fusion inventory

#3

Updated by Nicolas CHARLES over 5 years ago

Oh ... the Rudder extension in Fusion inventory contains the hostname (but it is only on linux)

In OPERATINGSYSTEM/FQDN we have the fqdn of the node, which exists on AIX, Windows, and is correctly filled (using http://search.cpan.org/~gbarr/libnet-1.22/Net/Domain.pm )

#4

Updated by Nicolas CHARLES over 5 years ago

according to fusioninventory team, HARDWARE/NAME should be the right one

#5

Updated by Nicolas CHARLES over 5 years ago

OPERATINGSYSTEM/FQD should have the correct content

However, i'm puzzled by current parsing:
we parse the inventory, and if we have HARDWARE/NAME, we set the node name to this value
then if we have Rudder expansion, we parse them, and use RUDDER/HOSTNAME

the deprecated HOSTNAME seems to be never used

#6

Updated by Vincent MEMBRÉ over 5 years ago

  • Status changed from New to In progress
  • Assignee changed from François ARMAND to Vincent MEMBRÉ
#7

Updated by Nicolas CHARLES over 5 years ago

  • Assignee changed from Vincent MEMBRÉ to François ARMAND

Ha, Vincent gave me some more info on this point:
- OS/NAME is not used as the hostname, but as the node.name (tricky...)
- Main value for hostname is RUDDER/HOSTNAME.
- If RUDDER/HOSTNAME doesn't exist, then we use HOSTNAME

HOSTNAME is always lowercase, while RUDDER/HOSTNAME has the proper case

What we want: something consistent
OPERATINGSYSTEM/FQDN is always consistent (proper case with the proper fqdn)
RUDDER/HOSTNAME has the proper case (but without the domain name always, as it uses hostname --fqd that may work per chance (as the proper attribute is --fqdn))
HOSTNAME is always lowercase, and may, or may not, have the domain name
HARDWARE/NAME has the proper case, but without the domain name

So, we should pick OPERATINGSYSTEM/FQDN if available, if not RUDDER/HOSTNAME, if not HARDWARE/NAME

#8

Updated by Nicolas CHARLES over 5 years ago

  • Status changed from In progress to Pending technical review
  • Pull Request set to https://github.com/Normation/ldap-inventory/pull/66/files
#9

Updated by Nicolas CHARLES over 5 years ago

Ok, for sanity, we only pick OPERATINGSYSTEM/FQDN
So that we are ensuring consistency of value, it is easier, less error prone, and this value exists since in along time in fusion

#10

Updated by Nicolas CHARLES over 5 years ago

  • Status changed from Pending technical review to Pending release
  • % Done changed from 0 to 100
#12

Updated by Alexis MOUSSET over 5 years ago

  • Related to Bug #6782: Broken inventory - missing 'FQDN' added
#13

Updated by Vincent MEMBRÉ over 5 years ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 3.1.0~rc1 which was released on the 16th June 2015.

#14

Updated by Nicolas CHARLES over 5 years ago

  • Related to Bug #7001: If domain name is not set in resolv.conf, the inventory generated is invalid added
#15

Updated by Nicolas CHARLES over 5 years ago

  • Related to Bug #7015: Some inventories have empty FQDN attribute, mandatory in 3.1 added
#16

Updated by Nicolas CHARLES over 5 years ago

  • Related to Bug #7031: Inventory <FQDN> content differs from hostname --fqdn and may lead to unauthorised nodes added

Also available in: Atom PDF