[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Process filters and warnings
From: |
Urie, Todd |
Subject: |
RE: Process filters and warnings |
Date: |
Wed, 8 Feb 2006 13:07:21 -0500 |
I finally did figure out what was wrong. I realize that the actual config
wasn't of much use. I was just trying to figure out how things worked. I
finally realized (after pooring through the docs again) that if I used
something along the lines of:
processes:
"cron" filter=pcron action=bymatch matches=1
This prints the desired message when I force the pcron filter to fail the match.
The problem that I have now is that I can't seem to get email sent when I force
warnings or alerts. Might be something misconfigured on the test host or
within cfengine, I'm not sure which.
-----Original Message-----
From: pearcecposs@gmail.com [mailto:pearcecposs@gmail.com]On Behalf Of
christian pearce
Sent: Wednesday, February 08, 2006 1:00 PM
To: Urie, Todd
Cc: help-cfengine@gnu.org
Subject: Re: Process filters and warnings
Weird huh? It must need a signal in order for it to process the code.
I just tested it. The HUP signal never gets passed to the cron job.
But I am not certain this is what you want anyway. Because this code
will just print out that it found the process running (Read the docs
carefully). Which is the exact opposite of what you are looking for.
How about this?
control:
actionsequence = ( processes )
domain = ( blackrock.com )
sysadm = ( root@locahost )
inform = ( on )
warnings = ( on )
filters:
#*********************************************
# Process filter aliases
#*********************************************
{
pcron
Owner: "root"
Command: "crond"
Result: "Owner.Command"
}
processes:
#---------------------------------------------
# All hosts must be running these proces
#---------------------------------------------
any::
"cron"
filter=pcron
action=signal
signal=cont
elsedefine=cron_not_running
alerts:
cron_not_running::
"Cron is not running."
But this code as the unfortunate circumstance of sending the CONT
signal if it is running.
If you didn't like that you could use a shellcommand that ran ps and
greped for what you were looking for. If it wasn't successful do a
elsedefine=cron_not_running
On 2/7/06, Urie, Todd <Todd.Urie@blackrock.com> wrote:
> The below is an excerpt from a cfagent.conf file that I am testing. This is
> my first attempt at using cfengine. I am trying to setup the config so that
> it warns me if the cron proc is not running. For some reason, if I include
> the signal=kill option, it appears to work, but if that is removed, then it
> does not. I would expect a warning if the signal= option is absent.
>
> What am I missing?
>
> control:
> actionsequence = ( processes )
> domain = ( blackrock.com )
> sysadm = ( root@locahost )
> inform = ( on )
> warnings = ( on )
> filters:
> #*********************************************
> # Process filter aliases
> #*********************************************
> { pcron
> Owner: "root"
> Command: "/usr/sbin/cron"
> # PPID: "1"
> Result: "Owner.Command"
> # Result: "Owner"
> }
> processes:
> #---------------------------------------------
> # All hosts must be running these proces
> #---------------------------------------------
> any::
> "." filter=pcron action=warn signal=hup
>
> Todd Urie
> Unix Admin
> Blackrock Financial Mgmt
> 302-797-6039
>
>
> THE INFORMATION CONTAINED IN THIS MESSAGE AND ANY ATTACHMENT MAY BE
> PRIVILEGED, CONFIDENTIAL, PROPRIETARY OR OTHERWISE PROTECTED FROM DISCLOSURE.
> If the reader of this message is not the intended recipient, you are hereby
> notified that any dissemination, distribution, copying or use of this message
> and any attachment is strictly prohibited. If you have received this message
> in error, please notify us immediately by replying to the message and
> permanently delete it from your computer and destroy any printout thereof.
>
>
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-cfengine
>
--
Christian Pearce
THE INFORMATION CONTAINED IN THIS MESSAGE AND ANY ATTACHMENT MAY BE PRIVILEGED,
CONFIDENTIAL, PROPRIETARY OR OTHERWISE PROTECTED FROM DISCLOSURE. If the reader
of this message is not the intended recipient, you are hereby notified that any
dissemination, distribution, copying or use of this message and any attachment
is strictly prohibited. If you have received this message in error, please
notify us immediately by replying to the message and permanently delete it from
your computer and destroy any printout thereof.