[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Enhancement for cfrun
From: |
Jochen Reinwand |
Subject: |
Enhancement for cfrun |
Date: |
Tue, 26 Mar 2002 13:55:49 +0100 |
Hi,
I don't know if this is the right list to post my message, but it's seems to
be the best place.
I have a feature request and attached a small patch to show you, what I want.
The patch is only a small hack, but I wanted to make sure that it is perhaps
included in cfengine before I put a lot of work in it for nothing.
The problem I had with cfrun is very simple:
In our computer pool we have a lot of workstations running under Linux and
Solaris and they all should be configured in a centralized way by a powerful
tool. Well, when looking for such a tool the best you can find out there is,
of course, cfengine <g>
But in our pool we want to use cfengine in the more unusual way that cfrun is
started as a cron job on the server and forces the clients to run cfagent
instead of running cfagent via cron on every client. This has a lot of
advantages in our pool. But there is one thing missing that would make having
a good report of all machines very easy.
Since I don't want a serialized cfrun I used the following switches in
cfrun.hosts:
outputdir=<where the output of all hosts should go>
maxchild=<number of parallel cfagents>
The cfrun command looks as follows:
cfrun -T > /dev/null 2>&1
It is not really a good idea to read the parallel cfrun output of hundred's
of machines. So I prefer to ignore it.
After cfrun has ended, I want to make a summary of all clients by using the
files in the outputdir. So the best is to ignore zero length files which
should meen ignoring machines where nothing was done by cfagent. But exactly
there is the problem! Clients that were unreachable or refused the connection
also have a zero file size! I never will get a note that this clients are not
configured. I found no possibility to somehow get this kind of information
out of cfrun. Parsing the sdtout output of cfrun with a huge Perl script is
really not what I would prefer to do. I thought the best way of making it
possible would be that cfrun also writes messages about errors that lead to
an abort on the host to the output file. Then you can detect this hosts by
looking at the output files.
The attached patch is a small hack to make this possible. It's some kind of
special mode of cfrun that could be used by the parameter -V at the command
line. It is against cfengine-2.0.0, but there are no problems in patching
http://www.cfengine.org/src-mirror/cfrun.c with it since there is only one
line different between the two versions.
Some additions I would like to add to the patch:
- Instead of the parameter -V it would be useful to make an entry to
cfrun.hosts, like "VerboseFileLog=on".
- The if-fprint construct should be replaced by a function like FileLog().
- Write the output prefixed by "cfrun: " so that everyone can see it is not
from cfagent on the client.
Any suggestions or comments?
Is there a chance to get this feature included in cfengine after I cleaned up
the patch?
Continue writing such a great tool!
regards
Jochen
cfengine-2.0.0-VerboseFileLog.diff
Description: Text Data
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Enhancement for cfrun,
Jochen Reinwand <=