-
-
Notifications
You must be signed in to change notification settings - Fork 272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow the getval task to work with customized hostnames #942
base: master
Are you sure you want to change the base?
Conversation
The default hostname used by collectd is system dependent as retuned by gethostname(3) (On FreeBSD it's the FQDN, while on Linux it's the non-FQDN). The python method socket.gethostname() always return a non-FQDN, and the user has the ability to tune the hostname as he wish in the collectd configuration (hostname parameter). This change allow to use a customized hostname by using an optional argument "hostname". When not provided, the non-FQDN and the FQDN are tried in turn to fetch the requested metric value.
@@ -3,6 +3,10 @@ | |||
"input_method": "stdin", | |||
"files": ["python_task_helper/files/task_helper.py"], | |||
"parameters": { | |||
"hostname": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi
There's example and parameters in README that could be extended with the new option.
Glad someone using this, I pretty much did it as an academic exercise |
Rather than passing the |
Ah yes, didn't thing that passing the hostname does not scale beyond 1 node… Maybe we can just use hostname, and fallback to fqdn (so no custom values). We can also look for a setting in Not ideal… What do you think ? |
Parsing collectd.conf seems a bit yuck. We use:
Sending a fact name of choice as a parameter then the user can specify if they |
I never realised you do a getval without the hostname.
works perfectly well, that's the solution. |
Interesting, I do not see this behavior and was thinking about contributing it maybe… A patch might be already available somewhere. On what system do you experience this? |
rpm -q collectd Don't think we have any patches in this area. We do have:
I wonder if your |
Pull Request (PR) description
The default hostname used by collectd is system dependent as retuned by
gethostname(3) (On FreeBSD it's the FQDN, while on Linux it's the
non-FQDN). The python method socket.gethostname() always return a
non-FQDN, and the user has the ability to tune the hostname as he wish
in the collectd configuration (hostname parameter).
This change allow to use a customized hostname by using an optional
argument "hostname". When not provided, the non-FQDN and the FQDN are
tried in turn to fetch the requested metric value.
This Pull Request (PR) fixes the following issues
n/a