Skip to content
Browse files

Preparing 0.7.0 release for real.

  • Loading branch information...
1 parent c289f74 commit 05609f5baf9e82771e368ecf63e9b9b8ef3328cd @dagwieers committed
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
1 ChangeLog
@@ -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
4 Makefile
@@ -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 docs/dstat.1
@@ -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
2 docs/performance.txt
@@ -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,7 +1584,7 @@ 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'],
@@ -1594,6 +1592,8 @@ def set_theme():
'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,7 +1603,7 @@ 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'],
@@ -1611,6 +1611,8 @@ def set_theme():
'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,17 +1807,17 @@ 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'):
@@ -1822,7 +1825,7 @@ def cprint(var, type = 'f', width = 4, scale = 1000):
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
1 dstat.spec
@@ -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
1 plugins/dstat.py
View
9 plugins/dstat_battery.py
@@ -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'
View
12 plugins/dstat_battery_remain.py
@@ -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
12 plugins/dstat_cpufreq.py
@@ -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
9 plugins/dstat_dbus.py
@@ -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
12 plugins/dstat_disk_util.py
@@ -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
6 plugins/dstat_fan.py
@@ -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'
View
8 plugins/dstat_freespace.py
@@ -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
6 plugins/dstat_gpfs.py
@@ -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
10 plugins/dstat_gpfs_ops.py
@@ -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)
View
9 plugins/dstat_helloworld.py
@@ -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
View
2 plugins/dstat_innodb_buffer.py
@@ -1,3 +1,5 @@
+### Author: Dag Wieers <dag$wieers,com>
+
global mysql_options
mysql_options = os.getenv('DSTAT_MYSQL')
View
2 plugins/dstat_innodb_io.py
@@ -1,3 +1,5 @@
+### Author: Dag Wieers <dag$wieers,com>
+
global mysql_options
mysql_options = os.getenv('DSTAT_MYSQL')
View
2 plugins/dstat_innodb_ops.py
@@ -1,3 +1,5 @@
+### Author: Dag Wieers <dag$wieers,com>
+
global mysql_options
mysql_options = os.getenv('DSTAT_MYSQL')
View
5 plugins/dstat_lustre.py
@@ -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):
View
15 plugins/dstat_memcache_hits.py
@@ -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])
View
28 plugins/dstat_mysql5_com.py → plugins/dstat_mysql5_cmds.py
@@ -1,36 +1,38 @@
-# dstat plugin for MySQL 5 Commands
-# 2007-09-04 - lefred@inuits.be
-global MySQLdb
-import MySQLdb
+### Author: <lefred@inuits.be>
global mysql_user
-global mysql_pwd
mysql_user = os.getenv('DSTAT_MYSQL_USER') or os.getenv('USER')
+global mysql_pwd
mysql_pwd = os.getenv('DSTAT_MYSQL_PWD')
class dstat_plugin(dstat):
+ """
+ Plugin for MySQL 5 commands.
+ """
def __init__(self):
- self.name = 'mysql5 com'
+ self.name = 'mysql5 cmds'
self.type = 'i'
self.width = 5
self.scale = 1
- self.vars = ('Com_select', 'Com_insert','Com_update','Com_delete')
self.nick = ('sel', 'ins','upd','del')
+ self.vars = ('Com_select', 'Com_insert','Com_update','Com_delete')
def check(self):
+ global MySQLdb
+ import MySQLdb
try:
self.db = MySQLdb.connect(user=mysql_user, passwd=mysql_pwd)
- except:
- raise Exception, 'Cannot interface with MySQL server'
+ except Exception, e:
+ raise Exception, 'Cannot interface with MySQL server: %s' % e
def extract(self):
try:
c = self.db.cursor()
for name in self.vars:
- c.execute("""show global status like '%s';""" % name)
- line = c.fetchone()
- if line[0] in self.vars:
- self.set2[line[0]] = int(line[1])
+ c.execute("""show global status like '%s';""" % name)
+ line = c.fetchone()
+ if line[0] in self.vars:
+ self.set2[line[0]] = long(line[1])
for name in self.vars:
self.val[name] = self.set2[name] * 1.0 / elapsed
View
24 plugins/dstat_mysql5_conn.py
@@ -1,27 +1,31 @@
-# dstat plugin for MySQL 5 connections
-# 2007-09-04 - lefred@inuits.be
-global MySQLdb
-import MySQLdb
+### Author: <lefred$inuits,be>
global mysql_user
-global mysql_pwd
mysql_user = os.getenv('DSTAT_MYSQL_USER') or os.getenv('USER')
+
+global mysql_pwd
mysql_pwd = os.getenv('DSTAT_MYSQL_PWD')
class dstat_plugin(dstat):
+ """
+ Plugin for MySQL 5 connections.
+ """
+
def __init__(self):
self.name = 'mysql5 conn'
self.type = 'f'
self.width = 4
self.scale = 1
- self.vars = ('Threads_connected', 'Threads')
self.nick = ('ThCon', '%Con')
+ self.vars = ('Threads_connected', 'Threads')
def check(self):
+ global MySQLdb
+ import MySQLdb
try:
self.db = MySQLdb.connect(user=mysql_user, passwd=mysql_pwd)
- except:
- raise Exception, 'Cannot interface with MySQL server'
+ except Exception, e:
+ raise Exception, 'Cannot interface with MySQL server, %s' % e
def extract(self):
try:
@@ -31,8 +35,8 @@ def extract(self):
c.execute("""show global status like 'Threads_connected';""")
thread = c.fetchone()
if thread[0] in self.vars:
- self.set2[thread[0]] = float(thread[1])
- self.set2['Threads'] = (float(thread[1]) / float(max[1]) * float(100))
+ self.set2[thread[0]] = float(thread[1])
+ self.set2['Threads'] = float(thread[1] / float(max[1]) 1.0 * 100)
for name in self.vars:
self.val[name] = self.set2[name] * 1.0 / elapsed
View
16 plugins/dstat_mysql5_io.py
@@ -1,20 +1,24 @@
-# dstat plugin for MySQL 5 I/O
-# 2007-09-04 - lefred@inuits.be
-global MySQLdb
-import MySQLdb
+### Author: <lefred$inuits,be>
global mysql_user
-global mysql_pwd
mysql_user = os.getenv('DSTAT_MYSQL_USER') or os.getenv('USER')
+
+global mysql_pwd
mysql_pwd = os.getenv('DSTAT_MYSQL_PWD')
class dstat_plugin(dstat):
+ """
+ Plugin for MySQL 5 I/O.
+ """
+
def __init__(self):
self.name = 'mysql5 io'
- self.vars = ('Bytes_received', 'Bytes_sent')
self.nick = ('recv', 'sent')
+ self.vars = ('Bytes_received', 'Bytes_sent')
def check(self):
+ global MySQLdb
+ import MySQLdb
try:
self.db = MySQLdb.connect(user=mysql_user, passwd=mysql_pwd)
except:
View
16 plugins/dstat_mysql5_keys.py
@@ -1,23 +1,27 @@
-# dstat plugin for MySQL 5 Keys
-# 2007-09-04 - lefred@inuits.be
-global MySQLdb
-import MySQLdb
+### Author: <lefred$inuits,be>
global mysql_user
-global mysql_pwd
mysql_user = os.getenv('DSTAT_MYSQL_USER') or os.getenv('USER')
+
+global mysql_pwd
mysql_pwd = os.getenv('DSTAT_MYSQL_PWD')
class dstat_plugin(dstat):
+ """
+ Plugin for MySQL 5 Keys.
+ """
+
def __init__(self):
self.name = 'mysql5 key status'
self.type = 'f'
self.width = 4
self.scale = 1000
- self.vars = ('Key_blocks_used', 'Key_reads', 'Key_writes', 'Key_read_requests', 'Key_write_requests')
self.nick = ('used', 'read', 'writ', 'rreq', 'wreq')
+ self.vars = ('Key_blocks_used', 'Key_reads', 'Key_writes', 'Key_read_requests', 'Key_write_requests')
def check(self):
+ global MySQLdb
+ import MySQLdb
try:
self.db = MySQLdb.connect(user=mysql_user, passwd=mysql_pwd)
except:
View
2 plugins/dstat_mysql_io.py
@@ -4,8 +4,8 @@
class dstat_plugin(dstat):
def __init__(self):
self.name = 'mysql io'
- self.vars = ('Bytes_received', 'Bytes_sent')
self.nick = ('recv', 'sent')
+ self.vars = ('Bytes_received', 'Bytes_sent')
def check(self):
if not os.access('/usr/bin/mysql', os.X_OK):
View
6 plugins/dstat_net_packets.py
@@ -1,4 +1,10 @@
+### Author: Dag Wieers <dag@wieers.com>
+
class dstat_plugin(dstat):
+ """
+ Number of packets received and send per interface.
+ """
+
def __init__(self):
self.type = 'f'
self.width = 5
View
2 plugins/dstat_nfs3.py
@@ -1,3 +1,5 @@
+### Author: Dag Wieers <dag@wieers.com>
+
class dstat_plugin(dstat):
def __init__(self):
self.name = 'nfs3 client'
View
2 plugins/dstat_nfs3_ops.py
@@ -1,3 +1,5 @@
+### Author: Dag Wieers <dag@wieers.com>
+
class dstat_plugin(dstat):
def __init__(self):
self.name = 'extended nfs3 client operations'
View
2 plugins/dstat_nfsd3.py
@@ -1,3 +1,5 @@
+### Author: Dag Wieers <dag@wieers.com>
+
class dstat_plugin(dstat):
def __init__(self):
self.name = 'nfs3 server'
View
2 plugins/dstat_nfsd3_ops.py
@@ -1,3 +1,5 @@
+### Author: Dag Wieers <dag@wieers.com>
+
class dstat_plugin(dstat):
def __init__(self):
self.name = 'extended nfs3 server operations'
View
19 plugins/dstat_ntp.py
@@ -1,12 +1,4 @@
-### Dstat NTP plugin
-### Displays time from an NTP server
-###
-### Authority: dag@wieers.com
-
-### Beware that this dstat plugin typically takes a lot longer to run than
-### system plugins and for that reason it is important to use an NTP server
-### located nearby as well as make sure that it does not impact your other
-### counters too much.
+### Author: Dag Wieers <dag@wieers.com>
global socket
import socket
@@ -18,6 +10,15 @@
### FIXME: Interrupts socket if data is overdue (more than 250ms ?)
class dstat_plugin(dstat):
+ """
+ Time from an NTP server.
+
+ BEWARE: this dstat plugin typically takes a lot longer to run than
+ system plugins and for that reason it is important to use an NTP server
+ located nearby as well as make sure that it does not impact your other
+ counters too much.
+ """
+
def __init__(self):
self.name = 'ntp'
self.timefmt = os.getenv('DSTAT_TIMEFMT') or '%d-%m %H:%M:%S'
View
3 plugins/dstat_postfix.py
@@ -1,5 +1,4 @@
-global glob
-import glob
+### Author: Dag Wieers <dag@wieers.com>
class dstat_plugin(dstat):
def __init__(self):
View
13 plugins/dstat_power.py
@@ -1,9 +1,14 @@
-### Dstat power usage plugin
-### Displays power usage information from ACPI
-###
-### Authority: dag@wieers.com
+### Author: Dag Wieers <dag@wieers.com>
class dstat_plugin(dstat):
+ """
+ Power usage information from ACPI.
+
+ Displays the power usage in mwh of your system's battery using ACPI
+ information. This information is only available when the battery is
+ being used (or being charged).
+ """
+
def __init__(self):
self.name = 'power'
self.type = 'f'
View
6 plugins/dstat_proc_count.py
@@ -1,7 +1,9 @@
-### Dstat Display Process Count plugin
-### Displays the number of processes on a machine
+### Author: Dag Wieers <dag@wieers.com>
class dstat_plugin(dstat):
+ """
+ Total Number of processes on this system.
+ """
def __init__(self):
self.name = 'procs'
self.type = 'd'
View
4 plugins/dstat_rpc.py
@@ -1,3 +1,5 @@
+### Author: Dag Wieers <dag@wieers.com>
+
class dstat_plugin(dstat):
def __init__(self):
self.name = 'rpc client'
@@ -13,8 +15,10 @@ def extract(self):
if not l or l[0] != 'rpc': continue
for i, name in enumerate(self.vars):
self.set2[name] = long(l[i+1])
+
for name in self.vars:
self.val[name] = (self.set2[name] - self.set1[name]) * 1.0 / elapsed
+
if step == op.delay:
self.set1.update(self.set2)
View
4 plugins/dstat_rpcd.py
@@ -1,3 +1,5 @@
+### Author: Dag Wieers <dag@wieers.com>
+
class dstat_plugin(dstat):
def __init__(self):
self.name = 'rpc server'
@@ -13,8 +15,10 @@ def extract(self):
if not l or l[0] != 'rpc': continue
for i, name in enumerate(self.vars):
self.set2[name] = long(l[i+1])
+
for name in self.vars:
self.val[name] = (self.set2[name] - self.set1[name]) * 1.0 / elapsed
+
if step == op.delay:
self.set1.update(self.set2)
View
4 plugins/dstat_sendmail.py
@@ -1,6 +1,6 @@
+### Author: Dag Wieers <dag@wieers.com>
+
### FIXME: Should read /var/log/mail/statistics or /etc/mail/statistics (format ?)
-global glob
-import glob
class dstat_plugin(dstat):
def __init__(self):
View
3 plugins/dstat_snooze.py
@@ -19,8 +19,11 @@ def extract(self):
def show(self):
if self.val['snooze'] > step + 1:
return ansi['default'] + ' -'
+
color = 'white'
if step != op.delay:
color = 'gray'
+
snoze, c = fchg(self.val['snooze'], 7, 1000)
+
return ansi[color] + snoze
View
2 plugins/dstat_thermal.py
@@ -1,3 +1,5 @@
+### Author: Dag Wieers <dag@wieers.com>
+
class dstat_plugin(dstat):
def __init__(self):
self.name = 'thermal'
View
12 plugins/dstat_top_bio.py
@@ -1,9 +1,11 @@
-### Dstat most expensive block I/O process plugin
-### Displays the name of the most expensive block I/O process
-###
-### Authority: dag@wieers.com
+### Author: Dag Wieers <dag@wieers.com>
class dstat_plugin(dstat):
+ """
+ Top most expesnive block I/O process.
+
+ Displays the name of the most expensive block I/O process.
+ """
def __init__(self):
self.name = 'most expensive'
self.type = 's'
@@ -66,7 +68,7 @@ def extract(self):
self.pidset1[pid].update(self.pidset2[pid])
if self.val['usage'] != 0.0:
- self.val['block i/o process'] = '%-*s%s:%s' % (self.width-11, self.val['name'][0:self.width-11], cprint(self.val['read_usage'], 'd', 5, 1024), cprint(self.val['write_usage'], 'd', 5, 1024))
+ self.val['block i/o process'] = '%-*s%s %s' % (self.width-11, self.val['name'][0:self.width-11], cprint(self.val['read_usage'], 'd', 5, 1024), cprint(self.val['write_usage'], 'd', 5, 1024))
### Debug (show PID)
# self.val['block i/o process'] = '%*s %-*s' % (5, self.val['pid'], self.width-6, self.val['name'])
View
14 plugins/dstat_top_cpu.py
@@ -1,11 +1,13 @@
-### Dstat most expensive process plugin
-### Displays the name of the most expensive process
-###
-### Authority: dag@wieers.com
-
-global cpunr
+### Authority: Dag Wieers <dag@wieers.com>
class dstat_plugin(dstat):
+ """
+ Most expensive CPU process.
+
+ Displays the process that uses the CPU the most during the monitored
+ interval. The value displayed is the percentage of CPU time for the total
+ amount of CPU processing power. Based on per process CPU information.
+ """
def __init__(self):
self.name = 'most expensive'
self.type = 's'
View
2 plugins/dstat_top_cputime.py
@@ -65,7 +65,7 @@ def extract(self):
self.pidset1[pid].update(self.pidset2[pid])
if self.val['result'] != 0.0:
- self.val['cputime process'] = '%-*s%s' % (self.width-4, self.val['name'][0:self.width-4], cprint(self.val['result'], 'f', 4, 100))
+ self.val['cputime process'] = '%-*s%s' % (self.width-4, self.val['name'][0:self.width-4], cprint(self.val['result'], 'd', 4, 100))
### Debug (show PID)
# self.val['cputime process'] = '%*s %-*s' % (5, self.val['pid'], self.width-6, self.val['name'])
View
2 plugins/dstat_top_io.py
@@ -67,7 +67,7 @@ def extract(self):
self.pidset1[pid].update(self.pidset2[pid])
if self.val['usage'] != 0.0:
- self.val['i/o process'] = '%-*s%s:%s' % (self.width-11, self.val['name'][0:self.width-11], cprint(self.val['read_usage'], 'd', 5, 1024), cprint(self.val['write_usage'], 'd', 5, 1024))
+ self.val['i/o process'] = '%-*s%s %s' % (self.width-11, self.val['name'][0:self.width-11], cprint(self.val['read_usage'], 'd', 5, 1024), cprint(self.val['write_usage'], 'd', 5, 1024))
### Debug (show PID)
# self.val['i/o process'] = '%*s %-*s' % (5, self.val['pid'], self.width-6, self.val['name'])
View
18 plugins/dstat_top_latency.py
@@ -1,12 +1,16 @@
-### Authority: dag@wieers.com
-
-### For more information, see:
-### http://eaglet.rain.com/rick/linux/schedstat/
+### Authority: Dag Wieers <dag$wieers,com>
class dstat_plugin(dstat):
"""
- Name and total amount of CPU time waited in milliseconds of the process
- that has the highest total amount waited for the measured timeframe.
+ Top process with highest total latency.
+
+ Displays name and total amount of CPU time waited in milliseconds of
+ the process that has the highest total amount waited for the measured
+ timeframe.
+
+ For more information see:
+
+ http://eaglet.rain.com/rick/linux/schedstat/
"""
def __init__(self):
@@ -65,7 +69,7 @@ def extract(self):
self.pidset1[pid].update(self.pidset2[pid])
if self.val['result'] != 0.0:
- self.val['latency process'] = '%-*s%s' % (self.width-4, self.val['name'][0:self.width-4], cprint(self.val['result'], 'f', 4, 100))
+ self.val['latency process'] = '%-*s%s' % (self.width-4, self.val['name'][0:self.width-4], cprint(self.val['result'], 'd', 4, 100))
### Debug (show PID)
# self.val['latency process'] = '%*s %-*s' % (5, self.val['pid'], self.width-6, self.val['name'])
View
12 plugins/dstat_top_mem.py
@@ -1,9 +1,13 @@
-### Dstat most expensive process plugin
-### Displays the name of the most expensive process
-###
-### Authority: dag@wieers.com
+### Authority: Dag Wieers <dag$wieers,com>
class dstat_plugin(dstat):
+ """
+ Most expensive CPU process.
+
+ Displays the process that uses the CPU the most during the monitored
+ interval. The value displayed is the percentage of CPU time for the total
+ amount of CPU processing power. Based on per process CPU information.
+ """
def __init__(self):
self.name = 'most expensive'
self.type = 's'
View
3 plugins/dstat_top_oom.py
@@ -3,6 +3,9 @@
###
### Authority: dag@wieers.com
+### More information:
+### http://lwn.net/Articles/317814/
+
class dstat_plugin(dstat):
def __init__(self):
self.name = 'out of memory'

0 comments on commit 05609f5

Please sign in to comment.
Something went wrong with that request. Please try again.