help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

cfrun on "User defined module"


From: Harish Chauhan
Subject: cfrun on "User defined module"
Date: Thu, 22 Apr 2004 20:25:59 -0400


Hi,

My "cfrun.hosts" file looks like as shown below:

------------------------
domain=my.x.com
outputdir=/my_dir
maxchild=10

<host1>         --just
<host>         -- just
<host3>
<host4>
------------------------

where  <host1> and <host2> belongs to soft class defined by "aix_5_1" but <host3> and <host4> belongs to logical cluster which is identified by the user defined module.

when I execute the command  "/opt/cfengine/bin/cfrun -T -- tidy  --<logical_cluster_name>, I don't get the right results.

I want to execute "tidy" opertation on my logical cluster machines only. Can any body suggest the way to to that?

Thanks in advance.
Regards, Harish



help-cfengine-request@gnu.org
Sent by: help-cfengine-bounces+harish=us.ibm.com@gnu.org

04/19/2004 10:07 AM
Please respond to help-cfengine

       
        To:        help-cfengine@gnu.org
        cc:        
        Subject:        Help-cfengine Digest, Vol 17, Issue 16

       


Send Help-cfengine mailing list submissions to
                help-cfengine@gnu.org

To subscribe or unsubscribe via the World Wide Web, visit
                http://mail.gnu.org/mailman/listinfo/help-cfengine
or, via email, send a message with subject or body 'help' to
                help-cfengine-request@gnu.org

You can reach the person managing the list at
                help-cfengine-owner@gnu.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Help-cfengine digest..."


Today's Topics:

  1. Re: embedded scripts [was: cfengine ideology question]
     (Steve Feehan)
  2. RE: methods and scripts [was: Re: cfengine ideology question]
     (Nielsen, Steve)
  3. hostname in cfengine-log (Harish Chauhan)
  4. Re: hostname in cfengine-log (Russell Adams)
  5. OutputPrefix (Brendan Strejcek)
  6. editfiles (James Treleaven)
  7. REPOST: something wrong with time classes (Kurt Lieber)
  8. Re: REPOST: something wrong with time classes (Russell Adams)
  9. Re: REPOST: something wrong with time classes
     (Mark.Burgess@iu.hio.no)
 10. method error (Adolfo Abalo Cascallar)


----------------------------------------------------------------------

Message: 1
Date: Fri, 16 Apr 2004 09:53:33 -0400
From: Steve Feehan <sfeehan@sbb.uvm.edu>
Subject: Re: embedded scripts [was: cfengine ideology question]
To: Brendan Strejcek <brendan@cs.uchicago.edu>
Cc: help-cfengine@gnu.org
Message-ID: <20040416135333.GA617@ingress.sbb.uvm.edu>
Content-Type: text/plain; charset=us-ascii

On Thu, Apr 15, 2004 at 12:55:29PM -0500, Brendan Strejcek wrote:
>
> cfengine actually already has this functionality, though it is sort of
> a hack. You can use multiline shellcommands. For example:
>

Are multiline shellcommands a 2.x feature? I'm still using 1.6.5
and cant seem to get even a simple multiline shellcommand to work.

--
Steve Feehan




------------------------------

Message: 2
Date: Fri, 16 Apr 2004 10:35:01 -0400
From: "Nielsen, Steve" <SNielsen@comscore.com>
Subject: RE: methods and scripts [was: Re: cfengine ideology question]
To: "Tim Nelson" <sysadmin@sunet.com.au>, "Billy Allan"
                <billy@elec.gla.ac.uk>
Cc: help-cfengine@gnu.org
Message-ID:
                <66E9FEE99E96034ABB4DE197A927DBF101CC1DAC@csiadmail01.office.comscore.com>
               
Content-Type: text/plain;                 charset="iso-8859-1"

Can you share how you use Text::Template in your cfengine setup? I have been wanting to do this. I have not attempted anything yet.

Steve

