Define a class from a group of machines

2010-08-31 Thread Mike Svoboda
Hey guys I’m trying to define a “test class” where I will be performing changes on before I push to everything. I think I’m making this overly complicated, but I’m having issues creating a “group” or “class” of machines. Does anyone have an example using Cfengine 3 syntax? Here’s what I’m cu

Re: Define a class from a group of machines

2010-08-31 Thread Mike Svoboda
Disregard! My question was answered here. I needed to canonify the hostname to use underscores. https://cfengine.com/forum/read.php?3,18006 Thanks Mike On 8/31/10 4:09 PM, "Mike Svoboda" wrote: Hey guys I’m trying to define a “test class” where I will be performing changes on

Best way to gracefully stop cfengine daemons?

2010-09-03 Thread Mike Svoboda
Is there a preferred way of stopping cf-serverd and cf-execd so they exit in a graceful manor? Should I be sending a kill –15 to the daemons, or is there a better way of letting them “clean up and finish” in a non-disruptive manor. Thanks! Mike ___ H

Re: Cfengine Help: Re: Best way to gracefully stop cfengine daemons?

2010-09-03 Thread Mike Svoboda
Ah. I noticed that performing a kill -15 on cf-serverd, a client was in mid-transfer of some new configs. I checked on the client that spewed some errors via cf-execd, and indeed, there were files on the client that were in bad shape. Maybe a feature request to have a "graceful shutdown" so cf-s

Executing a script to define a global variable

2010-09-08 Thread Mike Svoboda
The machines I’m executing cf-agent on have multiple NICs online. I can’t trust $(sys.ipv4) to return the “correct” address. I can use $(sys.ipv4[interface_name]) to find the correct address, but with Solaris using different names for the NIC based upon the driver, this becomes messy. I’ve be

Re: Executing a script to define a global variable

2010-09-08 Thread Mike Svoboda
Disregard. Execresult is the function I’m looking for. Thanks On 9/8/10 2:06 PM, "Mike Svoboda" wrote: The machines I’m executing cf-agent on have multiple NICs online. I can’t trust $(sys.ipv4) to return the “correct” address. I can use $(sys.ipv4[interface_name]) to find t

Understanding how to use methods / bundles

