@@ -27,10 +27,6 @@ import (
2727
2828// ThrowNewDatabaseAlert create and insert in the database a new NEW_DATABASE alert
2929func (hds * HostDataService ) throwNewDatabaseAlert (dbname string , hostname string ) error {
30- if ! hds .Config .AlertService .Emailer .AlertType .NewDatabase {
31- return nil
32- }
33-
3430 alr := model.Alert {
3531 ID : primitive .NewObjectIDFromTimestamp (hds .TimeNow ()),
3632 AlertAffectedTechnology : model .TechnologyOracleDatabasePtr ,
@@ -51,10 +47,6 @@ func (hds *HostDataService) throwNewDatabaseAlert(dbname string, hostname string
5147
5248// ThrowNewServerAlert create and insert in the database a new NEW_SERVER alert
5349func (hds * HostDataService ) throwNewServerAlert (hostname string ) error {
54- if ! hds .Config .AlertService .Emailer .AlertType .NewHost {
55- return nil
56- }
57-
5850 alr := model.Alert {
5951 ID : primitive .NewObjectIDFromTimestamp (hds .TimeNow ()),
6052 AlertAffectedTechnology : nil ,
@@ -101,10 +93,6 @@ func (hds *HostDataService) createNewLicenseAlert(hostname, dbname string, licen
10193
10294// ThrowNewEnterpriseLicenseAlert create and insert in the database a new NEW_LICENSE alert
10395func (hds * HostDataService ) throwNewLicenseAlert (alerts []model.Alert ) error {
104- if ! hds .Config .AlertService .Emailer .AlertType .NewLicense {
105- return nil
106- }
107-
10896 if len (alerts ) == 0 {
10997 return nil
11098 }
@@ -153,10 +141,6 @@ func (hds *HostDataService) throwNewLicenseAlert(alerts []model.Alert) error {
153141}
154142
155143func (hds * HostDataService ) throwNewOptionAlerts (alerts []model.Alert ) error {
156- if ! hds .Config .AlertService .Emailer .AlertType .NewOption {
157- return nil
158- }
159-
160144 if len (alerts ) == 0 {
161145 return nil
162146 }
@@ -198,10 +182,6 @@ func (hds *HostDataService) throwNewOptionAlerts(alerts []model.Alert) error {
198182
199183// ThrowUnlistedRunningDatabasesAlert create and insert in the database a new UNLISTED_RUNNING_DATABASE alert
200184func (hds * HostDataService ) throwUnlistedRunningDatabasesAlert (alerts []model.Alert ) error {
201- if ! hds .Config .AlertService .Emailer .AlertType .NewUnlistedRunningDatabase {
202- return nil
203- }
204-
205185 if len (alerts ) == 0 {
206186 return nil
207187 }
@@ -248,10 +228,6 @@ func (hds *HostDataService) throwUnlistedRunningDatabasesAlert(alerts []model.Al
248228}
249229
250230func (hds * HostDataService ) throwAugmentedCPUCoresAlert (hostname string , previousCPUCores , newCPUCores int ) error {
251- if ! hds .Config .AlertService .Emailer .AlertType .NewHostCpu {
252- return nil
253- }
254-
255231 alr := model.Alert {
256232 ID : primitive .NewObjectIDFromTimestamp (hds .TimeNow ()),
257233 AlertAffectedTechnology : nil ,
@@ -271,10 +247,6 @@ func (hds *HostDataService) throwAugmentedCPUCoresAlert(hostname string, previou
271247}
272248
273249func (hds * HostDataService ) throwMissingPrimaryDatabase (hostname , secondaryDbName string ) error {
274- if ! hds .Config .AlertService .Emailer .AlertType .MissingPrimaryDatabase {
275- return nil
276- }
277-
278250 alert := model.Alert {
279251 AlertCategory : model .AlertCategoryEngine ,
280252 AlertAffectedTechnology : nil ,
@@ -293,10 +265,6 @@ func (hds *HostDataService) throwMissingPrimaryDatabase(hostname, secondaryDbNam
293265}
294266
295267func (hds * HostDataService ) throwAgentErrorsAlert (hostname string , errs []model.AgentError ) error {
296- if ! hds .Config .AlertService .Emailer .AlertType .AgentError {
297- return nil
298- }
299-
300268 b := strings.Builder {}
301269 prefix := ""
302270
@@ -330,10 +298,6 @@ func (hds *HostDataService) throwAgentErrorsAlert(hostname string, errs []model.
330298const dbNamesOtherInfo = "dbNames"
331299
332300func (hds * HostDataService ) throwMissingDatabasesAlert (hostname string , dbNames []string , alertSeverity string ) error {
333- if ! hds .Config .AlertService .Emailer .AlertType .MissingDatabase {
334- return nil
335- }
336-
337301 sort .Strings (dbNames )
338302 description := fmt .Sprintf ("The databases %q on %q are missing compared to the previous hostdata" ,
339303 strings .Join (dbNames , ", " ), hostname )
0 commit comments