Hostname

Combiner for hostname information. It uses the results of all the Hostname parsers, Facter and the SystemID parser to get the fqdn, hostname and domain information.

class insights.combiners.hostname.Hostname(hf, hd, hs, ft, sid)[source]

Bases: object

Check hostname, facter and systemid to get the fqdn, hostname and domain.

Prefer hostname to facter and systemid.

Examples

>>> type(hostname)
<class 'insights.combiners.hostname.Hostname'>
>>> hostname.fqdn
'rhel7.example.com'
>>> hostname.hostname
'rhel7'
>>> hostname.domain
'example.com'
Raises

Exception -- If no hostname can be found in any of the source parsers.

insights.combiners.hostname.hostname(hf, hd, hs, ft, sid)[source]

Warning

This combiner methode is deprecated, please use insights.combiners.hostname.Hostname instead.

Check hostname, facter and systemid to get the fqdn, hostname and domain.

Prefer hostname to facter and systemid.

Examples

>>> hn.fqdn
'rhel7.example.com'
>>> hn.hostname
'rhel7'
>>> hn.domain
'example.com'
Returns

A class with fqdn, hostname and domain attributes.

Return type

insights.combiners.hostname.Hostname

Raises

Exception -- If no hostname can be found in any of the source parsers.