Added sketch of tools.
authorStanislaw Klekot <dozzie@jarowit.net>
Mon, 21 Oct 2013 17:40:50 +0000 (19:40 +0200)
committerStanislaw Klekot <dozzie@jarowit.net>
Mon, 21 Oct 2013 17:40:50 +0000 (19:40 +0200)
notes.txt [new file with mode: 0644]
optparse_sample.py [new file with mode: 0644]
rrdcollect [new file with mode: 0755]
rrdplot [new file with mode: 0755]

diff --git a/notes.txt b/notes.txt
new file mode 100644 (file)
index 0000000..80c9f7c
--- /dev/null
+++ b/notes.txt
@@ -0,0 +1,4 @@
+man:
+  * rrdtune
+  * rrdlast
+
diff --git a/optparse_sample.py b/optparse_sample.py
new file mode 100644 (file)
index 0000000..d18918b
--- /dev/null
@@ -0,0 +1,26 @@
+import optparse
+
+o = optparse.OptionParser(
+  usage = '%prog [options] tree.yaml',
+  #description = '',
+)
+
+o.set_defaults(dump_format = 'json')
+
+o.add_option(
+  '--yaml',
+  action = 'store_const', dest = 'dump_format', const = 'yaml',
+  help = 'dump in YAML format',
+)
+o.add_option(
+  '--json',
+  action = 'store_const', dest = 'dump_format', const = 'json',
+  help = 'dump in JSON format (default)',
+)
+
+opts, args = o.parse_args()
+
+if len(args) == 0:
+  o.error("tree.yaml not specified")
+
+print opts.dump_format
diff --git a/rrdcollect b/rrdcollect
new file mode 100755 (executable)
index 0000000..7ad13e5
--- /dev/null
@@ -0,0 +1,45 @@
+#!/usr/bin/python
+
+import sys
+import rrdtool
+import json
+
+#-----------------------------------------------------------------------------
+
+# stream = { ... }
+# data = '%(time)d:%(bytes)d:%(packets)d' % stream
+# rrdtool.update(rrd_file, data)
+
+#-----------------------------------------------------------------------------
+#
+# something | rrdcollect [options ...] file.rrd
+#
+# options:
+#   --raw
+#   --json
+#   --modmon-event
+#
+#   --interval=10 | --interval=detect
+#
+#   --unknown-threshold=50%  (XFF)
+#   --values=value1:gauge,value2:derive,...
+#   --aggregator=average | maximum | minimum | avg | max | min | last
+#   --period=...    (multiple times)
+#     --period=1h,30s    (1 hour, precision: 30s (number of PDPs calculated
+#                        from precision and $interval))
+#     --period=1h        (1 hour, precision: $interval)
+#     --period=1h,calc   (1 hour, precision calculated regarding previous
+#                        period spec (or $interval if none))
+#
+#   periods: (TODO: include one unit more in archive)
+#      1 hour          every $interval
+#     24 hours          24 * $interval
+#      7 days       7 * 24 * $interval
+#     30 days      30 * 24 * $interval
+#     12 months   365 * 24 * $interval
+#
+#   --ds=... (raw DS spec)
+#   --rra=... (raw RRA spec)
+#
+#-----------------------------------------------------------------------------
+# vim:ft=python:foldmethod=marker
diff --git a/rrdplot b/rrdplot
new file mode 100755 (executable)
index 0000000..963fee8
--- /dev/null
+++ b/rrdplot
@@ -0,0 +1,18 @@
+#!/usr/bin/python
+
+import sys
+import rrdtool
+import json
+
+import pygtk
+pygtk.require('2.0')
+import gtk
+
+#-----------------------------------------------------------------------------
+
+# stream = { ... }
+# data = '%(time)d:%(bytes)d:%(packets)d' % stream
+# rrdtool.update(rrd_file, data)
+
+#-----------------------------------------------------------------------------
+# vim:ft=python:foldmethod=marker