d
This commit is contained in:
@@ -32,7 +32,7 @@ tasks:
|
||||
params: WHERE=now()+>+ADDDATE(`date`,+interval+IFNULL((SELECT+`value`+FROM+config+WHERE+config_tag='goldKpiDuration'),7)+day)
|
||||
interval: 1
|
||||
unit: Days
|
||||
at: 18:11:00
|
||||
at: 00:11:00
|
||||
do: TaskDeleteExpiredRecord
|
||||
- name: clear deleted custom pm kpi
|
||||
uri: /api/rest/databaseManagement/v1/omc_db/pm_custom_title
|
||||
@@ -41,6 +41,13 @@ tasks:
|
||||
unit: Days
|
||||
at: 00:15:00
|
||||
do: TaskDeleteExpiredRecord
|
||||
- name: clear expired ne etc backup
|
||||
uri: /api/rest/databaseManagement/v1/omc_db/ne_backup
|
||||
params: WHERE=now()+>+ADDDATE(`create_time`,+interval+IFNULL((SELECT+`value`+FROM+config+WHERE+config_tag='BackUpSaveTime'),30)+day)
|
||||
interval: 1
|
||||
unit: Days
|
||||
at: 20:12:00
|
||||
do: TaskDeleteExpiredRecord
|
||||
- name: update expired user session
|
||||
uri: /api/rest/databaseManagement/v1/omc_db/session
|
||||
params: WHERE=NOW()+>+ADDDATE(shake_time,+interval+expires+second)+and+status='online'
|
||||
|
||||
@@ -3,7 +3,6 @@ package main
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"mime/multipart"
|
||||
@@ -27,6 +26,7 @@ import (
|
||||
)
|
||||
|
||||
type TaskFunc struct {
|
||||
Token string
|
||||
}
|
||||
|
||||
var Alarms []Alarm
|
||||
@@ -245,6 +245,7 @@ func (t *TaskFunc) TaskUpdateTable(uri, params, body string) {
|
||||
client := resty.New()
|
||||
response, err := client.R().
|
||||
EnableTrace().
|
||||
SetHeaders(map[string]string{"accessToken": t.Token}).
|
||||
SetHeaders(map[string]string{"User-Agent": GetDefaultUserAgent()}).
|
||||
SetHeaders(map[string]string{"Content-Type": "application/json;charset=UTF-8"}).
|
||||
SetBody(body).
|
||||
@@ -558,7 +559,7 @@ func (t *TaskFunc) TaskGenMeasureThresholdAlarm(uri, params, body string) {
|
||||
// log.Debug("alarm:", *alarm)
|
||||
|
||||
// kpi pm non-exceed, check if exist alarm
|
||||
if measureData.Value <= m.Threshold && m.AlarmFlag == true {
|
||||
if measureData.Value <= m.Threshold && m.AlarmFlag {
|
||||
// if len(*alarm) == 0 || (*alarm)[0]["alarm_status"] == AlarmStatusClearString {
|
||||
// continue
|
||||
// }
|
||||
@@ -642,7 +643,7 @@ func (t *TaskFunc) TaskGenMeasureThresholdAlarm(uri, params, body string) {
|
||||
body := new(map[string]interface{})
|
||||
_ = json.Unmarshal(response.Body(), &body)
|
||||
}
|
||||
} else if measureData.Value > m.Threshold && m.AlarmFlag == false {
|
||||
} else if measureData.Value > m.Threshold && !m.AlarmFlag {
|
||||
var alarmSeq int = 1
|
||||
// insert alarm
|
||||
var pvFlag string
|
||||
@@ -757,7 +758,7 @@ func (t *TaskFunc) TaskGenMeasureReportTimeoutAlarm(uri, params, body string) {
|
||||
continue
|
||||
}
|
||||
if neInfo == nil {
|
||||
err := errors.New(fmt.Sprintf("not found target NE neType=%s, neId=%s", measureTask.NeType, neId))
|
||||
err := fmt.Errorf("not found target NE neType=%s, neId=%s", measureTask.NeType, neId)
|
||||
log.Error(err)
|
||||
continue
|
||||
}
|
||||
@@ -1387,7 +1388,7 @@ func (t *TaskFunc) TaskWriteSystemLog(uri, params, body string) {
|
||||
*sysLogs = append(*sysLogs, *sysLog)
|
||||
data := make(map[string]interface{})
|
||||
data["system_log"] = *sysLogs
|
||||
body, err := json.Marshal(data)
|
||||
body, _ := json.Marshal(data)
|
||||
log.Trace("data:", data)
|
||||
log.Debug("requestURL: POST ", requestURL)
|
||||
client := resty.New()
|
||||
|
||||
@@ -634,7 +634,7 @@ func ImportCmToNF(w http.ResponseWriter, r *http.Request) {
|
||||
out, err := cmd.CombinedOutput()
|
||||
log.Tracef("Exec output: %v", string(out))
|
||||
if err != nil {
|
||||
log.Error("Faile to execute rpm command:", err)
|
||||
log.Error("Faile to execute command:", err)
|
||||
services.ResponseInternalServerError500ProcessError(w, err)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user