初始化监控模块的配置状态
()
| 25 | } |
| 26 | // 初始化监控模块的配置状态 |
| 27 | func InitModuleStatus() error { |
| 28 | modules, err := monitorModuleDao.GetMonitorModules() |
| 29 | if err != nil { |
| 30 | return err |
| 31 | } |
| 32 | |
| 33 | names := ksitigarbha.GetMonitorModuleNames() |
| 34 | |
| 35 | |
| 36 | for _, name := range names { |
| 37 | |
| 38 | if m,has:= modules[name];has{ |
| 39 | if m.ModuleStatus == 1{ |
| 40 | ksitigarbha.Open(name,m.Config) |
| 41 | }else{ |
| 42 | ksitigarbha.Close(name) |
| 43 | } |
| 44 | }else{ |
| 45 | ksitigarbha.Close(name) |
| 46 | } |
| 47 | } |
| 48 | return nil |
| 49 | } |
| 50 | //GetMonitorModules 获取监控模块列表 |
| 51 | func GetMonitorModules() ([]*MonitorModule, error) { |
| 52 | m, err := monitorModuleDao.GetMonitorModules() |
nothing calls this directly
no test coverage detected