Project

General

Profile

« Previous | Next » 

Revision f0305846

Added by Alexis Mousset over 6 years ago

Fixes #10649: 'rudder agent info' should report compliance mode (full-compliance / changes-only / reports-disabled)

View differences:

share/commands/agent-info
echo "Key Hash: ${HASH}"
echo "Policy server: ${POLICY}"
echo "Roles: ${ROLES}"
if [ -n "${RUDDER_REPORT_MODE}" ]
then
echo "Report mode: ${RUDDER_REPORT_MODE}"
fi
if [ -n "${AGENT_RUN_INTERVAL}" ]
then
echo "Run interval: ${AGENT_RUN_INTERVAL} min"
fi
echo "Agent is ${ENABLED}"
echo "Policy updated: ${POLICY_FETCHED}"
echo "Inventory sent: ${INVENTORY_SENT}"
echo "Version: ${VERSION}"
share/lib/common.sh
if [ -f "${RUDDER_JSON}" ]
then
RUDDER_REPORT_MODE=$(grep 'RUDDER_REPORT_MODE' "${RUDDER_JSON}" | sed 's/.*"RUDDER_REPORT_MODE":"\(.*\)",.*/\1/')
AGENT_RUN_INTERVAL=$(grep 'AGENT_RUN_INTERVAL' "${RUDDER_JSON}" | sed 's/.*"AGENT_RUN_INTERVAL":"\(.*\)",.*/\1/')
elif [ -f "${PROMISES_CF}" ]
# To be compatible with old promises. This should be removed once rudder.json is everywhere.
RUDDER_REPORT_MODE=$(grep -E '"changes_only" *expression' "${PROMISES_CF}" | sed 's/.*strcmp("\(.*\)", "changes-only".*/\1/')

Also available in: Unified diff