-----Original Message-----
From: Tim Nelson [mailto:sysadmin@sunet.com.au]
Sent: Thursday, April 15, 2004 6:29 PM
To: Billy Allan
Cc: help-cfengine@gnu.org
Subject: methods and scripts [was: Re: cfengine ideology question]


On Thu, 15 Apr 2004, Billy Allan wrote:

> On Thu, Apr 15, 2004 at 08:54:19AM +0200, Mark.Burgess@iu.hio.no wrote:
> > The advantage of cfengine actions is their predictable behaviour
> > and reproducibility, so it is best to use them if possible.
> > However, cfengine does not make very specialized script writing easy
> > and it is therefore necessary to call other scripts within the cfengine
> > framework. That allows you to
> >  - keep everything in one place
> >  - organize the script runs in relation to other config stuff
> >  - borrow some of the safety features of cfengine
> >
> > Recently "methods" were introduced in cfengine to allow more
> > complex behaviours in cfengine scripts, but even with these there
> > will be times when your own script is better.
>
> I haven't been following the "methods" stuff - something new to play
> with!  :-)
>
> On another note though, I was wondering if it might be useful to be able
> to embed small scripts in an arbitory scripting language
> (shell/perl/python/whatever) in a conf file and have cfengine call the
> interpretor.

                I can actually do each of your examples with my current setup, in
a manner of speaking.  The perl stuff I can do because I'm using perl's
Text::Template on my cfengine config files before I send them out
(server-side).  The shell stuff I can do in the shellcommands section
(client-side).  I might also be able to do perl one-liners with
shellcommands too.  
                Sorry to all on the list if it sounds like I keep harping on the
Text::Template, but sometimes, it is the answer to the question :).  

                Mark, is there a way to do here-documents as input to
shellcommands?  eg, something like:
-------------------------
shellcommands:
                any::
                                 <<EOT
....perl code here...
EOT
                                 > "perl"
-------------------------

                ...where "perl" is the shellcommand, > is redirection, and the
<<EOT EOT stuf are the here document markers.  The would also achieve the
functionality that this guy wants.  

[examples snipped]

> It might help reduce the cruft of little scripts which tend to appear on
> machines over time?

                I have a directory one my central server called ..../local/bin and
use the cfengine copy stanza to copy things from there to each individual
machine as appropriate.  

                :)

--
Tim Nelson
Systems Administrator
Sunet Internet
Tel: +61 3 5241 1155
Fax: +61 3 5241 6187
Web: http://www.sunet.com.au/
Email: sysadmin@sunet.com.au




_______________________________________________
Help-cfengine mailing list
Help-cfengine@gnu.org
http://mail.gnu.org/mailman/listinfo/help-cfengine




------------------------------

Message: 3
Date: Fri, 16 Apr 2004 13:27:01 -0400
From: Harish Chauhan <Harish_Chauhan@in.ibm.com>
Subject: hostname in cfengine-log
To: help-cfengine@gnu.org
Message-ID:
                <OFB9C360A5.E58119E4-ON85256E5F.00677B4B-85256E78.005FDBDE@us.ibm.com>
Content-Type: text/plain; charset="us-ascii"

Hi,

How can I enable cfengine to pre-append hostname in all the log lines.
This will help in greping for a specific error in the log along with the
hostname .

Any ideas ?

Looking forward to your reply...

Regards, Harish
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.gnu.org/pipermail/help-cfengine/attachments/20040416/fd602452/attachment.htm

------------------------------

Message: 4
Date: Fri, 16 Apr 2004 12:37:28 -0500
From: Russell Adams <RLAdams@Kelsey-Seybold.com>
Subject: Re: hostname in cfengine-log
To: help-cfengine@gnu.org
Message-ID: <20040416173728.GB3988@soja.ksnet.com.>
Content-Type: text/plain;                 charset=us-ascii

Funny, I didn't see this in the cfengine-Reference info page, but I
pulled it out of another config.

control:

                OutputPrefix = ( "cf:$(host)" )


Russell

On Fri, Apr 16, 2004 at 01:27:01PM -0400, Harish Chauhan wrote:
>
> Hi,
>
> How can I enable cfengine to pre-append hostname in all the log lines.
> This will help in greping for a specific error in the log along with the
> hostname .
>
> Any ideas ?
>
> Looking forward to your reply...
>
> Regards, Harish

> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@gnu.org
> http://mail.gnu.org/mailman/listinfo/help-cfengine





------------------------------

Message: 5
Date: Fri, 16 Apr 2004 18:08:32 -0500
From: Brendan Strejcek <brendan@cs.uchicago.edu>
Subject: OutputPrefix
To: help-cfengine@gnu.org
Message-ID: <20040416230832.GH2452@belmont.cs.uchicago.edu>
Content-Type: text/plain; charset=us-ascii

This is very nice! I have been wanting a way to reclaim those wasted
columns in mailed cfexecd reports. It doesn't seem to like an empty
string value though ( "" ) (or rather, it uses the default if you set it
to such a value) so the best I have been able to get is:

OutputPrefix = ( a )

   a: Executing script...

rather than

   cfengine:hostname:: Executing script...

Those columns are valuable!

This variable is there in the reference under "Special variables".

   http://www.cfengine.org/docs/cfengine-Reference.html#Special%20variables

Maybe it should also be under the section for cfexecd, as that is what
you are configuring with it.

Thanks for pointing it out.




------------------------------

Message: 6
Date: Fri, 16 Apr 2004 19:04:32 -0400
From: James Treleaven <jametrel@enoreo.on.ca>
Subject: editfiles
To: help-cfengine@gnu.org
Message-ID: <c5pooa$prm$1@sea.gmane.org>
Content-Type: text/plain; charset=us-ascii; format=flowed

I know this list gets a lot of questions about the 'editfiles'
functionality, and I really have looked hard at the docs before posting
this.

