[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Process filters and warnings
From: |
christian pearce |
Subject: |
Re: Process filters and warnings |
Date: |
Wed, 8 Feb 2006 13:00:06 -0500 |
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