vCheckReport / vCheck-NSX

vCheck-NSX is an NSX-focussed reporting tool that can give you a periodic (i.e. Daily) look into the health of your platform.
https://vcheck.report/
MIT License
18 stars 6 forks source link

[PS-Module] Config & Config File handling #6

Open vScripter opened 7 years ago

vScripter commented 7 years ago

Figure out the best way to handle global config, as well as plugin config.

Mind Map of Module Layout this is how the module is currently laid out.

Guidelines

Example Config File

[
    {
        "endpoint": [
            {
                "name": "vcenter01.example1.com",
                "ipv4address": "192.168.1.10",
                "type:": "vcenter",
                "connection": {
                    "credentialPath": "",
                    "region": "nyc.payload1",
                    "tenant": "Example 1",
                    "description": "NYC payload-1 vcenter server"
                },
                "inventory": {
                    "datacenter": "",
                    "cluster": "",
                    "vmhost": "",
                    "vm": ""
                }
            },
            {
                "name": "vcenter02.example2.com",
                "ipv4address": "192.168.1.11",
                "type:": "vcenter",
                "config": {
                    "credentialPath": "",
                    "region": "nyc.payload2",
                    "tenant": "Example 2",
                    "description": "NYC payload-2 vcenter server",
                    "inventory": {
                        "datacenter": "",
                        "cluster": "",
                        "vmhost": "",
                        "vm": ""
                    }
                }
            },
            {
                "name": "vnsxmgr01.example.com",
                "ipv4address": "192.168.1.12",
                "type:": "nsx",
                "config": {
                    "credentialPath": "",
                    "region": "nyc.payload1",
                    "tenant": "Example",
                    "description": "NYC payload-1 nsx manager"
                }
            }
        ]
    }
]
Sneddo commented 7 years ago

I guess we need to keep this fairly simple as well, to not create a barrier to stop people developing thier own plugins.

The variable values should also not be written back to the plugin like it is now, as it makes updating more difficult.

Once we come up with a solution to the plugins, I'd suggest we effectively merge globalVariables.ps1 into vCheck itself (and possibly handle EndScript.ps1 as well) in a similar manner.

vScripter commented 7 years ago

@Sneddo I completely agree 💯 ; my thoughts are almost right in line with everything you mentioned, trying to keep the following points, below, at the forefront. If you have a minute, check out the layout I put together, based on how I configured the initial module.

davehocking commented 7 years ago

Hi folks, great to see the behind-the-scenes discussions going on RE: development, I think (hope) that I'm going to learn a lot just by listening to you.

On the multiple end-points subject, it's something I thought about for the work on vCheck-NSX, if you could find a way to make it work, it would be really useful - I have multiple copies of the vCheck report running, which in some respects works well, as the two platforms I'm querying have different use cases - on one platform I don't care about VM-level checks, on the other I do - You'd possibly want some way of being able to tell each plugin which VC's you care about being checked against (and potentially different exclusions/variables for each too).

Sneddo commented 7 years ago

@vScripter Yeah, looking good :thumbsup: I had a go at converting to modules a couple of years ago and just couldn't quite come up with a solution that worked well enough to persist with. I think we're on the right track though :smile:

I'll throw another thing into the mix- filtering. This is something that has come up a lot over the years of vCheck. People want to be able to filter objects in reports e.g. just run a report against a single datacenter/cluster/host/whatever. Building in a standard filtering definition into our plugins (and ideally the connection/endpoint definition) would be a nice feature.

vScripter commented 7 years ago

@Sneddo That's a good one 👌🏻

vScripter commented 7 years ago

Added the summarized list to the description of this issue as well as an updated config file with some different samples of what we might could use (global config).

mrkwbr commented 7 years ago

just throwing this out there - it seems to me that there were be a lot of benefit to making the vCheck framework its own module and then each project module could include it as a dependency. each project could then focus on writing checks - plus fixes to the framework would be available to all projects without having to update each individually.

are there technical issues with separating out the framework in that way?

thanks mark

vScripter commented 7 years ago

@mrkwbr I'm actually working on getting that functionality in place, however, it's pretty close to an entire re-write of the tool, in order to support the original functionality and fix some of the other limitations the existing framework has. The way I am approaching it, each test framework will be a 'Plugin', which will basically be a directory with the test files beneath it. There is a link to the module layout in the issue description, above, that I am keeping up to date as I work through the re-design.