Permalink
Browse files

Preparing 0.7.0 release for real.

  • Loading branch information...
dagwieers committed Nov 25, 2009
1 parent c289f74 commit 05609f5baf9e82771e368ecf63e9b9b8ef3328cd
Showing with 248 additions and 146 deletions.
  1. +1 −0 ChangeLog
  2. +2 −2 Makefile
  3. +1 −1 docs/dstat.1
  4. +1 −1 docs/performance.txt
  5. +23 −20 dstat
  6. +1 −0 dstat.spec
  7. +0 −1 plugins/dstat.py
  8. +5 −4 plugins/dstat_battery.py
  9. +8 −4 plugins/dstat_battery_remain.py
  10. +5 −7 plugins/dstat_cpufreq.py
  11. +5 −4 plugins/dstat_dbus.py
  12. +8 −4 plugins/dstat_disk_util.py
  13. +6 −0 plugins/dstat_fan.py
  14. +6 −2 plugins/dstat_freespace.py
  15. +6 −0 plugins/dstat_gpfs.py
  16. +8 −2 plugins/dstat_gpfs_ops.py
  17. +5 −4 plugins/dstat_helloworld.py
  18. +2 −0 plugins/dstat_innodb_buffer.py
  19. +2 −0 plugins/dstat_innodb_io.py
  20. +2 −0 plugins/dstat_innodb_ops.py
  21. +1 −4 plugins/dstat_lustre.py
  22. +8 −7 plugins/dstat_memcache_hits.py
  23. +15 −13 plugins/{dstat_mysql5_com.py → dstat_mysql5_cmds.py}
  24. +14 −10 plugins/dstat_mysql5_conn.py
  25. +10 −6 plugins/dstat_mysql5_io.py
  26. +10 −6 plugins/dstat_mysql5_keys.py
  27. +1 −1 plugins/dstat_mysql_io.py
  28. +6 −0 plugins/dstat_net_packets.py
  29. +2 −0 plugins/dstat_nfs3.py
  30. +2 −0 plugins/dstat_nfs3_ops.py
  31. +2 −0 plugins/dstat_nfsd3.py
  32. +2 −0 plugins/dstat_nfsd3_ops.py
  33. +10 −9 plugins/dstat_ntp.py
  34. +1 −2 plugins/dstat_postfix.py
  35. +9 −4 plugins/dstat_power.py
  36. +4 −2 plugins/dstat_proc_count.py
  37. +4 −0 plugins/dstat_rpc.py
  38. +4 −0 plugins/dstat_rpcd.py
  39. +2 −2 plugins/dstat_sendmail.py
  40. +3 −0 plugins/dstat_snooze.py
  41. +2 −0 plugins/dstat_thermal.py
  42. +7 −5 plugins/dstat_top_bio.py
  43. +8 −6 plugins/dstat_top_cpu.py
  44. +1 −1 plugins/dstat_top_cputime.py
  45. +1 −1 plugins/dstat_top_io.py
  46. +11 −7 plugins/dstat_top_latency.py
  47. +8 −4 plugins/dstat_top_mem.py
  48. +3 −0 plugins/dstat_top_oom.py
