-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 16.11.2005, at 16:10, Norland, Martin wrote:
Baltasar Cevc wrote:
Look for the mon.d directory and create a new file named not.monitor
or whatever you like, with the following contents:
- ---
#!<full path to perl executable> -w
use strict;
my $monitordir = $0;
$monitordir =~ s|/[^/]+$||;
exit ! system($monitordir.'/'.shift @ARGV, @ARGV);
Wouldn't a 'not monitor' need to handle error codes / messages
gracefully - wouldn't this only work properly if the original monitor
exits normally?
I think it would be better to check the exit code and return it !'d
only
if there were no actual errors generated (actual errors, as opposed to
unsuccessful status).
cheers,
Well, actually the only use case I had in mind when quickly writing
down these lines was the mentioned firewall check. It was more or less
just some code to underline what I mean.
But to comment your suggestion: I think I don't get what you mean.
Is it about parsing the monitor output and adjusting the exit code
depending on the error?
If it's that, I would not agree. When should a monitor not exit - I
assume we should get a code even on very bad acassions like segfaults
or similar. As the compiler generates that code (or the interpreter in
our case), it should be a sane code (thus not 0, whicht means that it
would be false), shouldn't it?
Checking any specific messages or error codes would foil the goal to
have a generic monitor we can just prepend to any existing one.
Baltasar
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)
iD8DBQFDe1Q3p2YsmzTbIwYRAtcRAJ9SWWQv59/tR2brcSGg7z7XDjAtgwCfVxLO
7Xv776t3UfkymFbkR2bn7jU=
=cQhb
-----END PGP SIGNATURE-----
_______________________________________________
mon mailing list
mon@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/mon