ExpressenAB / bigip_exporter

Prometheus exporter for BIG-IP metrics
MIT License
89 stars 38 forks source link

Added option to read username and password from config file #7

Closed dezmodue closed 7 years ago

dezmodue commented 7 years ago

This is to avoid credentials being exposed on the command line and in process listing. Tested on version 12.1.1 (added in the README)

cgunning commented 7 years ago

Hi. This looks good but if there's support for a configuration file it should support all the parameters. I would suggest that the struct be:

type Config struct {
        Bigip struct {
                username string
                password string
                ...
        }
        Exporter struct {
                Port int
                ...
        }
}

I'm not a 100% about the syntax here but I think you understand what I mean. Then handeling it the way you do now. Since it will become a lot of checks it may be preferable to put it in a function called getConfig or something like that.

dezmodue commented 7 years ago

Sure, I'll have a look at implementing it

dezmodue commented 7 years ago

@cgunning Please have a look and let me know, I separated the config and added all options + a debug option

dezmodue commented 7 years ago

ping @cgunning

cgunning commented 7 years ago

Hi @dezmodue . I'm sorry for not leaving any feedback but It's been a lot a work before the holidays. I'll test this during the day and get back to you. At a first glance this looks good.

cgunning commented 7 years ago

LGTM