Created
May 6, 2015 00:27
-
-
Save yosemitebandit/214fe192c928f8a83636 to your computer and use it in GitHub Desktop.
get the output of the "gprs list" command in OpenBTS for analysis purposes
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
"""Continuously records the output of "gprs list" from OpenBTSCLI. | |
Run as follows (then you can logout of the session and it'll keep going): | |
$ nohup python gprs_lister.py & | |
""" | |
import time | |
import envoy | |
logpath = '/home/endaga/gprs-list.log' | |
period = 60 | |
separator = '\n==========\n' | |
while True: | |
response = envoy.run('/OpenBTS/OpenBTSCLI -c "gprs list"') | |
with open(logpath, 'a') as logfile: | |
logfile.write('%s%s' % (response.std_out, separator)) | |
time.sleep(period) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment