]> git.itanic.dy.fi Git - rrdd/log
rrdd
12 years agoscheduler: Rename check_update_need() to get_outdated_db()
Timo Kokkonen [Sat, 14 Apr 2012 17:32:34 +0000 (20:32 +0300)]
scheduler: Rename check_update_need() to get_outdated_db()

The new name is more descriptive with respect what the function
actually does.

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
12 years agoRemove redundant strerror usage
Timo Kokkonen [Sat, 14 Apr 2012 12:06:52 +0000 (15:06 +0300)]
Remove redundant strerror usage

It is preferred to use '%m' with printf instead.

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
12 years agoprocess: Improve error handling
Timo Kokkonen [Sat, 14 Apr 2012 12:01:19 +0000 (15:01 +0300)]
process: Improve error handling

Check the error message from select(). If error, bail out.

Also close all file descriptors in the end. If select happends to fail
and we go to waitpid() and the process is writing content, it might
eventually block because nobody is reading the file descriptor. By
closing the file we ensure the process will not hang and there will be
no deadlock.

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
12 years agorrdtool: Reduce excess parallelism
Timo Kokkonen [Thu, 12 Apr 2012 18:52:09 +0000 (21:52 +0300)]
rrdtool: Reduce excess parallelism

Right now all commands are run "as parallel as possible", up to the
point images are being drawn while the databases are still
updated. This leads to problems where the image drawing finishes
before databases are read, thus the image contains always the
information from the last update instead of current.

This patch modifies the behavior so that when the database is being
updated, the drawing does not beging before the update has
succeeded.

Furthermore, image drawings are not done fully parallel. If they were,
the temporary file would be always renamed before there was any chance
that the actual image rendering was finished. Instead, rename is
synchronized with the image drawing.

As a consequence total parallelism is greatly reduced. This obviously
slows down update and image drawing process greatly on machines that
have many CPUs, that would otherwise benefit greatly from being able
to all actions in parallel. The maximum number of parallel actions is
practically limited to the number of databases that are being operated
with. The correctness of the operations is however more important than
maximising parallelism.

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
12 years agodebug.h: Add timestamps to debug prints
Timo Kokkonen [Thu, 12 Apr 2012 18:47:24 +0000 (21:47 +0300)]
debug.h: Add timestamps to debug prints

This is useful when someone needs to run rrdd for long time and debug
the behavior from logs. Especially timing issues become easier to
understand once the timestamps are visible.

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
12 years agorrdtool_draw_image: Avoid corrupting image files
Timo Kokkonen [Wed, 11 Apr 2012 17:46:29 +0000 (20:46 +0300)]
rrdtool_draw_image: Avoid corrupting image files

As rrdtool is creating the image file it does appear to modify always
the contents of the existing file. This leads to a potential race
condition where someone is reading the current image contents and then
rrdtool changes the contents while the reader is still in the process
of the reading the old contents. If that happens, the image file
appears to be corrupted due to the fact that it contains a mixture of
the old and new image data.

Fix the issue by creating a temporary file where the image is created
and then replacing the target file with the temp file only after
rrdtool has finished drawing all of the image. This ensures reader
will be accessing either the old or new image contents, newer
something that is a mixture of those two.

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
12 years agoAdd "other" memory counter
Timo Kokkonen [Wed, 22 Feb 2012 20:09:33 +0000 (22:09 +0200)]
Add "other" memory counter

The current memory counters taken from proc/meminfo don't add up
taking the entire usable physical memory. There is always a little bit
of memory left out from the equation that doesn't sum up. In some
situations that can be actualyl quite significant. Now this "Other"
memory has its own counter and the total amount of height of the
memory graph stays constant over time.

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
12 years agoscript_parser: Print number of read bytes in the info message
Timo Kokkonen [Wed, 22 Feb 2012 20:07:20 +0000 (22:07 +0200)]
script_parser: Print number of read bytes in the info message

This is not strictly necessary, but might be useful. It also hides the
compiler warning about setting a variable but not reading it ever that
has become visible since gcc-4.6.

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
12 years agomem_parser: Replace zero pointer with NULL
Timo Kokkonen [Wed, 22 Feb 2012 20:04:13 +0000 (22:04 +0200)]
mem_parser: Replace zero pointer with NULL

This is more grammatically correc.

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
12 years agostring.c: Use existing string helpers
Timo Kokkonen [Wed, 22 Feb 2012 20:02:02 +0000 (22:02 +0200)]
string.c: Use existing string helpers

Since we have those fancy helpers, why not use them? Also, add one
extra for skipping float nubers for extra handiness.

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
12 years agostring.h: Use defintions from ctype.h when applicable
Timo Kokkonen [Wed, 22 Feb 2012 19:59:49 +0000 (21:59 +0200)]
string.h: Use defintions from ctype.h when applicable

This improves code readability and maintainability without costing
anything.

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
12 years agodatabase.h: Clean up default path names
Timo Kokkonen [Wed, 22 Feb 2012 16:05:43 +0000 (18:05 +0200)]
database.h: Clean up default path names

Replace the default SYSINFO_PATH with something more generic. Also,
apply the path to whereever it applies.

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
12 years agodatabase.h: Add time variable to DEFINE_IMAGE macro
Timo Kokkonen [Sat, 3 Sep 2011 07:49:34 +0000 (10:49 +0300)]
database.h: Add time variable to DEFINE_IMAGE macro

It will make it possible to conviniently define how many
days/weeks/months/years to draw in the image. It is no longer needed
to have the unit fixed to 1.

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
12 years agosanitize_rrd_update_data: Ensure minus sign is not forgotten
Timo Kokkonen [Sat, 25 Jun 2011 11:25:20 +0000 (14:25 +0300)]
sanitize_rrd_update_data: Ensure minus sign is not forgotten

Fix a simple bug which caused the minus sign to be removed from the
sanitized output.

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
13 years agoparser: Use long long when parsing net stats
Timo Kokkonen [Wed, 6 Apr 2011 14:57:49 +0000 (17:57 +0300)]
parser: Use long long when parsing net stats

It might be sufficient to use unsigned long in 32 bit environment, but
in order to avoid any issues with overflows, long long is safer.

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
13 years agodatabase.h: Multiple fixes
Timo Kokkonen [Sun, 3 Apr 2011 09:54:36 +0000 (12:54 +0300)]
database.h: Multiple fixes

-Network rate multiplier changes dynamically (k, M, G)

-Memory statistics base is 1024 instead of 1000

-Network autoscale minimum is 0

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
13 years agoRename database.h.example to database.h
Timo Kokkonen [Sun, 3 Apr 2011 09:49:54 +0000 (12:49 +0300)]
Rename database.h.example to database.h

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
13 years agorrdtool_update_data: Sanitize input data before passing to rrdtool
Timo Kokkonen [Sun, 3 Apr 2011 09:21:16 +0000 (12:21 +0300)]
rrdtool_update_data: Sanitize input data before passing to rrdtool

If there is any non-numberic data in the input data, replace them with
'U' so that rrdtool doesn't refuse the entire input data set.

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
13 years agostring: Add functions to skip numbers and non-numbers
Timo Kokkonen [Sun, 3 Apr 2011 09:20:10 +0000 (12:20 +0300)]
string: Add functions to skip numbers and non-numbers

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
13 years agodatabase.h.example: Add network statistics
Timo Kokkonen [Sun, 27 Mar 2011 20:19:34 +0000 (23:19 +0300)]
database.h.example: Add network statistics

Read statistics for eth0 and eth0

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
13 years agodatabase.h.example: Add macro for generating rrd source and archives
Timo Kokkonen [Sun, 27 Mar 2011 20:16:24 +0000 (23:16 +0300)]
database.h.example: Add macro for generating rrd source and archives

This reduces significantly the numer of lines in the database.h file.
It also improves readability significantly due to reduced line number
count.

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
13 years agoparser: Add network parser
Timo Kokkonen [Sun, 27 Mar 2011 19:52:52 +0000 (22:52 +0300)]
parser: Add network parser

This can be used for parsing network statistics from /proc/net/dev
interface. The desired interface is defined by giving string pointers
to interface names.

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
13 years agodec_to_longlong: Return values should be long long
Timo Kokkonen [Sun, 27 Mar 2011 16:04:27 +0000 (19:04 +0300)]
dec_to_longlong: Return values should be long long

