java.lang.Object
com.aoindustries.aoserv.client.AoservObject<Integer,Server>
com.aoindustries.aoserv.client.CachedObject<Integer,Server>
com.aoindustries.aoserv.client.CachedObjectIntegerKey<Server>
com.aoindustries.aoserv.client.linux.Server
- All Implemented Interfaces:
Streamable
,StreamReadable
,StreamWritable
,Row
,DtoFactory<LinuxServer>
,AoservReadable
,AoservStreamable
,AoservWritable
,SingleTableObject<Integer,
Server>
A
Server
stores the details about a server that runs the AOServ distribution.- Author:
- AO Industries, Inc.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
static class
static class
static class
The results of the most recent weekly RAID check.static enum
-
Field Summary
Fields inherited from class com.aoindustries.aoserv.client.CachedObjectIntegerKey
pkey
Fields inherited from class com.aoindustries.aoserv.client.CachedObject
table
Fields inherited from class com.aoindustries.aoserv.client.AoservObject
USE_ARRAY_OF_DOMAIN, USE_SQL_DATA, USE_SQL_DATA_WRITE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
addCvsRepository
(PosixPath path, UserServer lsa, GroupServer lsg, long mode) int
addEmailDomain
(DomainName domain, Package packageObject) int
addEmailPipe
(String command, Package packageObject) int
addHttpdJbossSite
(String siteName, Package packageObj, User siteUser, Group siteGroup, Email serverAdmin, boolean useApache, IpAddress ipAddress, DomainName primaryHttpHostname, DomainName[] altHttpHostnames, Version jbossVersion) int
addHttpdSharedTomcat
(String name, Version version, UserServer lsa, GroupServer lsg) int
addHttpdTomcatSharedSite
(String siteName, Package packageObj, User siteUser, Group siteGroup, Email serverAdmin, boolean useApache, IpAddress ipAddress, DomainName primaryHttpHostname, DomainName[] altHttpHostnames, String sharedTomcatName) int
addHttpdTomcatStdSite
(String siteName, Package packageObj, User jvmUser, Group jvmGroup, Email serverAdmin, boolean useApache, IpAddress ipAddress, DomainName primaryHttpHostname, DomainName[] altHttpHostnames, Version tomcatVersion) int
addSystemGroup
(Group.Name groupName, int gid) Adds a new system group.int
addSystemUser
(User.Name username, int uid, int gid, User.Gecos fullName, User.Gecos officeLocation, User.Gecos officePhone, User.Gecos homePhone, PosixPath home, PosixPath shell) Adds a new system user.checkPort
(InetAddress ipAddress, Port port, String appProtocol, URIParameters monitoringParameters) Checks a port from the daemon's point of view.checkSmtpBlacklist
(InetAddress sourceIp, InetAddress connectIp) Gets the status line of a SMTP server from the server from the provided source IP.Gets the 3ware RAID report.protected Object
getColumnImpl
(int i) getCvsRepository
(PosixPath path) Gets the port information to bind to.Gets the address that should be connected to in order to reach this server.Gets the port information to connect to.int
Gets the DRBD report.getDto()
getEmailDomain
(DomainName domain) getEmailList
(PosixPath path) Rename to getEmailList when all uses updated.getEmailSmtpRelay
(Package pk, HostAddress host) Gets all of the smtp relays settings that apply to either all servers or this server specifically.int
Gets the number of filesystem entries sent per batch during failover replications.Deprecated.UsegetFilesystemsCsvReport()
instead to let the API parse the report.Gets the max value for automatic gid selection in groupadd.Gets the min value for automatic gid selection in groupadd.Gets the model of each hard drive on the server.Gets the hard drive temperature report.getHost()
Gets the unique, fully-qualified hostname for this server.getHttpdSharedTomcat
(String jvmName) getHttpdSite
(String siteName) Gets the last value for automatic gid selection in groupadd, if any.Gets the last value for automatic uid selection in useradd, if any.getLinuxServerAccount
(User.Name username) getLinuxServerGroup
(Group.Name groupName) Gets the output of/proc/loadavg
.Gets the LVM report.Gets the MD mismatch report.Gets the/proc/mdstat
report.Gets the output of/proc/meminfo
.float
Gets the 5-minute load average that is considered a critical-priority alert orNaN
if no alert allowed at this level.float
Gets the 5-minute load average that is considered a high-priority alert orNaN
if no alert allowed at this level.float
Gets the 5-minute load average that is considered a low-priority alert orNaN
if no alert allowed at this level.float
Gets the 5-minute load average that is considered a medium-priority alert orNaN
if no alert allowed at this level.void
getMrtgFile
(String filename, OutputStream out) getMysqlServer
(Server.Name name) int
getPostgresServer
(Server.Name name) boolean
int
long
Gets the optional umask for the sftp-server or-1
for none.long
Gets the current system time in milliseconds.Gets the max value for automatic uid selection in useradd.Gets the min value for automatic uid selection in useradd.Gets UPS status report.void
Initializes this object from the raw database contents.boolean
isEmailDomainAvailable
(DomainName domain) boolean
isHomeUsed
(PosixPath directory) boolean
boolean
static List
<Server.DrbdReport> parseDrbdReport
(String drbdReport) Parses a DRBD report.static List
<Server.MdMismatchReport> parseMdMismatchReport
(String mismatchReport) Parses a MD mismatch report.void
read
(StreamableInput in, AoservProtocol.Version protocolVersion) void
void
void
void
void
setLastDistroTime
(Timestamp distroTime) void
void
void
startDistro
(boolean includeUser) void
startXfs()
void
void
void
stopCron()
void
stopXfs()
void
stopXvfb()
AoservObject.toString()
implementation that is allowed to throw exceptions.void
void
void
void
void
void
void
void
void
void
write
(StreamableOutput out, AoservProtocol.Version protocolVersion) Methods inherited from class com.aoindustries.aoserv.client.CachedObjectIntegerKey
equals, getKey, getPkey, hashCode
Methods inherited from class com.aoindustries.aoserv.client.CachedObject
getTable, setTable
Methods inherited from class com.aoindustries.aoserv.client.AoservObject
compare, compare, compare, compare, compareIgnoreCaseConsistentWithEquals, compareTo, compareTo, compareTo, getAccountingCode, getColumn, getColumns, getColumns, getDomainLabel, getDomainLabels, getDomainName, getDto, getEmail, getGecos, getGroupId, getHashedKey, getHashedPassword, getHostname, getInetAddress, getLinuxId, getLinuxUserName, getMacAddress, getMysqlDatabaseName, getMysqlServerName, getMysqlUserName, getPort, getPostgresDatabaseName, getPostgresServerName, getPostgresUserId, getTableSchema, getTimeMillis, getTimeMillis, getUnixPath, getUserId, read, toString, write
-
Field Details
-
COLUMN_HOSTNAME_name
- See Also:
-
-
Constructor Details
-
Server
Deprecated.Only required for implementation, do not use directly.- See Also:
-
-
Method Details
-
getColumnImpl
- Specified by:
getColumnImpl
in classAoservObject<Integer,
Server>
-
getServer_pkey
public int getServer_pkey() -
getHost
- Throws:
SQLException
IOException
-
getHostname
Gets the unique, fully-qualified hostname for this server. Should be resolvable in DNS to ease maintenance. -
getDaemonBind_id
-
getDaemonBind
Gets the port information to bind to.- Throws:
IOException
SQLException
-
getPoolSize
public int getPoolSize() -
getDistroHour
public int getDistroHour() -
getLastDistroTime
-
getFailoverServer_server_pkey
-
getFailoverServer
- Throws:
SQLException
IOException
-
getDaemonDeviceId_name
-
getDaemonDeviceId
- Throws:
SQLException
IOException
-
getDaemonConnectBind_id
-
getDaemonConnectBind
Gets the port information to connect to.- Throws:
IOException
SQLException
-
getTimeZone_name
-
getTimeZone
- Throws:
SQLException
IOException
-
getJilterBind_id
-
getJilterBind
- Throws:
IOException
SQLException
-
getRestrictOutboundEmail
public boolean getRestrictOutboundEmail() -
getDaemonConnectAddress
Gets the address that should be connected to in order to reach this server. This overrides both getDaemonConnectBind and getDaemonBind.- See Also:
-
getFailoverBatchSize
public int getFailoverBatchSize()Gets the number of filesystem entries sent per batch during failover replications. -
getMonitoringLoadLow
public float getMonitoringLoadLow()Gets the 5-minute load average that is considered a low-priority alert orNaN
if no alert allowed at this level. -
getMonitoringLoadMedium
public float getMonitoringLoadMedium()Gets the 5-minute load average that is considered a medium-priority alert orNaN
if no alert allowed at this level. -
getMonitoringLoadHigh
public float getMonitoringLoadHigh()Gets the 5-minute load average that is considered a high-priority alert orNaN
if no alert allowed at this level. -
getMonitoringLoadCritical
public float getMonitoringLoadCritical()Gets the 5-minute load average that is considered a critical-priority alert orNaN
if no alert allowed at this level. This is the level that will alert people 24x7. -
getUidMin
Gets the min value for automatic uid selection in useradd. -
getGidMin
Gets the min value for automatic gid selection in groupadd. -
getUidMax
Gets the max value for automatic uid selection in useradd. -
getGidMax
Gets the max value for automatic gid selection in groupadd. -
getLastUid
Gets the last value for automatic uid selection in useradd, if any. -
getLastGid
Gets the last value for automatic gid selection in groupadd, if any. -
getSftpUmask
public long getSftpUmask()Gets the optional umask for the sftp-server or-1
for none. -
init
Description copied from class:AoservObject
Initializes this object from the raw database contents.- Specified by:
init
in classAoservObject<Integer,
Server> - Parameters:
result
- theResultSet
containing the row to copy into this object- Throws:
SQLException
-
read
- Specified by:
read
in interfaceAoservReadable
- Specified by:
read
in interfaceAoservStreamable
- Specified by:
read
in classAoservObject<Integer,
Server> - Throws:
IOException
-
write
- Specified by:
write
in interfaceAoservStreamable
- Specified by:
write
in interfaceAoservWritable
- Specified by:
write
in classAoservObject<Integer,
Server> - Throws:
IOException
-
addCvsRepository
public int addCvsRepository(PosixPath path, UserServer lsa, GroupServer lsg, long mode) throws IOException, SQLException - Throws:
IOException
SQLException
-
addEmailDomain
public int addEmailDomain(DomainName domain, Package packageObject) throws SQLException, IOException - Throws:
SQLException
IOException
-
addEmailPipe
- Throws:
IOException
SQLException
-
addHttpdJbossSite
public int addHttpdJbossSite(String siteName, Package packageObj, User siteUser, Group siteGroup, Email serverAdmin, boolean useApache, IpAddress ipAddress, DomainName primaryHttpHostname, DomainName[] altHttpHostnames, Version jbossVersion) throws IOException, SQLException - Throws:
IOException
SQLException
-
addHttpdTomcatStdSite
public int addHttpdTomcatStdSite(String siteName, Package packageObj, User jvmUser, Group jvmGroup, Email serverAdmin, boolean useApache, IpAddress ipAddress, DomainName primaryHttpHostname, DomainName[] altHttpHostnames, Version tomcatVersion) throws IOException, SQLException - Throws:
IOException
SQLException
-
addSystemGroup
Adds a new system group. This is for the AOServ Daemon to register newly installed local system groups, such as those added through routine RPM installation. The master will check that the requested group matches expected settings.- Throws:
IOException
SQLException
-
addSystemUser
public int addSystemUser(User.Name username, int uid, int gid, User.Gecos fullName, User.Gecos officeLocation, User.Gecos officePhone, User.Gecos homePhone, PosixPath home, PosixPath shell) throws IOException, SQLException Adds a new system user. This is for the AOServ Daemon to register newly installed local system users, such as those added through routine RPM installation. The master will check that the requested user matches expected settings.- Throws:
IOException
SQLException
-
getAoserverDaemonHosts
- Throws:
IOException
SQLException
-
getBackupPartitions
- Throws:
IOException
SQLException
-
getBackupPartitionForPath
- Throws:
IOException
SQLException
-
getBlackholeEmailAddresses
- Throws:
IOException
SQLException
-
getCvsRepository
- Throws:
IOException
SQLException
-
getCvsRepositories
- Throws:
IOException
SQLException
-
getDaemonIpAddress
- Throws:
SQLException
IOException
-
getCyrusImapdServer
- Throws:
IOException
SQLException
-
getEmailAddresses
- Throws:
IOException
SQLException
-
getEmailDomain
- Throws:
IOException
SQLException
-
getEmailDomains
- Throws:
IOException
SQLException
-
getEmailForwarding
- Throws:
SQLException
IOException
-
getEmailList
Rename to getEmailList when all uses updated.- Throws:
IOException
SQLException
-
getEmailListAddresses
- Throws:
IOException
SQLException
-
getEmailPipeAddresses
- Throws:
IOException
SQLException
-
getEmailPipes
- Throws:
IOException
SQLException
-
getEmailSmtpRelay
- Throws:
IOException
SQLException
-
getEmailSmtpRelays
Gets all of the smtp relays settings that apply to either all servers or this server specifically.- Throws:
IOException
SQLException
-
getFtpGuestUsers
- Throws:
IOException
SQLException
-
getHttpdServers
- Throws:
IOException
SQLException
-
getHttpdSite
- Throws:
IOException
SQLException
-
getHttpdSites
- Throws:
IOException
SQLException
-
getLinuxAccAddresses
- Throws:
IOException
SQLException
-
getLinuxAccounts
- Throws:
SQLException
IOException
-
getLinuxGroups
- Throws:
SQLException
IOException
-
getLinuxServerAccount
- Throws:
IOException
SQLException
-
getLinuxServerAccount
- Throws:
IOException
SQLException
-
getLinuxServerAccounts
- Throws:
IOException
SQLException
-
getLinuxServerGroup
- Throws:
IOException
SQLException
-
getLinuxServerGroup
- Throws:
IOException
SQLException
-
getLinuxServerGroups
- Throws:
IOException
SQLException
-
getMajordomoServers
- Throws:
IOException
SQLException
-
getMrtgFile
- Throws:
IOException
SQLException
-
getMysqlServer
- Throws:
IOException
SQLException
-
getMysqlServers
- Throws:
IOException
SQLException
-
getPreferredMysqlServer
- Throws:
IOException
SQLException
-
getNestedServers
- Throws:
IOException
SQLException
-
getPostgresServer
- Throws:
IOException
SQLException
-
getPostgresServers
- Throws:
IOException
SQLException
-
getPreferredPostgresServer
- Throws:
SQLException
IOException
-
getPrimaryIpAddress
- Throws:
SQLException
IOException
-
getPrivateFtpServers
- Throws:
IOException
SQLException
-
getSendmailServers
- Throws:
IOException
SQLException
-
getSslCertificates
- Throws:
IOException
SQLException
-
getSystemEmailAliases
- Throws:
IOException
SQLException
-
getTableId
- Specified by:
getTableId
in classAoservObject<Integer,
Server>
-
isEmailDomainAvailable
- Throws:
SQLException
IOException
-
isHomeUsed
- Throws:
IOException
SQLException
-
isMysqlServerNameAvailable
- Throws:
IOException
SQLException
-
isPostgresServerNameAvailable
- Throws:
IOException
SQLException
-
restartApache
- Throws:
IOException
SQLException
-
restartCron
- Throws:
IOException
SQLException
-
restartXfs
- Throws:
IOException
SQLException
-
restartXvfb
- Throws:
IOException
SQLException
-
setLastDistroTime
- Throws:
IOException
SQLException
-
startApache
- Throws:
IOException
SQLException
-
startCron
- Throws:
IOException
SQLException
-
startDistro
- Throws:
IOException
SQLException
-
startXfs
- Throws:
IOException
SQLException
-
startXvfb
- Throws:
IOException
SQLException
-
stopApache
- Throws:
IOException
SQLException
-
stopCron
- Throws:
IOException
SQLException
-
stopXfs
- Throws:
IOException
SQLException
-
stopXvfb
- Throws:
IOException
SQLException
-
toStringImpl
Description copied from class:AoservObject
AoservObject.toString()
implementation that is allowed to throw exceptions.Implementation Note:
This default implementation callsAoservObject.toString()
on the key (fromAoservObject.getKey()
). When the key isnull
, uses the default implementation fromObject.toString()
.- Overrides:
toStringImpl
in classCachedObjectIntegerKey<Server>
-
waitForHttpdSiteRebuild
- Throws:
IOException
SQLException
-
waitForLinuxAccountRebuild
- Throws:
IOException
SQLException
-
waitForMysqlDatabaseRebuild
- Throws:
IOException
SQLException
-
waitForMysqlDbUserRebuild
- Throws:
IOException
SQLException
-
waitForMysqlServerRebuild
- Throws:
IOException
SQLException
-
waitForMysqlUserRebuild
- Throws:
IOException
SQLException
-
waitForPostgresDatabaseRebuild
- Throws:
IOException
SQLException
-
waitForPostgresServerRebuild
- Throws:
IOException
SQLException
-
waitForPostgresUserRebuild
- Throws:
IOException
SQLException
-
get3wareRaidReport
Gets the 3ware RAID report.- Throws:
IOException
SQLException
-
getMdStatReport
Gets the/proc/mdstat
report.- Throws:
IOException
SQLException
-
getMdMismatchReport
public List<Server.MdMismatchReport> getMdMismatchReport() throws IOException, SQLException, ParseExceptionGets the MD mismatch report.- Throws:
IOException
SQLException
ParseException
-
parseMdMismatchReport
public static List<Server.MdMismatchReport> parseMdMismatchReport(String mismatchReport) throws ParseException Parses a MD mismatch report.- Throws:
ParseException
-
getDrbdReport
Gets the DRBD report.- Throws:
IOException
SQLException
ParseException
-
parseDrbdReport
Parses a DRBD report.- Throws:
ParseException
-
getLvmReport
Gets the LVM report.- Throws:
IOException
SQLException
ParseException
-
getHddTempReport
Gets the hard drive temperature report.- Throws:
IOException
SQLException
-
getHddModelReport
Gets the model of each hard drive on the server. The key is the device name and the value is the model name.- Throws:
IOException
SQLException
ParseException
-
getFilesystemsCsvReport
Deprecated.UsegetFilesystemsCsvReport()
instead to let the API parse the report.Gets the filesystem states report.- Throws:
IOException
SQLException
-
getFilesystemsReport
- Throws:
IOException
SQLException
-
getLoadAvgReport
Gets the output of/proc/loadavg
.- Throws:
IOException
SQLException
-
getMemInfoReport
Gets the output of/proc/meminfo
.- Throws:
IOException
SQLException
-
checkPort
public String checkPort(InetAddress ipAddress, Port port, String appProtocol, URIParameters monitoringParameters) throws IOException, SQLException Checks a port from the daemon's point of view. This is required for monitoring of private and loopback IPs.- Throws:
IOException
SQLException
-
getSystemTimeMillis
Gets the current system time in milliseconds.- Throws:
IOException
SQLException
-
getFailoverMysqlReplications
- Throws:
IOException
SQLException
-
checkSmtpBlacklist
public String checkSmtpBlacklist(InetAddress sourceIp, InetAddress connectIp) throws IOException, SQLException Gets the status line of a SMTP server from the server from the provided source IP.- Throws:
IOException
SQLException
-
getUpsStatus
Gets UPS status report.- Throws:
IOException
SQLException
-
getDto
- Specified by:
getDto
in interfaceDtoFactory<LinuxServer>
-