View
@@ -29,6 +29,7 @@
- Improvements to timing when writing to screen so that it feels nicer
- Added external dstat_disk_util to show per disk utilization rates in percentage
- Added new --float option to force float values on screen
+- Reduce the number of paths used for importing modules (CVE-2009-3894)
- Mass rename plugins to follow better convention (impacts existing options)
- This release was 'sponsored' by the Linux Foundation during the Japan Linux Symposium
View
@@ -37,7 +37,7 @@ dist: clean
svn list -R | pax -d -w -x ustar -s ,^,$(name)-$(version)/, | bzip2 >../$(name)-$(version).tar.bz2
rpm: dist
- rpmbuild -tb --clean --rmsource --rmspec --define "_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" --define "_rpmdir ../" ../$(name)-$(version).tar.bz2
+ rpmbuild -tb --clean --rmspec --define "_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" --define "_rpmdir ../" ../$(name)-$(version).tar.bz2
srpm: dist
- rpmbuild -ts --clean --rmsource --rmspec --define "_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" --define "_srcrpmdir ../" ../$(name)-$(version).tar.bz2
+ rpmbuild -ts --clean --rmspec --define "_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" --define "_srcrpmdir ../" ../$(name)-$(version).tar.bz2
View
@@ -2,7 +2,7 @@
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "DSTAT" "1" "11/24/2009" "\ 0.7.0" "\ "
+.TH "DSTAT" "1" "11/25/2009" "\ 0.7.0" "\ "
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
View
@@ -44,7 +44,7 @@ Performance tuning
------------------
The following documents may be useful to tune a system for performance
-+ http://people.redhat.com/alikins/system_tuning.html[]
+ * http://people.redhat.com/alikins/system_tuning.html[]
NOTE: Please send me improvements to this document.
View
43 dstat
@@ -20,19 +20,17 @@ VERSION = '0.7.0'
theme = { 'default': '' }
-def inspath(path):
+def addpath(path):
if os.path.isdir(path) and path not in sys.path:
- sys.path.insert(0, path)
+ sys.path.append(path)
try:
import sys, os, time, sched, re
import types, resource, getpass, glob
- inspath('/usr/local/share/dstat/')
- inspath('/usr/share/dstat/')
- inspath(os.path.abspath(os.path.dirname(sys.argv[0])) + '/plugins/') # binary path + /plugins/
- inspath(os.getcwd() + '/plugins/') # current path + /plugins/
- inspath(os.getcwd()) # current path
- inspath(os.path.expanduser('~/.dstat/')) # home + /.dstat/
+ addpath(os.path.expanduser('~/.dstat/')) # home + /.dstat/
+ addpath(os.path.abspath(os.path.dirname(sys.argv[0])) + '/plugins/') # binary path + /plugins/
+ addpath('/usr/share/dstat/')
+ addpath('/usr/local/share/dstat/')
except KeyboardInterrupt, e:
pass
@@ -1586,14 +1584,16 @@ def set_theme():
theme = {
'title': ansi['darkblue'],
'subtitle': ansi['darkcyan'] + ansi['underline'],
- 'frame': ansi['darkgray'],
+ 'frame': ansi['darkblue'],
'default': ansi['default'],
'error': ansi['white'] + ansi['redbg'],
'roundtrip': ansi['darkblue'],
'debug': ansi['darkred'],
'input': ansi['darkgray'],
'text_lo': ansi['black'],
'text_hi': ansi['darkgray'],
+ 'unit_lo': ansi['black'],
+ 'unit_hi': ansi['darkgray'],
'colors_lo': (ansi['darkred'], ansi['darkmagenta'], ansi['darkgreen'], ansi['darkblue'],
ansi['darkcyan'], ansi['gray'], ansi['red'], ansi['green']),
'colors_hi': (ansi['red'], ansi['magenta'], ansi['green'], ansi['blue'],
@@ -1603,14 +1603,16 @@ def set_theme():
theme = {
'title': ansi['darkblue'],
'subtitle': ansi['blue'] + ansi['underline'],
- 'frame': ansi['darkgray'],
+ 'frame': ansi['darkblue'],
'default': ansi['default'],
'error': ansi['white'] + ansi['redbg'],
'roundtrip': ansi['darkblue'],
'debug': ansi['darkred'],
'input': ansi['darkgray'],
'text_lo': ansi['gray'],
'text_hi': ansi['darkgray'],
+ 'unit_lo': ansi['darkgray'],
+ 'unit_hi': ansi['darkgray'],
'colors_lo': (ansi['red'], ansi['yellow'], ansi['green'], ansi['blue'],
ansi['cyan'], ansi['white'], ansi['darkred'], ansi['darkgreen']),
'colors_hi': (ansi['darkred'], ansi['darkyellow'], ansi['darkgreen'], ansi['darkblue'],
@@ -1786,13 +1788,14 @@ def cprint(var, type = 'f', width = 4, scale = 1000):
else:
units = (' ', 'k', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y')
- zero = theme['text_hi']
if step == op.delay:
colors = theme['colors_lo']
- text = theme['text_lo']
+ ctext = theme['text_lo']
+ cunit = theme['unit_lo']
else:
colors = theme['colors_hi']
- text = theme['text_hi']
+ ctext = theme['text_hi']
+ cunit = theme['unit_hi']
### Convert value to string given base and field-length
if op.integer and type in ('d', 'p', 'f'):
@@ -1804,25 +1807,25 @@ def cprint(var, type = 'f', width = 4, scale = 1000):
elif type in ('f'):
ret, c = fchg(var, width, base)
elif type in ('s'):
- ret, c = str(var), text
+ ret, c = str(var), ctext
elif type in ('t'):
- ret, c = '%2dh%02d' % (var / 60, var % 60), text
+ ret, c = '%2dh%02d' % (var / 60, var % 60), ctext
else:
raise Exception, 'Type %s not known to dstat.' % type
### Set the counter color
if ret == '0':
- color = zero
+ color = cunit
elif scale <= 0:
- color = text
+ color = ctext
elif scale not in (1000, 1024):
color = colors[int(var/scale)%len(colors)]
elif type in ('p'):
color = colors[int(round(var)/scale)%len(colors)]
elif type in ('d', 'f'):
color = colors[c%len(colors)]
else:
- color = text
+ color = ctext
### Justify value to left if string
if type in ('s',):
@@ -1833,9 +1836,9 @@ def cprint(var, type = 'f', width = 4, scale = 1000):
### Add unit to output
if unit:
if c != -1 and round(var) != 0:
- ret = ret + text + units[c]
+ ret += cunit + units[c]
else:
- ret = ret + ' '
+ ret += ' '
return ret
View
@@ -54,6 +54,7 @@ confusion, less mistakes.
%changelog
* Wed Nov 25 2009 Dag Wieers <dag@wieers.com> - 0.7.0-1
- Updated to release 0.7.0.
+- Reduce the number of paths used for importing modules (CVE-2009-3894)
* Tue Dec 02 2008 Dag Wieers <dag@wieers.com> - 0.6.9-1
- Updated to release 0.6.9.
View
View
@@ -1,9 +1,10 @@
-### Dstat battery plugin
-### Displays battery information from ACPI
-###
-### Authority: dag@wieers.com
+### Author: Dag Wieers <dag$wieers,com>
class dstat_plugin(dstat):
+ """
+ Percentage of remaining battery power as reported by ACPI.
+ """
+
def __init__(self):
self.file = file
self.name = 'battery'
@@ -1,9 +1,13 @@
-### Dstat battery plugin
-### Displays battery information from ACPI
-##
-### Authority: dag@wieers.com
+### Author: Dag Wieers <dag$wieers,com>
class dstat_plugin(dstat):
+ """
+ Remaining battery time.
+
+ Calculated from power drain and remaining battery power. Information is
+ retrieved from ACPI.
+ """
+
def __init__(self):
self.name = 'remain'
self.type = 't'
View
@@ -1,12 +1,10 @@
-### Dstat cpu frequency plugin
-### Displays CPU frequency information (from ACPI)
-###
-### Authority: dag@wieers.com
-
-global glob
-import glob
+### Author: dag@wieers.com
class dstat_plugin(dstat):
+ """
+ CPU frequency in percentage as reported by ACPI.
+ """
+
def __init__(self):
self.name = 'frequency'
self.type = 'p'
View
@@ -1,9 +1,10 @@
-### Dstat DBUS plugin
-### Displays dbus sessions
-###
-### Authority: dag@wieers.com
+### Author: Dag Wieers <dag$wieers,com>
class dstat_plugin(dstat):
+ """
+ Number of active dbus sessions.
+ """
+
def __init__(self):
self.name = 'dbus'
self.type = 'd'
View
@@ -1,8 +1,12 @@
+### Author: Dag Wieers <dag$wieers,com>
+
class dstat_plugin(dstat):
"""
- Percentage of CPU time during which I/O requests were issued to the device
- (bandwidth utilization for the device). Device saturation occurs when
- this value is close to 100%.
+ Percentage of bandwidth utilization for block devices.
+
+ Displays percentage of CPU time during which I/O requests were issued
+ to the device (bandwidth utilization for the device). Device saturation
+ occurs when this value is close to 100%.
"""
def __init__(self):
@@ -22,7 +26,7 @@ def discover(self, *objlist):
name = l[2]
ret.append(name)
for item in objlist: ret.append(item)
- if not ret:
+ if not ret:
raise Exception, "No suitable block devices found to monitor"
return ret
View
@@ -1,4 +1,10 @@
+### Author: Dag Wieers <dag$wieers,com>
+
class dstat_plugin(dstat):
+ """
+ Fan speed in RPM (rotations per minute) as reported by ACPI.
+ """
+
def __init__(self):
self.name = 'fan'
self.type = 'd'
@@ -1,9 +1,13 @@
+### Author: Dag Wieers <dag$wieers,com>
+
### FIXME: This module needs infrastructure to provide a list of mountpoints
### FIXME: Would be nice to have a total by default (half implemented)
-### FIXME: Apparently needs python 2.0, possibly python 2.2
-
class dstat_plugin(dstat):
+ """
+ Amount of used and free space per mountpoint.
+ """
+
def __init__(self):
self.open('/etc/mtab')
self.nick = ('used', 'free')
View
@@ -1,4 +1,10 @@
+### Author: Dag Wieers <dag$wieers,com>
+
class dstat_plugin(dstat):
+ """
+ Total amount of read and write throughput (in bytes) on a GPFS filesystem.
+ """
+
def __init__(self):
self.name = 'gpfs i/o'
self.vars = ('_br_', '_bw_')
View
@@ -1,4 +1,10 @@
+### Author: Dag Wieers <dag$wieers,com>
+
class dstat_plugin(dstat):
+ """
+ Number of operations performed on a GPFS filesystem.
+ """
+
def __init__(self):
self.name = 'gpfs file operations'
self.type = 'd'
@@ -30,11 +36,11 @@ def extract(self):
for name in self.vars:
self.val[name] = (self.set2[name] - self.set1[name]) * 1.0 / elapsed
except IOError, e:
+ if op.debug > 1: print '%s: lost pipe to mmpmon, %s' % (self.filename, e)
for name in self.vars: self.val[name] = -1
-# print self.filename + ': lost pipe to mmpmon,', e
except Exception, e:
+ if op.debug > 1: print '%s: exception %s' % (self.filename, e)
for name in self.vars: self.val[name] = -1
-# print 'dstat_gpfs: exception', e
if step == op.delay:
self.set1.update(self.set2)
@@ -1,9 +1,10 @@
-### Dstat Hello World plugin
-### Displays hello world
-###
-### Authority: dag@wieers.com
+### Author: Dag Wieers <dag$wieers,com>
class dstat_plugin(dstat):
+ """
+ Example "Hello world!" output plugin for aspiring Dstat developers.
+ """
+
def __init__(self):
self.type = 's'
self.width = 12
@@ -1,3 +1,5 @@
+### Author: Dag Wieers <dag$wieers,com>
+
global mysql_options
mysql_options = os.getenv('DSTAT_MYSQL')
@@ -1,3 +1,5 @@
+### Author: Dag Wieers <dag$wieers,com>
+
global mysql_options
mysql_options = os.getenv('DSTAT_MYSQL')
@@ -1,3 +1,5 @@
+### Author: Dag Wieers <dag$wieers,com>
+
global mysql_options
mysql_options = os.getenv('DSTAT_MYSQL')
View
@@ -1,7 +1,4 @@
-# Authority: Brock Palen <brockp@mlds-networks.com>, Kilian Vavalotti <kilian@stanford.edu>
-
-global os
-import os
+# Author: Brock Palen <brockp@mlds-networks.com>, Kilian Vavalotti <kilian@stanford.edu>
class dstat_plugin(dstat):
def __init__(self):
@@ -1,9 +1,11 @@
-### Dstat Display Memcache Hit Count plugin
-### Displays the number of Memcache "get_hits" and "get_misses"
-###
-### Authority: dean.wilson@gmail.com
+### Author: Dean Wilson <dean.wilson@gmail.com>
class dstat_plugin(dstat):
+ """
+ Memcache hit count plugin.
+
+ Displays the number of memcache get_hits and get_misses.
+ """
def __init__(self):
self.name = 'Memcache Hits'
self.type = 'd'
@@ -22,6 +24,5 @@ def check(self):
def extract(self):
stats = self.mc.get_stats()
-
- self.val['get_hits'] = int( stats[0][1]['get_hits'] )
- self.val['get_misses'] = int( stats[0][1]['get_misses'] )
+ for key in self.vars:
+ self.val[key] = long(stats[0][1][key])
Oops, something went wrong.

0 comments on commit 05609f5

Please sign in to comment.