List Info

Thread: Re: How to print running configuration?




Re: How to print running configuration?
country flaguser name
United States
2007-04-26 06:52:00
> -----Original Message-----
> From: amavis-user-bounceslists.sourceforge.net 
> [mailto:amavis-user-bounceslists.sourceforge.net] On
Behalf 
> Of Mauro G. Todeschini
> Sent: Thursday, April 26, 2007 5:15 AM
> To: amavis-userlists.sourceforge.net
> Subject: [AMaViS-user] How to print running
configuration?
> 
> 
> Hi,
> 	is there a way to print amavisd-new current
configuration?
> I mean the values of all configuration variables (like

> $mydomain and so on). I imagine this is a FAQ... but I

> couldn't find an answer yet :(

?

 cat /usr/sbin/amavisd /etc/amavisd.conf | egrep '$' | lpr

____________________________________________________________
_____________
This email has been scanned and certified safe by
SpammerTrap(tm). 
For Information please see http://www.spammertrap.com

____________________________________________________________
_____________

------------------------------------------------------------
-------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and
take
control of your XML. No limits. Just data. Click to get it
now.
http://sourcefor
ge.net/powerbar/db2/
_______________________________________________
AMaViS-user mailing list
AMaViS-userlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amavis-user

AMaViS-FAQ:http://www.amav
is.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/ho
wto/

Re: How to print running configuration?
country flaguser name
United States
2007-04-26 07:40:52
> 	is there a way to print amavisd-new current
configuration?
> I mean the values of all configuration variables (like

> $mydomain and so on). I imagine this is a FAQ... but I

> couldn't find an answer yet :(



> cat /usr/sbin/amavisd /etc/amavisd.conf | egrep '$' |
lpr

Well, that gets you everything with a $

Try this to get the variables: 
cat /usr/sbin/amavisd /etc/amavisd.conf | egrep '^$' 

------------------------------------------------------------
-------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and
take
control of your XML. No limits. Just data. Click to get it
now.
http://sourcefor
ge.net/powerbar/db2/
_______________________________________________
AMaViS-user mailing list
AMaViS-userlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amavis-user

AMaViS-FAQ:http://www.amav
is.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/ho
wto/

Re: How to print running configuration?
user name
2007-04-26 07:42:32
Michael Scheidell wrote:
>> Hi,
>> 	is there a way to print amavisd-new current
configuration?
>> I mean the values of all configuration variables
(like 
>> $mydomain and so on). I imagine this is a FAQ...
but I 
>> couldn't find an answer yet :(
> 
> ?
> 
>  cat /usr/sbin/amavisd /etc/amavisd.conf | egrep '$' |
lpr

Ok you are suggesting to grep the source, but I was looking
for a
cleaner solution only for variables and their values at
run-time.
My problem is that I'm not really sure that a variable has
the value I
imagine and I'd like to check at runtime.
For example with your method I dont' know the value of
$warnvirussender,
and the output is very dirty and not at runtime.
I was looking for a command that dumps variables at runtime
or a switch
for the daemon to get the dump in logs or on the console.
I checked the "debug" switch but It doesn't do
what I'm looking for.
Other hints?

Bye and Thanks

-- 
Mauro G. Todeschini

------------------------------------------------------------
-------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and
take
control of your XML. No limits. Just data. Click to get it
now.
http://sourcefor
ge.net/powerbar/db2/
_______________________________________________
AMaViS-user mailing list
AMaViS-userlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amavis-user

AMaViS-FAQ:http://www.amav
is.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/ho
wto/

Re: How to print running configuration?
country flaguser name
United States
2007-04-26 08:39:43
Mauro wrote:

> Michael Scheidell wrote:
>>> Hi,
>>>      is there a way to print amavisd-new
current configuration?
>>> I mean the values of all configuration
variables (like 
>>> $mydomain and so on). I imagine this is a
FAQ... but I 
>>> couldn't find an answer yet :(
>> 
>> ?
>> 
>>  cat /usr/sbin/amavisd /etc/amavisd.conf | egrep
'$' | lpr

> Ok you are suggesting to grep the source, but I was
looking for a
> cleaner solution only for variables and their values at
run-time.
> My problem is that I'm not really sure that a variable
has the value I
> imagine and I'd like to check at runtime.
> For example with your method I dont' know the value of
$warnvirussender,
> and the output is very dirty and not at runtime.
> I was looking for a command that dumps variables at
runtime or a switch
> for the daemon to get the dump in logs or on the
console.
> I checked the "debug" switch but It doesn't
do what I'm looking for.
> Other hints?

> Bye and Thanks

Sounds like a feature request for a handy Perl utility.

Gary V



Gary V


------------------------------------------------------------
-------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and
take
control of your XML. No limits. Just data. Click to get it
now.
http://sourcefor
ge.net/powerbar/db2/
_______________________________________________
AMaViS-user mailing list
AMaViS-userlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amavis-user

AMaViS-FAQ:http://www.amav
is.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/ho
wto/

Re: How to print running configuration?
user name
2007-04-26 08:56:19
On Thu, 2007-04-26 at 14:42 +0200, Mauro G. Todeschini
wrote:
> Michael Scheidell wrote:
> >> Hi,
> >> 	is there a way to print amavisd-new current
configuration?
> >> I mean the values of all configuration
variables (like 
> >> $mydomain and so on). I imagine this is a
FAQ... but I 
> >> couldn't find an answer yet :(
> > 
> > ?
> > 
> >  cat /usr/sbin/amavisd /etc/amavisd.conf | egrep
'$' | lpr
> 
> Ok you are suggesting to grep the source,

Well, the config file....
>  but I was looking for a
> cleaner solution only for variables and their values at
run-time.
> My problem is that I'm not really sure that a variable
has the value I
> imagine and I'd like to check at runtime.


ok...
perl -d /usr/sbin/amavisd
1> b (some point in the code where everything is
defined)
2> r
3> p $warnvirussender

-- 
Daniel J McDonald, CCIE # 2495, CISSP # 78281, CNX
Austin Energy
http://www.austinenergy.c
om

------------------------------------------------------------
-------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and
take
control of your XML. No limits. Just data. Click to get it
now.
http://sourcefor
ge.net/powerbar/db2/
_______________________________________________
AMaViS-user mailing list
AMaViS-userlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amavis-user

AMaViS-FAQ:http://www.amav
is.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/ho
wto/

Re: How to print running configuration?
user name
2007-04-26 09:15:53
On 26/04/07 13:42, Mauro G. Todeschini wrote:
> Ok you are suggesting to grep the source, but I was
looking for a
> cleaner solution only for variables and their values at
run-time.
> My problem is that I'm not really sure that a variable
has the value I
> imagine and I'd like to check at runtime.
> For example with your method I dont' know the value of
$warnvirussender,
> and the output is very dirty and not at runtime.
> I was looking for a command that dumps variables at
runtime or a switch
> for the daemon to get the dump in logs or on the
console.
> I checked the "debug" switch but It doesn't
do what I'm looking for.
> Other hints?

Here's what I came up with.  This dumps all the
configuration variables as
they are after amavisd has parsed the configuration file;
it's up to you to
find what you want in that.  I wouldn't describe this as
cleaner, and it
comes with no guarantees that it won't do anything nasty.

(echo 'package Amavis::Conf; use Data:umper;
$Data:umper:eepcopy
=
$Data:umper::T
erse = 1; read_config(); foreach(keys(%EXPORT_TAGS)) {print
"   $_:n"; foreach({$EXPORT_TAGS{$_}}) {print
"$_ = "; s/^([%])/\$1/;
print Dumper(eval $_)}} exit;'; cat /usr/local/sbin/amavisd)
| perl

Replace /usr/local/sbin/amavisd as appropriate.

-- 
Martin Orr

------------------------------------------------------------
-------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and
take
control of your XML. No limits. Just data. Click to get it
now.
http://sourcefor
ge.net/powerbar/db2/
_______________________________________________
AMaViS-user mailing list
AMaViS-userlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amavis-user

AMaViS-FAQ:http://www.amav
is.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/ho
wto/

Re: How to print running configuration?
user name
2007-04-26 10:10:48
Martin Orr wrote:
> On 26/04/07 13:42, Mauro G. Todeschini wrote:
>> Ok you are suggesting to grep the source, but I was
looking for a
>> cleaner solution only for variables and their
values at run-time.
>> My problem is that I'm not really sure that a
variable has the value I
>> imagine and I'd like to check at runtime.
>> For example with your method I dont' know the value
of $warnvirussender,
>> and the output is very dirty and not at runtime.
>> I was looking for a command that dumps variables at
runtime or a switch
>> for the daemon to get the dump in logs or on the
console.
>> I checked the "debug" switch but It
doesn't do what I'm looking for.
>> Other hints?
> 
> Here's what I came up with.  This dumps all the
configuration variables as
> they are after amavisd has parsed the configuration
file; it's up to you to
> find what you want in that.  I wouldn't describe this
as cleaner, and it
> comes with no guarantees that it won't do anything
nasty.
> 
> (echo 'package Amavis::Conf; use Data:umper;
$Data:umper:eepcopy
=
> $Data:umper::T
erse = 1; read_config(); foreach(keys(%EXPORT_TAGS)) {print
> "   $_:n"; foreach({$EXPORT_TAGS{$_}}) {print
"$_ = "; s/^([%])/\$1/;
> print Dumper(eval $_)}} exit;'; cat
/usr/local/sbin/amavisd) | perl
> 
> Replace /usr/local/sbin/amavisd as appropriate.

Thanks, I tryed but got this error:

test-ux:~# (echo 'package Amavis::Conf; use Data:umper;
$Data:umper:eepcopy
= $Data:umper::T
erse = 1; read_config();
foreach(keys(%EXPORT_TAGS)) {print "   $_:n";
foreach({$EXPORT_TAGS{$_}}) {print "$_ = ";
s/^([%])/\$1/; print
Dumper(eval $_)}} exit;'; cat /usr/sbin/amavisd-new) | perl

No entry "warnvirussender" in policy bank
"" at - line 379
        Amavis::Conf::c('warnvirussender') called at - line
1302
        Amavis::Conf::read_config() called at - line 1


Bye

-- 
Mauro G. Todeschini

------------------------------------------------------------
-------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and
take
control of your XML. No limits. Just data. Click to get it
now.
http://sourcefor
ge.net/powerbar/db2/
_______________________________________________
AMaViS-user mailing list
AMaViS-userlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amavis-user

AMaViS-FAQ:http://www.amav
is.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/ho
wto/

Re: How to print running configuration?
country flaguser name
Germany
2007-04-26 10:12:53
On Thu, 26 Apr 2007, Martin Orr wrote:

> Here's what I came up with.  This dumps all the
configuration variables as
> they are after amavisd has parsed the configuration
file; it's up to you to
> find what you want in that.  I wouldn't describe this
as cleaner, and it
> comes with no guarantees that it won't do anything
nasty.
>
> (echo 'package Amavis::Conf; use Data:umper;
$Data:umper:eepcopy
=
> $Data:umper::T
erse = 1; read_config(); foreach(keys(%EXPORT_TAGS)) {print
> "   $_:n"; foreach({$EXPORT_TAGS{$_}}) {print
"$_ = "; s/^([%])/\$1/;
> print Dumper(eval $_)}} exit;'; cat
/usr/local/sbin/amavisd) | perl
>
> Replace /usr/local/sbin/amavisd as appropriate.
>
>

I had to insert the path to the config_file:


  read_config(/etc/amavisd.conf)

To get the output a little bit more useable I inserted a
sort:

   foreach(sort {$EXPORT_TAGS{$_}})


Michael Storz
--
======================================================
Leibniz-Rechenzentrum      |    <mailto:Storzlrz.de>
Boltzmannstr. 1            |    Fax: +49 89 35831-9700
85748 Garching / Germany   |    Tel: +49 89 35831-8840
======================================================

------------------------------------------------------------
-------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and
take
control of your XML. No limits. Just data. Click to get it
now.
http://sourcefor
ge.net/powerbar/db2/
_______________________________________________
AMaViS-user mailing list
AMaViS-userlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amavis-user

AMaViS-FAQ:http://www.amav
is.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/ho
wto/

Re: How to print running configuration?
country flaguser name
Germany
2007-04-26 10:16:30
On Thu, 26 Apr 2007, Mauro G. Todeschini wrote:

> Thanks, I tryed but got this error:
>
> test-ux:~# (echo 'package Amavis::Conf; use Data:umper;
> $Data:umper:eepcopy
= $Data:umper::T
erse = 1; read_config();
> foreach(keys(%EXPORT_TAGS)) {print "  
$_:n";
> foreach({$EXPORT_TAGS{$_}}) {print "$_ =
"; s/^([%])/\$1/; print
> Dumper(eval $_)}} exit;'; cat /usr/sbin/amavisd-new) |
perl
>
> No entry "warnvirussender" in policy bank
"" at - line 379
>         Amavis::Conf::c('warnvirussender') called at -
line 1302
>         Amavis::Conf::read_config() called at - line 1

I had to double the  when I run the command from the
shell:

   s/^([%])/\\$1/;


Maybe this helps.
Michael Storz
--
======================================================
Leibniz-Rechenzentrum      |    <mailto:Storzlrz.de>
Boltzmannstr. 1            |    Fax: +49 89 35831-9700
85748 Garching / Germany   |    Tel: +49 89 35831-8840
======================================================

------------------------------------------------------------
-------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and
take
control of your XML. No limits. Just data. Click to get it
now.
http://sourcefor
ge.net/powerbar/db2/
_______________________________________________
AMaViS-user mailing list
AMaViS-userlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amavis-user

AMaViS-FAQ:http://www.amav
is.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/ho
wto/

[1-9]

about | contact  Other archives ( Real Estate discussion Medical topics )