I have found that the approach described by Jamie Wilkinson
(http://www.shipyard.com.au/articles/sysadmin/cfengine-configfiles.py)
works for me, but I suspect there is a better way.

Should it really take me 9 lines to code 'Make sure SyslogFacility is
set to AUTHPRIV in /etc/ssh/sshd_config' as he does it:
---
      BeginGroupIfNoLineMatching '^SyslogFacility.*'
        Append 'SyslogFacility'
      EndGroup
      ResetSearch 1
      LocateLineMatching '^SyslogFacility.*'
      BeginGroupIfNoMatch '^SyslogFacility AUTHPRIV$'
        ReplaceLineWith 'SyslogFacility AUTHPRIV'
      EndGroup
      ResetSearch 1
---

If any of you cfengine gurus wish to share a better idiom, I would
appreciate it.

thanks,
James





------------------------------

Message: 7
Date: Sun, 18 Apr 2004 07:40:13 -0400
From: Kurt Lieber <klieber@gentoo.org>
Subject: REPOST: something wrong with time classes
To: help-cfengine@gnu.org
Message-ID: <20040418114013.GA16487@mail.lieber.org>
Content-Type: text/plain; charset="iso-8859-1"

All -- reposting since I'm still having a problem with this.  Any
assistance is appreciated.

--kurt

----- Forwarded message from Kurt Lieber <klieber@gentoo.org> -----

Date: Thu, 15 Apr 2004 21:50:30 -0400
From: Kurt Lieber <klieber@gentoo.org>
To: help-cfengine@gnu.org
Subject: something wrong with time classes

I'm trying to set up a time class that runs every two hours.  So far, I
have:

# TIME DEFINITIONS
t_on00 = ( Min00_05 Min05_10 )

t_everyhour_00 = ( t_on00 )

t_on15 = ( Min15_20 Min20_25 )

t_on30 = ( Min30_35 Min35_40 )

t_on45 = ( Min45_50 Min50_55 )

t_on00::

   t_every2hours_00 = ( Hr00 Hr02 Hr04 Hr06 Hr08 Hr10 Hr12 Hr14 Hr16 Hr18 Hr20 Hr22 )

The goal is to define a class that will only run on even hours, between :00
and :10.

However, it's not working.  I have a block of code that is called via:

_fileperms._glsamakerserver.(t_every2hours_00|run_glsamakertest)::

But it never gets executed automatically.  Only if I run cfagent
-Drun_glsamakertest. (I've ensured that cfagent is executing at the correct
times)

I obviously have something dorked up with the time classes, but I don't
know what.

Any help is appreciated.

--kurt
               




----- End forwarded message -----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.gnu.org/pipermail/help-cfengine/attachments/20040418/9fdf1243/attachment.pgp

------------------------------

Message: 8
Date: Sun, 18 Apr 2004 14:00:00 -0500
From: Russell Adams <RLAdams@Kelsey-Seybold.com>
Subject: Re: REPOST: something wrong with time classes
To: help-cfengine@gnu.org
Message-ID: <20040418190000.GE29728@soja.ksnet.com.>
Content-Type: text/plain;                 charset=us-ascii

How are you running cfengine in the background?

Via cron, or cfexecd -g? If you're using cfexecd, whats the schedule
set to?

Russell

On Sun, Apr 18, 2004 at 06:40:13AM -0500, Kurt Lieber wrote:
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@gnu.org
> http://mail.gnu.org/mailman/listinfo/help-cfengine
>

> Date: Sun, 18 Apr 2004 06:45:14 -0500
> Subject:
>
>

> All -- reposting since I'm still having a problem with this.  Any
> assistance is appreciated.
>
> --kurt
>
> ----- Forwarded message from Kurt Lieber <klieber@gentoo.org> -----
>
> Date: Thu, 15 Apr 2004 21:50:30 -0400
> From: Kurt Lieber <klieber@gentoo.org>
> To: help-cfengine@gnu.org
> Subject: something wrong with time classes
>
> I'm trying to set up a time class that runs every two hours.  So far, I
> have:
>
> # TIME DEFINITIONS
> t_on00 = ( Min00_05 Min05_10 )
>
> t_everyhour_00 = ( t_on00 )
>
> t_on15 = ( Min15_20 Min20_25 )
>
> t_on30 = ( Min30_35 Min35_40 )
>
> t_on45 = ( Min45_50 Min50_55 )
>
> t_on00::
>
>     t_every2hours_00 = ( Hr00 Hr02 Hr04 Hr06 Hr08 Hr10 Hr12 Hr14 Hr16 Hr18 Hr20 Hr22 )
>
> The goal is to define a class that will only run on even hours, between :00
> and :10.
>
> However, it's not working.  I have a block of code that is called via:
>
> _fileperms._glsamakerserver.(t_every2hours_00|run_glsamakertest)::
>
> But it never gets executed automatically.  Only if I run cfagent
> -Drun_glsamakertest. (I've ensured that cfagent is executing at the correct
> times)
>
> I obviously have something dorked up with the time classes, but I don't
> know what.
>
> Any help is appreciated.
>
> --kurt
>                  
>
>
>
>
> ----- End forwarded message -----






------------------------------

Message: 9
Date: Sun, 18 Apr 2004 22:37:12 +0200 (MEST)
From: Mark.Burgess@iu.hio.no
Subject: Re: REPOST: something wrong with time classes
To: RLAdams@Kelsey-Seybold.com
Cc: help-cfengine@gnu.org
Message-ID: <200404182037.i3IKbClV019747@nexus.iu.hio.no>
Content-Type: TEXT/plain; charset=us-ascii


So, assuming that you run exactly at 00 in cron, you want

t_on00.t_every2hours_00::

Another way (if you don't know when the agent runs) is to use ifelapsed locks set to 120 minutes.

M

On 18 Apr, Russell Adams wrote:
> How are you running cfengine in the background?
>
> Via cron, or cfexecd -g? If you're using cfexecd, whats the schedule
> set to?
>
> Russell
>
> On Sun, Apr 18, 2004 at 06:40:13AM -0500, Kurt Lieber wrote:
>> _______________________________________________
>> Help-cfengine mailing list
>> Help-cfengine@gnu.org
>> http://mail.gnu.org/mailman/listinfo/help-cfengine
>>
>
>> Date: Sun, 18 Apr 2004 06:45:14 -0500
>> Subject:
>>
>>
>
>> All -- reposting since I'm still having a problem with this.  Any
>> assistance is appreciated.
>>
>> --kurt
>>
>> ----- Forwarded message from Kurt Lieber <klieber@gentoo.org> -----
>>
>> Date: Thu, 15 Apr 2004 21:50:30 -0400
>> From: Kurt Lieber <klieber@gentoo.org>
>> To: help-cfengine@gnu.org
>> Subject: something wrong with time classes
>>
>> I'm trying to set up a time class that runs every two hours.  So far, I
>> have:
>>
>> # TIME DEFINITIONS
>> t_on00 = ( Min00_05 Min05_10 )
>>
>> t_everyhour_00 = ( t_on00 )
>>
>> t_on15 = ( Min15_20 Min20_25 )
>>
>> t_on30 = ( Min30_35 Min35_40 )
>>
>> t_on45 = ( Min45_50 Min50_55 )
>>
>> t_on00::
>>
>>     t_every2hours_00 = ( Hr00 Hr02 Hr04 Hr06 Hr08 Hr10 Hr12 Hr14 Hr16 Hr18 Hr20 Hr22 )
>>
>> The goal is to define a class that will only run on even hours, between :00
>> and :10.
>>
>> However, it's not working.  I have a block of code that is called via:
>>
>> _fileperms._glsamakerserver.(t_every2hours_00|run_glsamakertest)::
>>
>> But it never gets executed automatically.  Only if I run cfagent
>> -Drun_glsamakertest. (I've ensured that cfagent is executing at the correct
>> times)
>>
>> I obviously have something dorked up with the time classes, but I don't
>> know what.
>>
>> Any help is appreciated.
>>
>> --kurt
>>                  
>>
>>
>>
>>
>> ----- End forwarded message -----
>
>
>
>
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@gnu.org
> http://mail.gnu.org/mailman/listinfo/help-cfengine



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Work: +47 22453272            Email:  Mark.Burgess@iu.hio.no
Fax : +47 22453205            WWW  :  http://www.iu.hio.no/~mark
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





------------------------------

Message: 10
Date: Mon, 19 Apr 2004 13:27:59 +0200
From: Adolfo Abalo Cascallar <aabalo@tid.es>
Subject: method error
To: Ayuda cfengine <help-cfengine@gnu.org>
Message-ID: <1082374076.2084.37.camel@PointBreak.hi.inet>
Content-Type: text/plain


  Hi:

  2 questions... :-)

  One is if there are some option to force cfengine to use IP numbers,
not the hostname...


  and two: I_m trying to use the methods sequence but the example that
I found on the reference manual doesn't work...

  I use cfengine 2.1.3 over Solaris 5.8.

  Anybody knows why?

  Thanks,

Adolfo Abalo


----- ERROR:

Examining child's incoming
(localhost_localhost_SimpleMethod_MD5=37a6259cc0c1dae299a7866489dff0bd)
This request came from localhost - our reply should be sent there!
cfengine:: Could not open a parameter bundle
(/var/cfengine/rpc_in/::1_10.95.23.136_SimpleMethod_) while counting
attachments
Number of return arguments (0) does not match template (1)
Discarding method SimpleMethod
cfengine:: No valid incoming request to execute method (SimpleMethod)

-----
My cfagent.conf:

methods:
     
any::

 SimpleMethod(null)

   action="">    returnvars=null
   returnclasses=null
   server=localhost

--- cf.mover:
                                                                            control:

  MethodName = ( SimpleMethod )

  MethodParameters = ( null )

  actionsequence = ( timezone )

alerts:

 "Este metodo mueve"

 ReturnVariables(void)
 ReturnClasses(void)







------------------------------

_______________________________________________
Help-cfengine mailing list
Help-cfengine@gnu.org
http://mail.gnu.org/mailman/listinfo/help-cfengine


End of Help-cfengine Digest, Vol 17, Issue 16
*********************************************


reply via email to

[Prev in Thread] Current Thread [Next in Thread]