Created
March 25, 2018 08:40
-
-
Save dash1291/1428a8b42066904b8239ac6307ef60dd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import syslog | |
import json | |
images = os.popen('bash /home/ashish.dubey/service_stats.sh').read() | |
log_message = {} | |
for image in images.split('\n'): | |
if len(image): | |
service_name, tag = image.split(':') | |
log_message[service_name] = tag | |
syslog.openlog( | |
facility=syslog.LOG_LOCAL4, | |
ident='serviceStats' | |
) | |
syslog.syslog(json.dumps(log_message)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment