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
Fixes #18568: Fix metrics-reporting script #2381
Fixes #18568: Fix metrics-reporting script #2381
Conversation
Currently broken so the risk should be quite self-contained |
@@ -139,16 +142,19 @@ def metrics(): | |||
pass | |||
|
|||
# Installation date | |||
cmd="find /opt/rudder/bin/ -type f -exec stat -c \"%Z %n\" {} \; | sort -n | head -n1 | awk '{print $2}' | xargs -r stat -c \"%z\"" | |||
cmd="stat -c \"%y\" /var/rudder/cfengine-community/ppkeys/localhost.pub" |
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.
not perfect but previous commands gave me latest uprade date
@@ -55,7 +58,7 @@ def metrics(): | |||
data = { } | |||
|
|||
# Define the versionning of the file | |||
data['file_version'] = "2" | |||
data['file_version'] = "3" |
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.
we should maybe do this in 6.2
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.
No, I think it's ok, because the user of that file/API is us - so the burden is on our side.
PR updated with a new commit |
@@ -195,7 +204,7 @@ def init_commands(): | |||
psql_host = match.group(1) | |||
psql_port = match.group(2) | |||
psql_cmd = "psql -h " + psql_host + " -U " + psql_user | |||
ldap_cmd = "/opt/rudder/bin/ldapsearch -x -z0 -h " + ldap_host + " -p " + ldap_port + " -D " + ldap_user + " -w " + ldap_pwd | |||
ldap_cmd = "ldapsearch -x -z0 -h " + ldap_host + " -p " + ldap_port + " -D " + ldap_user + " -w " + ldap_pwd |
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.
python can use the PATH ?
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.
yes
This PR is not mergeable to upper versions. |
OK, squash merging this PR |
437bef2
to
6d46971
Compare
https://issues.rudder.io/issues/18568