Skip to content

Commit

Permalink
Added option to preset serverid
Browse files Browse the repository at this point in the history
  • Loading branch information
vfuse authored Apr 26, 2017
1 parent 9a3768b commit ec90cc3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions nixstatsagent/nixstatsagent.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import urllib2


__version__ = '1.1.12' # App version
__version__ = '1.1.13' # App version

__FILEABSDIRNAME__ = os.path.dirname(os.path.abspath(__file__))

Expand Down Expand Up @@ -68,7 +68,10 @@ def hello(proto='https'):
token_filename = sys.argv[2]
else:
token_filename = os.path.join(__FILEABSDIRNAME__, 'nixstats-token.ini')
if os.path.isfile('/etc/nixstats/token'):
if '_' in user_id:
user_id = user_id.split('_')[0]
server_id = user_id.split('_')[1]
elif os.path.isfile('/etc/nixstats/token'):
oldconfigfile = open('/etc/nixstats/token','r')
server_id = oldconfigfile.readline()
print "Upgrading from old monitoring agent"
Expand Down

0 comments on commit ec90cc3

Please sign in to comment.