Additional support packet values (#22441)
* Added system console metrics and renamed database fields * Added job data * Added migration data
Этот коммит содержится в:
@@ -71,32 +71,67 @@ func (a *App) generateSupportPacketYaml() (*model.FileData, string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Here we are getting information regarding the database (mysql/postgres + current schema version)
|
// Here we are getting information regarding the database (mysql/postgres + current schema version)
|
||||||
databaseType, databaseVersion := a.Srv().DatabaseTypeAndSchemaVersion()
|
databaseType, databaseSchemaVersion := a.Srv().DatabaseTypeAndSchemaVersion()
|
||||||
|
|
||||||
|
databaseVersion, _ := a.Srv().Store().GetDbVersion(false)
|
||||||
|
|
||||||
uniqueUserCount, err := a.Srv().Store().User().Count(model.UserCountOptions{})
|
uniqueUserCount, err := a.Srv().Store().User().Count(model.UserCountOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "error while getting user count").Error()
|
return nil, errors.Wrap(err, "error while getting user count").Error()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
analytics, err := a.GetAnalytics("standard", "")
|
||||||
|
if analytics == nil {
|
||||||
|
return nil, errors.Wrap(err, "error while getting analytics").Error()
|
||||||
|
}
|
||||||
|
|
||||||
|
elasticPostIndexing, _ := a.Srv().Store().Job().GetAllByTypePage("elasticsearch_post_indexing", 0, 2)
|
||||||
|
elasticPostAggregation, _ := a.Srv().Store().Job().GetAllByTypePage("elasticsearch_post_aggregation", 0, 2)
|
||||||
|
ldapSyncJobs, _ := a.Srv().Store().Job().GetAllByTypePage("ldap_sync", 0, 2)
|
||||||
|
messageExport, _ := a.Srv().Store().Job().GetAllByTypePage("message_export", 0, 2)
|
||||||
|
dataRetentionJobs, _ := a.Srv().Store().Job().GetAllByTypePage("data_retention", 0, 2)
|
||||||
|
complianceJobs, _ := a.Srv().Store().Job().GetAllByTypePage("compliance", 0, 2)
|
||||||
|
migrationJobs, _ := a.Srv().Store().Job().GetAllByTypePage("migrations", 0, 2)
|
||||||
|
|
||||||
|
licenseTo := ""
|
||||||
supportedUsers := 0
|
supportedUsers := 0
|
||||||
if license := a.Srv().License(); license != nil {
|
if license := a.Srv().License(); license != nil {
|
||||||
supportedUsers = *license.Features.Users
|
supportedUsers = *license.Features.Users
|
||||||
|
licenseTo = license.Customer.Company
|
||||||
}
|
}
|
||||||
|
|
||||||
// Creating the struct for support packet yaml file
|
// Creating the struct for support packet yaml file
|
||||||
supportPacket := model.SupportPacket{
|
supportPacket := model.SupportPacket{
|
||||||
ServerOS: runtime.GOOS,
|
LicenseTo: licenseTo,
|
||||||
ServerArchitecture: runtime.GOARCH,
|
ServerOS: runtime.GOOS,
|
||||||
ServerVersion: model.CurrentVersion,
|
ServerArchitecture: runtime.GOARCH,
|
||||||
BuildHash: model.BuildHash,
|
ServerVersion: model.CurrentVersion,
|
||||||
DatabaseType: databaseType,
|
BuildHash: model.BuildHash,
|
||||||
DatabaseVersion: databaseVersion,
|
DatabaseType: databaseType,
|
||||||
LdapVendorName: vendorName,
|
DatabaseVersion: databaseVersion,
|
||||||
LdapVendorVersion: vendorVersion,
|
DatabaseSchemaVersion: databaseSchemaVersion,
|
||||||
ElasticServerVersion: elasticServerVersion,
|
LdapVendorName: vendorName,
|
||||||
ElasticServerPlugins: elasticServerPlugins,
|
LdapVendorVersion: vendorVersion,
|
||||||
ActiveUsers: int(uniqueUserCount),
|
ElasticServerVersion: elasticServerVersion,
|
||||||
LicenseSupportedUsers: supportedUsers,
|
ElasticServerPlugins: elasticServerPlugins,
|
||||||
|
ActiveUsers: int(uniqueUserCount),
|
||||||
|
LicenseSupportedUsers: supportedUsers,
|
||||||
|
TotalChannels: int(analytics[0].Value) + int(analytics[1].Value),
|
||||||
|
TotalPosts: int(analytics[2].Value),
|
||||||
|
TotalTeams: int(analytics[4].Value),
|
||||||
|
WebsocketConnections: int(analytics[5].Value),
|
||||||
|
MasterDbConnections: int(analytics[6].Value),
|
||||||
|
ReplicaDbConnections: int(analytics[7].Value),
|
||||||
|
DailyActiveUsers: int(analytics[8].Value),
|
||||||
|
MonthlyActiveUsers: int(analytics[9].Value),
|
||||||
|
InactiveUserCount: int(analytics[10].Value),
|
||||||
|
ElasticPostIndexingJobs: elasticPostIndexing,
|
||||||
|
ElasticPostAggregationJobs: elasticPostAggregation,
|
||||||
|
LdapSyncJobs: ldapSyncJobs,
|
||||||
|
MessageExportJobs: messageExport,
|
||||||
|
DataRetentionJobs: dataRetentionJobs,
|
||||||
|
ComplianceJobs: complianceJobs,
|
||||||
|
MigrationJobs: migrationJobs,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Marshal to a Yaml File
|
// Marshal to a Yaml File
|
||||||
|
|||||||
@@ -76,18 +76,36 @@ type ServerBusyState struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type SupportPacket struct {
|
type SupportPacket struct {
|
||||||
ServerOS string `yaml:"server_os"`
|
LicenseTo string `yaml:"license_to"`
|
||||||
ServerArchitecture string `yaml:"server_architecture"`
|
ServerOS string `yaml:"server_os"`
|
||||||
ServerVersion string `yaml:"server_version"`
|
ServerArchitecture string `yaml:"server_architecture"`
|
||||||
BuildHash string `yaml:"build_hash,omitempty"`
|
ServerVersion string `yaml:"server_version"`
|
||||||
DatabaseType string `yaml:"database_type"`
|
BuildHash string `yaml:"build_hash,omitempty"`
|
||||||
DatabaseVersion string `yaml:"database_version"`
|
DatabaseType string `yaml:"database_type"`
|
||||||
LdapVendorName string `yaml:"ldap_vendor_name,omitempty"`
|
DatabaseVersion string `yaml:"database_version"`
|
||||||
LdapVendorVersion string `yaml:"ldap_vendor_version,omitempty"`
|
DatabaseSchemaVersion string `yaml:"database_schema_version"`
|
||||||
ElasticServerVersion string `yaml:"elastic_server_version,omitempty"`
|
LdapVendorName string `yaml:"ldap_vendor_name,omitempty"`
|
||||||
ElasticServerPlugins []string `yaml:"elastic_server_plugins,omitempty"`
|
LdapVendorVersion string `yaml:"ldap_vendor_version,omitempty"`
|
||||||
ActiveUsers int `yaml:"active_users"`
|
ElasticServerVersion string `yaml:"elastic_server_version,omitempty"`
|
||||||
LicenseSupportedUsers int `yaml:"license_supported_users,omitempty"`
|
ElasticServerPlugins []string `yaml:"elastic_server_plugins,omitempty"`
|
||||||
|
ActiveUsers int `yaml:"active_users"`
|
||||||
|
LicenseSupportedUsers int `yaml:"license_supported_users,omitempty"`
|
||||||
|
TotalChannels int `yaml:"total_channels"`
|
||||||
|
TotalPosts int `yaml:"total_posts"`
|
||||||
|
TotalTeams int `yaml:"total_teams"`
|
||||||
|
DailyActiveUsers int `yaml:"daily_active_users"`
|
||||||
|
MonthlyActiveUsers int `yaml:"monthly_active_users"`
|
||||||
|
WebsocketConnections int `yaml:"websocket_connections"`
|
||||||
|
MasterDbConnections int `yaml:"master_db_connections"`
|
||||||
|
ReplicaDbConnections int `yaml:"read_db_connections"`
|
||||||
|
InactiveUserCount int `yaml:"inactive_user_count"`
|
||||||
|
ElasticPostIndexingJobs []*Job `yaml:"elastic_post_indexing_jobs"`
|
||||||
|
ElasticPostAggregationJobs []*Job `yaml:"elastic_post_aggregation_jobs"`
|
||||||
|
LdapSyncJobs []*Job `yaml:"ldap_sync_jobs"`
|
||||||
|
MessageExportJobs []*Job `yaml:"message_export_jobs"`
|
||||||
|
DataRetentionJobs []*Job `yaml:"data_retention_jobs"`
|
||||||
|
ComplianceJobs []*Job `yaml:"compliance_jobs"`
|
||||||
|
MigrationJobs []*Job `yaml:"migration_jobs"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type FileData struct {
|
type FileData struct {
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user