Otherwise the return value might warp aroung.

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
13 years agodatabase.h.example: Add macro to fill rrd_image structures
Timo Kokkonen [Sun, 13 Mar 2011 09:27:00 +0000 (11:27 +0200)]
database.h.example: Add macro to fill rrd_image structures

This reduces massively the number of lines and makes it much easier to
add new images.

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
13 years agorrdtool: Print out the image that is being drawn
Timo Kokkonen [Sun, 13 Mar 2011 09:20:53 +0000 (11:20 +0200)]
rrdtool: Print out the image that is being drawn

This makes debugging easier in case some of the images get drawn
correctly and some don't.

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
13 years agodatabase.h.example: Update example data
Timo Kokkonen [Fri, 11 Mar 2011 21:20:43 +0000 (23:20 +0200)]
database.h.example: Update example data

Some typo fixes and improvements

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
13 years agoparser: Add support for a script parser
Timo Kokkonen [Fri, 11 Mar 2011 21:16:51 +0000 (23:16 +0200)]
parser: Add support for a script parser

This parser will simply run some command and assume the command writes
the rrd tool data as is to stdout.

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
13 years agoprocess.c: Ensure stderr gets read after process has died
Timo Kokkonen [Fri, 11 Mar 2011 20:07:56 +0000 (22:07 +0200)]
process.c: Ensure stderr gets read after process has died

For some reason select() doesn't indicate that stderr might contain
bytes that can be read. Workaround for the issue is to read stderr
just in case after we receive EOF from stdin.

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
13 years agoparser: Define maximum length for the rrd data
Timo Kokkonen [Fri, 11 Mar 2011 13:50:43 +0000 (15:50 +0200)]
parser: Define maximum length for the rrd data

This makes makes buffer overruns harder.

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
13 years agoparser: Add extra pointer to parse function prototype
Timo Kokkonen [Fri, 11 Mar 2011 13:20:13 +0000 (15:20 +0200)]
parser: Add extra pointer to parse function prototype

This pointer makes it possible to feed some data to the parser, such
as command line parameters.

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
13 years agodatabase.h.example: Add information to allow database creation
Timo Kokkonen [Mon, 7 Mar 2011 16:00:28 +0000 (18:00 +0200)]
database.h.example: Add information to allow database creation

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
13 years agoMakefile: Typo fix
Timo Kokkonen [Mon, 7 Mar 2011 15:52:49 +0000 (17:52 +0200)]
Makefile: Typo fix

Make quiet linkin work

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
13 years agoAdd support for creating rrd databases in case the file is missing
Timo Kokkonen [Sun, 6 Mar 2011 17:05:24 +0000 (19:05 +0200)]
Add support for creating rrd databases in case the file is missing

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
13 years agorrdtool: Improve argument list modification macro
Timo Kokkonen [Mon, 7 Mar 2011 08:24:08 +0000 (10:24 +0200)]
rrdtool: Improve argument list modification macro

The name of the macro was not very descriptive, "add_arg" describes
the functionality much better.

Instead of modifying some magic function variables, give the variables
as parameters to the macro. This makes it much more clear how the
thing actually works.

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
13 years agorrdtool: Replace repeating strings with a definition
Timo Kokkonen [Mon, 7 Mar 2011 08:20:15 +0000 (10:20 +0200)]
rrdtool: Replace repeating strings with a definition

The command path should be in a defintion, in case one wants to change
it.

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
13 years agoMove rrd_database structure under rrdtool.h
Timo Kokkonen [Sun, 6 Mar 2011 16:48:13 +0000 (18:48 +0200)]
Move rrd_database structure under rrdtool.h

Keep all rrdtool related structure definitions under this one header
file.

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
13 years agoCollect all rrdtool handling in one file
Timo Kokkonen [Sun, 6 Mar 2011 16:31:00 +0000 (18:31 +0200)]
Collect all rrdtool handling in one file

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
13 years agodatabase.h.example: Avoid pathname repeatitions
Timo Kokkonen [Sun, 6 Mar 2011 13:13:43 +0000 (15:13 +0200)]
database.h.example: Avoid pathname repeatitions

