This commit is contained in:
crusader 2018-05-04 21:03:23 +09:00
parent defcb8c433
commit 9317f5316d
6 changed files with 60 additions and 1 deletions

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,23 @@
{
"configID" : "112103115113108",
"target" : {
"connection" : {
"ip" : "192.168.1.50",
"port" : "5432",
"ssl" : false,
"portType" : "tcp"
},
"auth" : {
}
},
"schedule" : {
"interval" : "3"
},
"crawler" : {
"name":"POSTGRESQL_HEALTH",
"container":"NETWORK"
},
"items" : [
]
}

View File

@ -0,0 +1,23 @@
{
"configID" : "115115104",
"target" : {
"connection" : {
"ip" : "192.168.1.10",
"port" : "22",
"ssl" : false,
"portType" : "tcp"
},
"auth" : {
}
},
"schedule" : {
"interval" : "7"
},
"crawler" : {
"name":"SSH_HEALTH",
"container":"NETWORK"
},
"items" : [
]
}

View File

@ -118,6 +118,19 @@ func (s *ContainerService) Send(containerType occp.ContainerType, method string,
return containerSession.Send(buff)
}
func (s *ContainerService) RunContainer(containerType occp.ContainerType) error {
var err error
_, ok := s.containerSessions.Load(containerType)
if !ok {
_, err = s.newContainerSession(containerType)
if nil != err {
return err
}
}
return nil
}
func (s *ContainerService) newContainerSession(containerType occp.ContainerType) (*container.ContainerSession, error) {
_containerSession, ok := s.containerSessions.Load(containerType)
if !ok {

View File

@ -51,7 +51,7 @@ func (s *SensorConfigService) StartService() error {
s.sortSensorConfigPerContainer()
for containerType := range s.sensorConfigsPerContainer {
s.SendInitConfig(containerType)
s.ContainerService.RunContainer(containerType)
}
}