Class Symbiosis::Host
In: common/lib/symbiosis/host.rb
Parent: Object
Array Utmp EventMachine::Connection ApacheLogger StandardError CrontabFormatError Enumerable IPAddr ::IPAddr Host Range Domain ConfigFile Prosody Tinydns Apache Webalizer Directory IPListDirectory TemplateDirectory Domains Alert Crontab CrontabRecord StateDB Check Runner TCPConnection Test Process BlacklistDB Template Logtail Pattern Ports Blacklist Monitor ConfigFiles Utils Firewall Symbiosis dot/f_0.png

This class encompasses functions / data that are set host-wide.

Methods

Constants

BYTEMARK_RANGES = %w(80.68.80.0/20 89.16.160.0/19 212.110.160.0/19 46.43.0.0/18 91.223.58.0/24 213.138.96.0/19 5.153.224.0/21 5.28.56.0/21 2001:41c8::/29).collect{|i| IPAddr.new(i)}
BACKUP_SPACE_FILENAME = "/etc/symbiosis/dns.d/backup.name"

Public Class methods

Add a /32 or /128 to the primary interface.

Returns an array of backup spaces name given the IP addresses of the machine. Returns an empty array if the argument is invalid, or if the argument is not a Bytemark IP. IPv6 capable.

Returns all IP addresses in use by a machine, in the order they were configured on the interfaces, as an array of IPAddr objects.

Returns all global IPv4 addresses in use by a machine, as an array of IPAddr objects.

Returns all global IPv6 addresses in use by a machine, as an array of IPAddr objects.

Returns all IPv6 ranges

Checks to see if an IP is in the Bytemark ranges.

This returns the primary backup space. This is defined as the first in the list returned by backup_spaces OR whatever is contained in a file called /etc/symbiosis/dns.d/backup.name

Returns the primary interface for the machine as an Linux::Netlink::Link object.

We can define the primary interface as the one with the default route.

We match on scope == 0 (RT_SCOPE_UNIVERSE) and type == 1 (RTN_UNICAST) and gateway != nil

Returns the "primary" IP of the machine. This is assumed to be the address with the smallest CIDR prefix. If there is more than one with the same prefix, then we take the first.

Return the primary IPv4 address

Return the primary IPv6 address

[Validate]