Only specify interval if we receive one from collectd
This commit is contained in:
parent
6b35ca5ada
commit
6a2454c212
|
@ -243,15 +243,20 @@ class DataSync(Subcommand):
|
|||
hostname = os.environ.get('COLLECTD_HOSTNAME')
|
||||
if not hostname:
|
||||
hostname = socket.getfqdn()
|
||||
|
||||
if not interval:
|
||||
interval = os.environ.get('COLLECTD_INTERVAL', 10)
|
||||
interval = os.environ.get('COLLECTD_INTERVAL')
|
||||
if interval:
|
||||
interval = ' interval={}'.format(interval)
|
||||
else:
|
||||
interval = ''
|
||||
|
||||
if now:
|
||||
value = '{}:{}'.format(now.timestamp(), value)
|
||||
else:
|
||||
value = 'N:{}'.format(value)
|
||||
|
||||
msg = 'PUTVAL {}/{}/{} interval={} {}\n'.format(
|
||||
msg = 'PUTVAL {}/{}/{}{} {}\n'.format(
|
||||
hostname,
|
||||
plugin,
|
||||
data_type,
|
||||
|
|
Loading…
Reference in a new issue