ing
This commit is contained in:
parent
defcb8c433
commit
9317f5316d
Binary file not shown.
Binary file not shown.
23
_build/config/container/network/postgresql/112103115113108
Normal file
23
_build/config/container/network/postgresql/112103115113108
Normal 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" : [
|
||||
]
|
||||
}
|
||||
|
23
_build/config/container/network/ssh/115115104
Normal file
23
_build/config/container/network/ssh/115115104
Normal 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" : [
|
||||
]
|
||||
}
|
|
@ -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 {
|
||||
|
|
|
@ -51,7 +51,7 @@ func (s *SensorConfigService) StartService() error {
|
|||
s.sortSensorConfigPerContainer()
|
||||
|
||||
for containerType := range s.sensorConfigsPerContainer {
|
||||
s.SendInitConfig(containerType)
|
||||
s.ContainerService.RunContainer(containerType)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user