Member since
03-15-2022
1
Post
2
Kudos Received
1
Solution
My Accepted Solutions
Title | Views | Posted |
---|---|---|
2919 | 03-15-2022 08:30 AM |
03-15-2022
08:30 AM
2 Kudos
Found a dirty workaround: generate a cookie from an API call and then use it to login into the console. As an example, in order to get the HDFS usage report, #!/bin/bash -x COOKIES=./cookies.txt USER="" PASS="" LOGIN="https://<cloudera_manager>:7183/api/version" REPORT="https://<cloudera_manager>:7183/cmf/services/11/nameservices/nameservice1/reports/currentDiskUsage?groupBy=DIRECTORY&format=CSV " SALIDA=./hdfs_usage.csv function login_cloudera(){ USER=$1 PASS=$2 wget --save-cookies ${COOKIES} --keep-session-cookies --user "${USER}" --password "$(echo ${PASS}|base64 -d)" --delete-after ${LOGIN} } function download_report(){ USER=$1 read -p "Password:" -s PASS PASS=$(echo $PASS | base64) login_cloudera $USER $PASS wget --load-cookies ${COOKIES} ${REPORT} -O ${SALIDA} rm ${COOKIES} } # MAIN USER=$1 download_report $USER
... View more