bmc-toolbox / dora

Tool to discover, collect data from multiple types of Servers and Chassis BMCs
Apache License 2.0
37 stars 7 forks source link

Is a kea.conf the only way to scan a network? #25

Open jacobsalmela opened 2 years ago

jacobsalmela commented 2 years ago

It seems like the options allow for ad-hoc scanning, but I haven't been able to get it to do so.

Are there any other places for documentation on setting up dora?

nnuss commented 2 years ago

Ad-hoc scanning is, presently, only supported over subnets configured in kea.

This is due to:

  1. scanner.LoadSubnets(...) always reading the kea config
  2. subnets must be pre-populated in order match a (first) passed subnet argument when it isn't "all". And this only occurs when source == "kea" a few lines above.

It's possible to make a dora.yaml reference a skeletal kea config (kea-ad-hoc.conf) to allow, for example,dora scan 10.9.8.0/24 --config my-dora.yaml

$ fgrep kea_config /path/to/my-dora.yaml
  kea_config: /path/to/kea-ad-hoc.conf

$ cat /path/to/kea-ad-hoc.conf
{
  "Dhcp4": {
    "subnet4": [
      { 
        "subnet": "10.9.8.0/24",
        "option-data": [
          {
            "name": "domain-name",
            "data": "site.example.com
          }
        ]
      }
    ]     
  }       
}           
jacobsalmela commented 2 years ago

Thank you. I will try this.

jacobsalmela commented 2 years ago

It could be environmental, but I can't get it to return anything. Nor anything when I run collect.

Is this accurate:

#run the dora server
./dora --config dora-simple.yaml server
# scan the network
./dora --config dora-simple.yaml scan 10.254.1.0/16
# collect the data
./dora --config dora-simple.yaml collect

I also cloned the repo and tried to run it locally, but it fails with:

host:~/dora # go run main.go --config dora-simple.yaml scan 10.254.1.0/16
# github.com/bmc-toolbox/dora/web
web/server.go:67:3: undefined: routing.Gin

If I build it and run it, it doesn't complain.

I'm attempting to debug it. It seems to accept my network range to scan, but then just returns an empty slice for the return subnets