Skip to content

Host

create_host

create_host <HOSTNAME_OR_IP> [OPTIONS]

Create a host.

Always adds the host to the default host group unless --no-default-hostgroup is specified.

Selects a random proxy by default unless --proxy - is specified.

Arguments

HOSTNAME_OR_IP
Hostname or IP
Type: text
Required:

Options

--hostgroup <HOSTGROUPS>
Hostgroup name(s) or ID(s). Comma-separated.
Type: text

--proxy <PROXY>
Proxy server used to monitor the host. Supports regular expressions.
Type: text
Default: .+

--status <STATUS>
Host monitoring status.
Type: choice
Choices: on, off, 0, 1
Default: on

--default-hostgroup/--no-default-hostgroup
Add host to default host group(s) defined in config.
Type: boolean
Default: True

--name <NAME>
Visible name of the host. Uses hostname or IP if omitted.
Type: text

--description <DESCRIPTION>
Description of the host.
Type: text


remove_host

remove_host <HOSTNAME>

Delete a host.

Arguments

HOSTNAME
Name of host to remove.
Type: text
Required:


show_host

show_host <HOSTNAME_OR_ID> [OPTIONS]

Show a specific host.

Arguments

HOSTNAME_OR_ID
Hostname or ID.
Type: text
Required:

Options

--active <ACTIVE>
Active interface availability.
Type: choice
Choices: unknown, available, unavailable, 0, 1, 2

--maintenance/--no-maintenance
Maintenance status.
Type: boolean

--monitored/--no-monitored
Monitoring status.
Type: boolean


show_hosts

show_hosts <HOSTNAME_OR_ID> [OPTIONS]

Show all hosts.

Hosts can be filtered by agent, monitoring and maintenance status. Hosts are sorted by name.

Examples

Show all monitored (enabled) hosts

show_hosts --monitored

Show all hosts with names ending in '.example.com'

show_hosts '*.example.com'

Show all hosts with names ending in '.example.com' or '.example.net'

show_hosts '*.example.com,*.example.net'

Show all hosts with names ending in '.example.com' or '.example.net'

show_hosts '*.example.com,*.example.net'

Show all hosts from a given hostgroup

show_hosts --hostgroup 'Linux servers'

Arguments

HOSTNAME_OR_ID
Hostname pattern or ID to filter by. Comma-separated. Supports wildcards.
Type: text

Options

--hostgroup <HOSTGROUP>
Hostgroup name(s) or ID(s). Comma-separated.
Type: text

--active <ACTIVE>
Active interface availability.
Type: choice
Choices: unknown, available, unavailable, 0, 1, 2

--maintenance/--no-maintenance
Maintenance status.
Type: boolean

--monitored/--unmonitored
Monitoring status.
Type: boolean

--limit, -n <LIMIT>
Limit the number of results. 0 to show all.
Type: integer
Default: 0


update_host

update_host <HOSTNAME_OR_IP> [OPTIONS]

Update basic information about a host.

Other notable commands to update a host:

  • add_host_to_hostgroup
  • create_host_interface
  • monitor_host
  • remove_host_from_hostgroup
  • update_host_interface
  • update_host_inventory

Arguments

HOSTNAME_OR_IP
Hostname or IP
Type: text
Required:

Options

--name <NAME>
Visible name of the host.
Type: text

--description <DESCRIPTION>
Description of the host.
Type: text