gen2brain / keepalived_exporter

Keepalived Prometheus Exporter
Apache License 2.0
46 stars 14 forks source link

PID retrieval error #13

Closed gunhu closed 4 years ago

gunhu commented 4 years ago

On a brand new Debian GNU/Linux Buster node under certain circumstances.

I got the following error message:

After checking the relevant code is producing the error message:

    for _, p := range ps {
        name, err := p.Name()
        if err != nil {
            return err
        }

I would like to submit a PR and fetch the PID directly from the keepalived pid file located under /var/run directory.

Is it a suitable fix for you?

Regards,

gen2brain commented 4 years ago

This should be fixed in https://github.com/gen2brain/keepalived_exporter/commit/3b13ebe40de588e107d972ddfa9d314c9baf9462 . Hardcoding PID file location is not a good idea, especially if KA supports an option for that (-p) so the user can change it.