This way it is much easier to modify the default paths.

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
13 years agoRename testadata.h to database.h
Timo Kokkonen [Sun, 6 Mar 2011 12:54:54 +0000 (14:54 +0200)]
Rename testadata.h to database.h

This is probably a more descriptive name.

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
13 years agoMakefile: Fixes
Timo Kokkonen [Sun, 6 Mar 2011 10:19:43 +0000 (12:19 +0200)]
Makefile: Fixes

Proper dependency checking. Improved pretty printing.

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
14 years agoOrthogonalize CPU graph colors
Timo Kokkonen [Thu, 8 Oct 2009 19:41:35 +0000 (22:41 +0300)]
Orthogonalize CPU graph colors

Otherwise IO and USER load might get mixed up

14 years agoChange default memory graph colors
Timo Kokkonen [Thu, 8 Oct 2009 17:11:20 +0000 (20:11 +0300)]
Change default memory graph colors

Swap is better to be in red, as red is "bad". Thus, buffers and swap
colors are now reversed.

14 years agoUse long long instead of ints when parsing cpu tics
Timo Kokkonen [Thu, 1 Oct 2009 11:15:10 +0000 (14:15 +0300)]
Use long long instead of ints when parsing cpu tics

This fixes a problem with overwrapping counters on 32bit architectures.

14 years agoUpdate testdata.h.example to support swap
Timo Kokkonen [Sun, 20 Sep 2009 16:53:45 +0000 (19:53 +0300)]
Update testdata.h.example to support swap

14 years agoAdd support for reading swap usage from meminfo
Timo Kokkonen [Thu, 17 Sep 2009 19:27:02 +0000 (22:27 +0300)]
Add support for reading swap usage from meminfo

15 years agoPrint which command is to be executed
Timo Kokkonen [Wed, 21 May 2008 17:39:44 +0000 (20:39 +0300)]
Print which command is to be executed

15 years agoChange debug message output
Timo Kokkonen [Wed, 21 May 2008 17:18:46 +0000 (20:18 +0300)]
Change debug message output

15 years agoRename get_process_count() to get_sibling_count()
Timo Kokkonen [Wed, 21 May 2008 17:15:41 +0000 (20:15 +0300)]
Rename get_process_count() to get_sibling_count()

15 years agoUse pointers properly
Timo Kokkonen [Wed, 21 May 2008 17:12:43 +0000 (20:12 +0300)]
Use pointers properly

15 years agoAdd primitive error detection to digitemp parser
Timo Kokkonen [Wed, 21 May 2008 17:11:07 +0000 (20:11 +0300)]
Add primitive error detection to digitemp parser

15 years agoFix debug message indenting bug
Timo Kokkonen [Wed, 21 May 2008 16:51:14 +0000 (19:51 +0300)]
Fix debug message indenting bug

15 years agoCount number of sibling processes
Timo Kokkonen [Wed, 21 May 2008 16:49:48 +0000 (19:49 +0300)]
Count number of sibling processes

15 years agoOpen read streams for reading
Timo Kokkonen [Wed, 21 May 2008 16:28:18 +0000 (19:28 +0300)]
Open read streams for reading

15 years agoPrettify printing of pid numbers on debug messages
Timo Kokkonen [Wed, 21 May 2008 15:15:05 +0000 (18:15 +0300)]
Prettify printing of pid numbers on debug messages

15 years ago.gitignore update
Timo Kokkonen [Sun, 18 May 2008 17:30:27 +0000 (20:30 +0300)]
.gitignore update

15 years agoAdd missing newline
Timo Kokkonen [Sun, 18 May 2008 17:14:21 +0000 (20:14 +0300)]
Add missing newline

15 years agoAdd .gitignore
Timo Kokkonen [Sun, 18 May 2008 17:09:25 +0000 (20:09 +0300)]
Add .gitignore

15 years agoImprove piped process executing
Timo Kokkonen [Sun, 18 May 2008 17:07:18 +0000 (20:07 +0300)]
Improve piped process executing

Allow all standard streams to be piped back to the parent
process. Modifies also the run() function to print the pid of the
process which printed the output.

