---
name: "App::ClusterSSH::Host"
section: "3pm"
platform: "linux"
package: "clusterssh"
version: "4.18-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/App::ClusterSSH::Host"
---

# App::ClusterSSH::Host(3pm)

## SYNOPSIS

```
    use ClusterSSH::Host;
    my $host = ClusterSSH::Host->new({
        hostname => 'hostname',
    });
    my $host = ClusterSSH::Host->parse_host_string('username@hostname:1234');
```

## DESCRIPTION

Object representing a host.  Include details to contact the host such as hostname/ipaddress, username and port.

## METHODS

- $host=ClusterSSH::Host-\>new ({ hostname =\> 'hostname' })

  Create a new host object.  'hostname' is a required arg, 'username' and  'port' are optional.  Raises exception if an error occurs.

- $host-\>get\_hostname

  - $host-\>get\_username

  - $host-\>get\_port

  - $host-\>get\_master

  - $host-\>get\_geometry

  - $host-\>get\_type

  Return specific details about the host

- $host-\>set\_username

  - $host-\>set\_port

  - $host-\>set\_master

  - $host-\>set\_geometry

  - $host-\>set\_type

  Set specific details about the host after its been created.

- get\_realname

  If the server name provided is not an IP address (either IPv4 or IPv6)  attempt to resolve it and return the discovered names.

- get\_givenname

  Alias to get\_hostname, for use when `" get_realname "` might return something different

- parse\_host\_string

  Given a host string, returns a host object.  Parses hosts such as

- check\_ssh\_hostname

  Check the objects hostname to see whether or not it may be configured within  the users  *$HOME/.ssh/config*  configuration file

- read\_ssh\_file

  Method to ease reading in ssh configuration files.  Used for grabbing hostnames for validation when used in clusters

  - host

    - 192\.168.0.1

    - user@host

    - user@192.168.0.1

    - host:port

    - \[1234:1234:1234::4567\]:port

    - 1234:1234:1234::4567

    and so on.  Cope with IPv4 and IPv6 addresses - raises a warning if the IPv6 address is ambiguous (i.e. in the last example, is the 4567 part of the IPv6 address or a port definition?) and assumes it is part of address. Use brackets to avoid seeing warning.
