code refactor
This commit is contained in:
parent
6c14694ad1
commit
087c581393
14
README.md
14
README.md
|
@ -15,3 +15,17 @@ go build
|
|||
```shell
|
||||
tar zcvf categraf.tar.gz categraf conf
|
||||
```
|
||||
|
||||
## todo
|
||||
|
||||
[]ntp
|
||||
[]exec
|
||||
[]ping
|
||||
[]net_response
|
||||
[]http_response
|
||||
[]scrape
|
||||
[]procstat
|
||||
[]oracle
|
||||
[]mysql
|
||||
[]redis
|
||||
[]...
|
|
@ -12,6 +12,7 @@ import (
|
|||
"strconv"
|
||||
|
||||
"flashcat.cloud/categraf/inputs"
|
||||
"flashcat.cloud/categraf/pkg/osx"
|
||||
"flashcat.cloud/categraf/types"
|
||||
)
|
||||
|
||||
|
@ -27,7 +28,7 @@ type SysctlFS struct {
|
|||
func init() {
|
||||
inputs.Add(inputName, func() inputs.Input {
|
||||
return &SysctlFS{
|
||||
path: path.Join(GetHostProc(), "/sys/fs"),
|
||||
path: path.Join(osx.GetHostProc(), "/sys/fs"),
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ import (
|
|||
"syscall"
|
||||
|
||||
"flashcat.cloud/categraf/inputs"
|
||||
"flashcat.cloud/categraf/inputs/linux_sysctl_fs"
|
||||
"flashcat.cloud/categraf/pkg/osx"
|
||||
"flashcat.cloud/categraf/types"
|
||||
)
|
||||
|
||||
|
@ -145,7 +145,7 @@ func (p *Processes) gatherFromPS(fields map[string]interface{}) error {
|
|||
|
||||
// get process states from /proc/(pid)/stat files
|
||||
func (p *Processes) gatherFromProc(fields map[string]interface{}) error {
|
||||
filenames, err := filepath.Glob(linux_sysctl_fs.GetHostProc() + "/[0-9]*/stat")
|
||||
filenames, err := filepath.Glob(osx.GetHostProc() + "/[0-9]*/stat")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package linux_sysctl_fs
|
||||
package osx
|
||||
|
||||
import "os"
|
||||
|
Loading…
Reference in New Issue