15 years agoAutoindent debug messages according to parent count
Timo Kokkonen [Sun, 18 May 2008 17:04:47 +0000 (20:04 +0300)]
Autoindent debug messages according to parent count

15 years agoImprove dependency handling
Timo Kokkonen [Sun, 18 May 2008 14:07:51 +0000 (17:07 +0300)]
Improve dependency handling

15 years agoSuppress warning messages about missing dependency files
Timo Kokkonen [Sun, 18 May 2008 13:42:40 +0000 (16:42 +0300)]
Suppress warning messages about missing dependency files

16 years agoFix count number of children correctly
Timo Kokkonen [Sun, 6 Apr 2008 09:14:38 +0000 (12:14 +0300)]
Fix count number of children correctly

16 years agoMake all debug output go through wrappers
Timo Kokkonen [Sun, 6 Apr 2008 08:29:36 +0000 (11:29 +0300)]
Make all debug output go through wrappers

16 years agoMove all fork operations to do_fork() functino
Timo Kokkonen [Sun, 6 Apr 2008 06:49:44 +0000 (09:49 +0300)]
Move all fork operations to do_fork() functino

16 years agoMove string manipulation functions to string.c
Timo Kokkonen [Thu, 3 Apr 2008 19:36:25 +0000 (22:36 +0300)]
Move string manipulation functions to string.c

16 years agoAdd fork debug and clear any child's child_count to zero after fork
Timo Kokkonen [Thu, 3 Apr 2008 19:29:15 +0000 (22:29 +0300)]
Add fork debug and clear any child's child_count to zero after fork

16 years agoMakefile verbosity change
Timo Kokkonen [Thu, 3 Apr 2008 19:28:02 +0000 (22:28 +0300)]
Makefile verbosity change

16 years agoSuppress warning messages
Timo Kokkonen [Tue, 1 Apr 2008 18:08:52 +0000 (21:08 +0300)]
Suppress warning messages

16 years agoRemove debug output
Timo Kokkonen [Tue, 1 Apr 2008 18:04:22 +0000 (21:04 +0300)]
Remove debug output

16 years agoFix digitemp parser
Timo Kokkonen [Tue, 1 Apr 2008 18:03:33 +0000 (21:03 +0300)]
Fix digitemp parser

16 years agoSuppress excess make verbosity
Timo Kokkonen [Mon, 31 Mar 2008 19:56:49 +0000 (22:56 +0300)]
Suppress excess make verbosity

16 years agoAdd support for stupid digitemp parser
Timo Kokkonen [Mon, 31 Mar 2008 18:51:49 +0000 (21:51 +0300)]
Add support for stupid digitemp parser

16 years agoEnsure proper dependency creation when only headers change
Timo Kokkonen [Mon, 31 Mar 2008 18:51:14 +0000 (21:51 +0300)]
Ensure proper dependency creation when only headers change

16 years agoAdd missing parameter
Timo Kokkonen [Mon, 31 Mar 2008 18:49:46 +0000 (21:49 +0300)]
Add missing parameter

16 years agoRemove commented code and update
Timo Kokkonen [Mon, 31 Mar 2008 17:51:10 +0000 (20:51 +0300)]
Remove commented code and update

16 years agoAdd digitemp parser
Timo Kokkonen [Mon, 31 Mar 2008 17:50:31 +0000 (20:50 +0300)]
Add digitemp parser

16 years agoAdd support for executing process while piping std{in,out} to parent
Timo Kokkonen [Mon, 31 Mar 2008 17:48:30 +0000 (20:48 +0300)]
Add support for executing process while piping std{in,out} to parent

16 years agoMake dependency check automatic
Timo Kokkonen [Mon, 31 Mar 2008 14:50:49 +0000 (17:50 +0300)]
Make dependency check automatic

16 years agoRename testdata.h to testadata.h.example
Timo Kokkonen [Sun, 30 Mar 2008 10:22:40 +0000 (13:22 +0300)]
Rename testdata.h to testadata.h.example

16 years agoInitial comit
Timo Kokkonen [Sun, 30 Mar 2008 10:16:43 +0000 (13:16 +0300)]
Initial comit