Project

General

Profile

Actions

Bug #6711

closed

Hostname in inventory may sometimes be wrongfully in lowercase

Added by Nicolas CHARLES almost 9 years ago. Updated over 8 years ago.

Status:
Released
Priority:
N/A
Category:
Web - Nodes & inventories
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:

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 1 (0 open1 closed)

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

Related issues 4 (0 open4 closed)

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
Actions #1

Updated by Nicolas CHARLES almost 9 years ago

another solution could be to use hostname in fusioninventory inventory

Actions #2

Updated by Nicolas CHARLES almost 9 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

Actions #3

Updated by Nicolas CHARLES almost 9 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 )

Actions #4

Updated by Nicolas CHARLES almost 9 years ago

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

Actions #5

Updated by Nicolas CHARLES almost 9 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

Actions #6

Updated by Vincent MEMBRÉ almost 9 years ago

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

Updated by Nicolas CHARLES almost 9 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

Actions #8

Updated by Nicolas CHARLES almost 9 years ago

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

Updated by Nicolas CHARLES almost 9 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

Actions #10

Updated by Nicolas CHARLES almost 9 years ago

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

Updated by Alexis Mousset almost 9 years ago

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

Updated by Vincent MEMBRÉ over 8 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.

Actions #14

Updated by Nicolas CHARLES over 8 years ago

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

Updated by Nicolas CHARLES over 8 years ago

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

Updated by Nicolas CHARLES over 8 years ago

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

Also available in: Atom PDF