2010-09-23 Thread Mike Svoboda
Hey fellow cfengineers! Have a question and hope that this helps some other folks out as well. In my promises.cf, I define my inputs and bundlesequence as such: $ more promises.cf ... ... body common control { bundlesequence => { @(global.agent_sequence) }; inputs => {

Re: Understanding how to use methods / bundles

2010-09-23 Thread Mike Svoboda
Help? This is kind of critical as it will determine the methodology on our execution of bundles from promises.cf... Its kind of concerning that cf-agent will let it fly but cf-know barfs. On 9/23/10 12:41 PM, "Mike Svoboda" wrote: Hey fellow cfengineers! Have a question and hope

I'm exploiting usemodule. There has got to be a better way to define global classes?

2010-10-05 Thread Mike Svoboda
This is an awful hack, but its how I am currently defining global classes from a non-global scope... bundle agent process_single_bundle(policy_name) { ... ... methods: some_class_defined:: "any" usebundle=> define_global_class("$(policy_name)_weapons_free");

Force variables to be defined after classes?

2010-10-07 Thread Mike Svoboda
I’m trying to define a variable if it matches a class. The below code doesn’t work. $ cat test.cf body common control { bundlesequence => { testit }; } bundle agent testit { vars: class_to_test_on:: "testfile" string => "/var/tmp/testfile";

Populate a class using an slist fails?

2010-10-13 Thread Mike Svoboda
Why doesn’t this work? Classes are evaluated after variables? The hostname of the box I’m running this on in canonical form is esv4_cfe_guppy. $ cat test.cf body common control { bundlesequence => { testit }; } # bundle common global { vars: "test_boxes"slist =>

Re: Cfengine Help: Re: Populate a class using an slist fails?

2010-10-14 Thread Mike Svoboda
Thanks Neil. You are the man. I didn't realize that classes could be combined this way. It would be cool if an example like this could be added to the reference manual. On 10/14/10 9:27 AM, "no-re...@cfengine.com" wrote: > Forum: Cfengine Help > Subject: Re: Populate a class using an slist

Cfengine 3.0.5p1 daemons spinning CPU to 100% on 1 host out of 800

2010-11-19 Thread Mike Svoboda
I’ve deployed Cfengine 3.0.5p1 across 800 hosts. I only have an issue with the Cfengine daemons on 1 box where it appears I am hitting a bug. On this machine, it spins a single core to 100% user space CPU utilization. Here are the details. $ /var/cfengine/bin/cf-agent -v ... f3 ---

Re: Cfengine Help: cf-execd: is daemon or cron better?

2010-12-01 Thread Mike Svoboda
For what its worth, I originally had been running cf-execd as a daemon managed by a Solaris 10 SMF service This ended up being a bad idea. When cf-execd, cf-agent spawn child processes -- all of these processes are inherited by the same Solaris "contract id". This means if you have a module that

Re: Cfengine Help: Re: Cfengine Help: cf-execd: is daemon or cron better?

2010-12-02 Thread Mike Svoboda
Yeah, but whats the point of using SMF if you're just going to "set it and forget it?" The power of SMF is that you want it to restart things when they have abnormal exit statuses. If you plan on using a transient SMF status that doesn't monitor the health of the process, then you might as well j

Re: Cfengine Help: Does anyone know how to make cfengine report from only one network interface?

2010-12-07 Thread Mike Svoboda
Check out "bindtointerface" in the reference guide. 5.2.8 bindtointerface Type: string Allowed input range: .* Synopsis: Use this interface for outgoing connections Example: bindtointerface => "192.168.1.1"; Notes: On multi-homed hosts, the server and client can bind to a specific interface for se

Re: Cfengine Help: Re: cf-serverd launches multiple instances from inittab on Solaris 10?

2010-12-10 Thread Mike Svoboda
Steve: I put a entry into root's crontab to run cf-agent hourly. In promises.cf, I have a policy that verifies cf-serverd is online. If its not, I start it and report on it. I would suggest from not using SMF or /etc/inittab. On 12/9/10 3:09 PM, "no-re...@cfengine.com" wrote: > Forum: Cfe

Feature request: add a flag to enable bug reporting / automatic submission

2011-01-06 Thread Mike Svoboda
Hey Cfengine folks I thought it would be a cool idea if we could add a flag to the various Cfengine executables that would enable bug reporting and (possibly?) automatic bug submission over https. When administrators end up with segfaulting daemons, memory leaks, etc — I think there would be

Re: Cfengine Help: Re: Feature request: add a flag to enable bug reporting / automatic submission

2011-01-07 Thread Mike Svoboda
Well, Cfengine is a mature product, but there is new code being introduced that causes bugs. Maybe since Linux seems to be the primary platform that the bits are developed on, tested against, and packages provided for -- that seems to be the most stable platform. I've been running Cfengine on Sol

Re: Cfengine Help: Re: Feature request: add a flag to enable bug reporting / automatic submission

2011-01-07 Thread Mike Svoboda
the test framework, > and when you find a bug, create a test that demonstrates the bug by failing, > but which will also pass if the bug is gone. > > -Dan > > On Jan 7, 2011, at 10:56 AM, Mike Svoboda wrote: > >> Well, Cfengine is a mature product, but there is

Lastseen in body agent control per documentation isn't valid

2011-01-14 Thread Mike Svoboda
Per the documentation, lastseen is supposed to belong in body agent control if you want to enable it. http://www.cfengine.org/manuals/cf3-reference.html#lastseen-in-reports So, I did. In my promises.cf, I’ve got the following: body agent control { ... lastseen=>

Cf-agent holding open hundreds of network sockets open

2011-01-19 Thread Mike Svoboda
I’ve enabled my Cfengine infrastructure to perform 2 way data transfers. My clients are configured to run cf-serverd, so my Master Policy Server can login to pull some files off of each machine. To accomplish this, I execute two policies. * policy 1 extracts all the clients the MPS has s

Re: Cf-agent holding open hundreds of network sockets open

2011-01-19 Thread Mike Svoboda
atermark. Since > such model would require too much efforts to implement, more > straightforward solution is to create feature request about some sort > of keepalive => "false"; option in body copy_from. > > 2011/1/19 Mike Svoboda : >> I¹ve enabled my Cfengine infrast

Re: Cfengine Help: Re: FYI, you should check RAM usage of your Cfengine daemons

2011-01-21 Thread Mike Svoboda
Here is a Solaris x64 host $ /var/cfengine/bin/cf-agent --version This comprises cf-agent core community version 3.1.2 - Copyright Copyright (C) Cfengine AS 2008,2010- $ ldd /var/cfengine/bin/cf-monitord libpromises.so.1 => /var/cfengine/lib/libpromises.so.1 libpthread.so.1

Re: Cfengine Help: Re: Cfengine Help: Re: FYI, you should check RAM usage of your Cfengine daemons

2011-01-21 Thread Mike Svoboda
I'll have to recompile to give it a shot. My real focus is trying to upgrade the production infrastructure to 3.1.3.. On 1/21/11 10:57 AM, "no-re...@cfengine.com" wrote: > Forum: Cfengine Help > Subject: Re: Cfengine Help: Re: FYI, you should check RAM usage of your > Cfengine daemons > Au

Versions of dependencies for building 3.1.3?

2011-01-26 Thread Mike Svoboda
Hey folks I was trying to get an idea / might be cool to include in the release notes the versions of dependencies that people have had success running 3.1.3 on. (pcre, openssl, berkeleydb, flex, etc.) I’m running into a weird issue where my x86 hosts aren’t having any issue with 3.1.3 runnin

Re: Cfengine Help: cfengine rpm spec file

2011-01-27 Thread Mike Svoboda
IMHO, stick with the provided RPM. Its nice that Cfengine delivers this to the Linux folks, and I wish more pre-built packages for other Unix O/S’s are available. If you use the provided bits, it provides a known baseline for submitting bug reports. When we have to compile, we’re building aga

What SVN hooks do you use in pre-commit / post-commit?

2011-01-28 Thread Mike Svoboda
I’m using a SVN hook on post-commit to send a email to a bunch of important folks with the SVN diff / files changed when I make a merge into my production Cfengine branch. What cool tricks are other folks using on pre-commit / post-commit. Anyone checking / creating JIRA tickets, validating th

Anyone have good examples of a dist based class?

2011-02-14 Thread Mike Svoboda
I’d like to learn how to use dist to create classes. Really, I want to look at a text file, and select a random entry from it. I’ve heard this is possible using dist. Does anyone have any good examples of using dist to pick entries from a file? I’d like to see an example of picking one entry

OpenSSL errors on a 3.1.4 MPS

2011-02-14 Thread Mike Svoboda
I’ve upgraded all my clients to run version 3.1.4. My MPS have been chilling on 3.0.5p1. This setup works, although, I have to bounce cf-serverd daily because of memory leaks. When I upgrade my MPS to 3.1.4, I start running into OpenSSL errors. Here’s a client trying to pull down new configs

Re: proper logging for cfengine processes

2011-03-05 Thread Mike Svoboda
Hey Jake I think you're missing the point here. If you are trying to figure out what Cfengine is doing, by looking at the output of cf-agent -I, then you're going too deep. Here's an example of what Neil was suggesting "/root/.ssh/authorized_keys" perms=>mog("0

How to extract values (not keys) from an array to slist?

2011-03-16 Thread Mike Svoboda
So, I can use getindexes() to extract the indexes of an array into an slist. I need to do the opposite, and extract just the values. Anyone have a working solution? I just need to be able to create an slist with all of the values of the array. Thanks Mike _

Re: Cfengine Help: Re: How to extract values (not keys) from an array to slist?

2011-03-17 Thread Mike Svoboda
Rock on! Thanks Mark! On 3/17/11 6:08 AM, "no-re...@cfengine.com" wrote: > Forum: Cfengine Help > Subject: Re: How to extract values (not keys) from an array to slist? > Author: mark > Link to topic: https://cfengine.com/forum/read.php?3,21174,21178#msg-21178 > > I just comitted to svn a new

Re: Cfengine Help: Re: laying a tripwire and firing the checksum_alerts class

2011-04-20 Thread Mike Svoboda
Anyone? =( The only other solution I can think of, and this is dumb, would be to insert this into root's crontab. 0,15,30,45 * * * /var/cfengine/bin/cf-agent -b lay_etc_tripwire_detection I really don't want to do that, because cf-execd is firing splaytime, and clients could have multiple inst

Re: Cfengine Help: Re: laying a tripwire and firing the checksum_alerts class

2011-04-21 Thread Mike Svoboda
Yeah I tried that. It didn't work. I guess because we're using "body changes", its entering a special place in the code where if_repaired doesn't take effect. On 4/21/11 11:44 AM, "no-re...@cfengine.com" wrote: > Forum: Cfengine Help > Subject: Re: laying a tripwire and firing the checksum_al

Re: Training sessions at Paris and Bruxelles

2011-05-11 Thread Mike Svoboda
I noticed on that page, the banner up top that said "Become a Cfengine Certified Engineer." Is there a public certification exam that is offered that folks could take at a testing place like Prometric, or is this just offered from the Cfengine corporation itself? I'd like to put another certifica

Do you use verify in your copy_from promises?

2011-05-16 Thread Mike Svoboda
In update.cf on my clients the promise that I use to copy data around, I set verify = true. http://www.cfengine.org/manuals/cf3-reference.html#copy_005ffrom-in-files The reference guide says that there is a resource / performance penalty from using verify = true. Synopsis: true/false verify t

Re: Cfengine Help: Re: Client config examples (update.cf / failsafe.cf) for multiple Master Policy Servers

2011-06-29 Thread Mike Svoboda
That's actually really creative. =) Bonus points to you sir! On 6/29/11 8:54 PM, "Aleksey Tsalolikhin" wrote: > On Tue, Jun 28, 2011 at 7:04 AM, wrote: >> Forum: Cfengine Help >> Subject: Re: Client config examples (update.cf / failsafe.cf) for multiple >> Master Policy Servers >> Author: m

Re: CFEngine Help: Re: CFEngine 3.2.0 release candidate

2011-07-04 Thread Mike Svoboda
Yes, this was on Solaris. On 7/4/11 11:13 AM, "Mikhail Gusarov" wrote: > On 07/04/2011 05:05 PM, no-re...@cfengine.com wrote: > >> Trying to compile against BerkeleyDB, I'm receiving the below. > > Is it on Solaris? > > I have just fixed similar problem in r2545

Re: CFEngine Help: Variable Class Names

2011-07-19 Thread Mike Svoboda
This might help... I execute a command and wrap it up with the canonify function. vars: "linux_machine_model" string => canonify(execresult("/usr/sbin/dmidecode -s system-product-name","noshell")); Canonify is a function that will “sanitize” the input to make i

Bindtointerface will not bind to a specific interface when similar subnets are involved

2011-09-03 Thread Mike Svoboda
My master policy servers have multiple VLAN interfaces. I want to be able to grab data off of clients, so my clients also run cf-serverd. I lock down which machines they’ll accept connections from by IP address. So, I define a single address that my clients will accept connections from. Thi

Re: CFEngine Help: New Book on Cfengine

2011-12-13 Thread Mike Svoboda
I reviewed a few chapters, and ask that they look at rewriting it months ago. It just posted a lot of config, without describing the design choices behind what they were doing. I also asked to have my name removed from the list of reviewers. I didn't want to be associated with it. Looking forwa

Re: CFEngine Help: Thoughts about some cfengine design decisions?

2011-12-16 Thread Mike Svoboda
+1 Mark. This was awesome. On 12/16/11 3:49 AM, "Mark Burgess" wrote: >On 12/16/2011 09:15 AM, Erlend Leganger wrote: >> I wasn't talking about the JSON support (but I can see why you thought >> I did), I just think the following is a good idea: >> >> Instead of writing this: >> >> ... >>

Re: (addendum) How easy/simple is cfengine?

2011-12-17 Thread Mike Svoboda
Hey Mark The most difficult time I had with Cfengine was going from nothing, to having network transfers working. Once I understood the concepts of failsafe.cf / promises.cf, things started to make sense and building upon that base configuration was pretty straightforward. I know that you gu

Re: [ANNOUNCE] CFEngine Community 3.3.0a1 is released

2012-02-10 Thread Mike Svoboda
Congrats on the release! The included features below look awesome. Is this going to be considered the final/table 3.3.0 release or is this just an alpha? Thanks! Mike On 2/10/12 9:24 AM, "Mikhail Gusarov" wrote: >Good day. > >CFEngine Community 3.3.0alpha1 is now available for testing. > >N

Re: Trying to use regex to edit multiple files but CFengine 3.2.1 only edits one file. Why?

2012-04-02 Thread Mike Svoboda
Can a single promise work like this? Maybe you need to use "/tmp/etc" And then use a "file_select" body to set the name containing ".*.conf" Alternatively, you could build a slist of the files in this directory and then loop over the slist. On 4/2/12 1:10 PM, "Aleksey Tsalolikhin" wrote: >H

Re: CFEngine Help: Upgrading to cf3.3 and tcdb issues

2012-04-20 Thread Mike Svoboda
In my upgrade script, I'm actually doing a rm -Rf /var/cfengine and starting completely clean.. I didn't want any residue from previous databases or whatnot to hang around. On 4/20/12 8:58 AM, "Nick Anderson" wrote: >On 04/20/2012 07:47 AM, Bas van der Vlies wrote: >> On 04/20/2012 02:35 PM,

RE: CFEngine Help: Re: CFEngine Help: Compile problems, 3.3 on Solaris 10

2012-05-03 Thread Mike Svoboda
Hey Roland Yes, I have built both Tokyocabinet and Cfengine 3.3 on Solaris 10 SPARC and x86/64. You need to use a more recent compiler. The compiler in /usr/sfw/bin/gcc doesn't support the c99 compile environment, so, tokyocabinet wont build. You can build QDBM using the compiler Sun provid

Re: cf-execd foreground

2012-05-11 Thread Mike Svoboda
Process supervision? What are you trying to use? Runit? You should be able to spawn a process and verify the pid still is online. I personally execute cf-exced -F out of cron hourly so I don¹t have to deal with long running daemons. On 5/11/12 6:26 PM, "Taj Khattra" wrote: >i'm attempting

Re: cf-execd foreground

2012-05-11 Thread Mike Svoboda
route of using Cfengine to fire up / maintain daemons. On 5/11/12 11:37 PM, "Taj Khattra" wrote: >On Fri, May 11, 2012 at 7:31 PM, Mike Svoboda >wrote: >> Process supervision? What are you trying to use? Runit? > >s6, a close cousin of runit (http://www.skarnet.org/so

Re: 180+ instances of cf-execd and cf-agent

2012-06-21 Thread Mike Svoboda
Hey Ron I have the following in a promise. You may want to adjust the values of "ago" there. I execute cf-agent once an hour. If I see a cf-agent process older than 2 hours old, I have the current execution kill that process and I raise a class that I report on. You could use this same thing

Re: CFEngine Help: CFEngine job post

2012-08-30 Thread Mike Svoboda
If LinkedIn uses Cfengine which is then used to help fill Cfengine jobs for companies requiring Cfengine talent.. Ow. My brain hurts. =) On 8/30/12 10:20 AM, "Marco Marongiu" wrote: >> We are looking for a full-time CFEngine engineer in New York: >> http://percolate.com/jobs#devops >> Anybody

Re: RFC: JSON support for CFEngine

2012-09-21 Thread Mike Svoboda
Ted, this is awesome and really should make it into the main trunk. Having JSON support would rock. YAML would also rock. Both data formats are used all over the place, and we would have a ton of use cases for this. Please target this for inclusion in the next version of the community version.

canonify'ing / classify'ing the LHS of a class statement

2012-10-04 Thread Mike Svoboda
I'm writing a policy that will test network firewall rules to make sure basic pieces of infrastructure work. Here's an example of something I have written in policy. vars: "ntp_service_hosts" slist => {"box1-linkedin.com", "box2-linkedin.com," }; classes: "ntp_udp_failure_$(ntp

Re: canonify'ing / classify'ing the LHS of a class statement

2012-10-05 Thread Mike Svoboda
Aleksey, you are the BOMB! Thank you my friend. We should meet up for beers in the near future. I hear its good for "social networking." ;-) Cheers! (no pun intended) Mike On 10/5/12 5:20 AM, "Aleksey Tsalolikhin" wrote: >On Thu, Oct 4, 2012 at 4:19 PM, Mike

Re: slist inside array

2012-10-05 Thread Mike Svoboda
Can you use a methods promise to pass the slist as an argument down into a lower bundle? Kind of a hack, but I think it would do what you want.. The first variable expansion in your primary policy would extract the slist out of the array. Once you were in the "sub bundle" via the method promise,