Skip to content

Commit

Permalink
feat(phonehome): add get-facts (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
gsanchietti authored Jan 22, 2025
1 parent 53426dd commit 4c26240
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions imageroot/actions/get-facts/50facts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env python3

#
# Copyright (C) 2025 Nethesis S.r.l.
# SPDX-License-Identifier: GPL-3.0-or-later
#


import os
import json
import sys
import subprocess

info = {
"retention_days": int(os.getenv('LOKI_RETENTION_PERIOD')),
"cloud_log_manager": subprocess.run(['systemctl', '--user', 'is-enabled', 'cloud-log-manager-forwarder'], check=False, capture_output=True).returncode == 0,
"syslog": subprocess.run(['systemctl', '--user', 'is-enabled', 'syslog-forwarder'], check=False, capture_output=True).returncode == 0,
}
json.dump(info, sys.stdout)

0 comments on commit 4c26240

Please sign in to comment.