mirror of https://github.com/nicolargo/glances
Support Fahrenheit (issue #620)
parent
4b1f5a2731
commit
5b397d8e90
1
NEWS
1
NEWS
|
@ -9,6 +9,7 @@ Enhancements and new features:
|
|||
|
||||
* Allow export of Docker and sensors plugins stats to InfluxDB, StatsD... (issue #600)
|
||||
* Server password configuration for the browser mode (issue #500)
|
||||
* Support Fahrenheit unit in the sensor plugin using the --fahrenheit command line option (issue #620)
|
||||
* Display an error if export is not used in the standalone/client mode (issue #614)
|
||||
|
||||
Version 2.4.2
|
||||
|
|
|
@ -96,7 +96,7 @@ critical=90
|
|||
#allow=zfs
|
||||
|
||||
[sensors]
|
||||
# Sensors core limits
|
||||
# Sensors core limits (in Celsius...)
|
||||
# Default values if not defined: 60/70/80
|
||||
temperature_core_careful=60
|
||||
temperature_core_warning=70
|
||||
|
|
|
@ -188,6 +188,8 @@ Start the client browser (browser mode):\n\
|
|||
dest='process_tree', help='display processes as a tree')
|
||||
parser.add_argument('-b', '--byte', action='store_true', default=False,
|
||||
dest='byte', help='display network rate in byte per second')
|
||||
parser.add_argument('--fahrenheit', action='store_true', default=False,
|
||||
dest='fahrenheit', help='display temperature in Fahrenheit (default is Celsius)')
|
||||
parser.add_argument('-1', '--percpu', action='store_true', default=False,
|
||||
dest='percpu', help='start Glances in per CPU mode')
|
||||
parser.add_argument('--fs-free-space', action='store_false', default=False,
|
||||
|
|
|
@ -194,8 +194,15 @@ class Plugin(GlancesPlugin):
|
|||
msg = "{0:12} {1:3}".format(label[:11], i['unit'])
|
||||
except (KeyError, UnicodeEncodeError):
|
||||
msg = "{0:16}".format(label[:15])
|
||||
if args.fahrenheit:
|
||||
msg = msg.replace('°C', '°F')
|
||||
ret.append(self.curse_add_line(msg))
|
||||
msg = '{0:>7}'.format(i['value'])
|
||||
if args.fahrenheit:
|
||||
# Convert Celsius to Fahrenheit
|
||||
# T(°F) = T(°C) × 1.8 + 32
|
||||
msg = '{0:>7}'.format(i['value'] * 1.8 + 32)
|
||||
else:
|
||||
msg = '{0:>7}'.format(i['value'])
|
||||
ret.append(self.curse_add_line(
|
||||
msg, self.get_views(item=i[self.get_key()],
|
||||
key='value',
|
||||
|
|
Loading…
Reference in New Issue