Making more use of yaml definitions

Hi Folks,

I was wondering what people thought about doing some of the discovery in the yaml files such as if a device is detected using either sysName or sysObjectId then you can have an array of these items in the yaml file. For example, the 3com detection looks for these values in sysDescr '3Com Switch ', '3Com SuperStack', '3Com Baseline'.

We could easily move that to the yaml file like:

sysDescr:
    case_insensitive: true
    data:
        - 3Com Switch
        - 3Com SuperStack
        - 3Com Baseline

If it was more complicated like checking if those existed in sysDescr but exclude some sysObjectId then we default to doing it in php?

Also we could move unit testing into here as well:

unittests:
    3com-4500G:
        - 1.3.6.1.2.1.1.1.0|4|3Com Switch 4500G 24-Port PWR Software Version 3Com OS V5.02.00s168p12
    3com-4500:
        - 1.3.6.1.2.1.1.1.0|4|3Com SuperStack 3 Switch 4500 26-Port Software Version 3Com OS V3.02.00s56

Unit tests won’t work unless we generate the snmprec files for snmpsim from the data, which could work.

For the discovery, it may require more thought or experimentation to get it right. You could have an optional type variable to allow for regex.

At any rate, I think these changes need to be in two different steps.

The test files could just be created to temp at the time of the tests - maybe it’s not worth it though.

For disco (and polling in some ways). I’d have preferred to keep things simple and try and keep the coding out of the yaml files but if you’ve got any good ideas on how to implement it then I’m all ears.