Subject: Cron Confusion.. Continued... *ugh*

From: "Jason 'XenoPhage' Frisvold" <[email-masked]>
Date: Wed, 31 Aug 2005 20:11:15 -0400

*Help!*

I'm apparently missing something, or doing something wrong, or maybe
even completely misunderstanding this feature..  The goal is to
automatically override at 4 am, for an hour.  The example on the
documentation page of the site actually has 6 fields in the cron
command, but I was told previously that that was incorrect...

I'm running Argus dev-20050720

So, here's a snippet of my config.  Can someone please tell me what I'm
doing wrong??

         Service SYS/disk {
            uname: usr2
            label: usr2
            arg: /usr2
            graph: yes
            maxvalue: 5
            cron "0 4 * * *" {
               func: override
               text: Backup In Progress
               expires: 3600
               mode: manual
            }
         }

This is from the log last night :

Wed 31 Aug 04:49:27 2005 	up 	TRANSITION - up
Wed 31 Aug 04:24:27 2005 	down 	TRANSITION - down

It *did* work..  once...  :

Wed 24 Aug 05:00:49 2005 	up 	OVERRIDE - removed by system
Wed 24 Aug 05:00:49 2005 	up 	OVERRIDE - expired
Wed 24 Aug 04:44:27 2005 	up 	TRANSITION - up
Wed 24 Aug 04:00:49 2005 	down 	OVERRIDE - enabled by *internal-cronjob*
Wed 24 Aug 04:00:49 2005 	down 	OVERRIDE - Backup In Progress

-- 
---------------------------
Jason 'XenoPhage' Frisvold
Engine / Technology Programmer
[email-masked]
RedHat Certified - RHCE # 803004140609871
MySQL Pro Certified - ID# 207171862
MySQL Core Certified - ID# 205982910
---------------------------
"Something mysterious is formed, born in the silent void. Waiting alone and unmoving, it is at once still and yet in constant motion. It is the source of all programs. I do not know its name, so I will call it the Tao of Programming."

---

From: "Jason 'XenoPhage' Frisvold" <[email-masked]>
Date: Tue, 06 Sep 2005 22:59:12 -0400

Hi all,

I haven't seen a response to the below message, so I'm re-posting it. 
Does anyone know the answer to this?  Is anyone using the cron feature?

Thanks!

---

From: "Scott Hiemstra" <[email-masked]>
Date: Tue, 6 Sep 2005 23:11:50 -0400

Jason,

I use the cron directive for nightly maintenance and it seems to work fine,
I get my nightly overrides and I don't get paged so I consider it success.  

Here is the config I use regarding cron:

Host "webserver" {
   hostname:   webserver.domainname.com
   graph:      yes
   Service Ping {
   cron "59 12 * * *" {
       func:       override
       expires:    600
       mode:       manual
       text:       nightly maintenance
   }
}

Scott

> -----Original Message-----
> From: [email-masked] [mailto:[email-masked]]
> On Behalf Of Jason 'XenoPhage' Frisvold
> Sent: Tuesday, September 06, 2005 10:59 PM
> To: Discussion about Argus
> Subject: Re: Cron Confusion.. Continued... *ugh*
> 
> Hi all,
> 
> "Something mysterious is formed, born in the silent void. Waiting alone
> and unmoving, it is at once still and yet in constant motion. It is the
> source of all programs. I do not know its name, so I will call it the Tao
> of Programming."
> 
> _______________________________________________
> http://argus.tcp4me.com/
> [email-masked]
> http://www.tcp4me.com/mailman/listinfo/arguslist

---

From: [email-masked]
Date: Wed, 7 Sep 2005 07:27:25 -0700

I use several crons successfully.  Here is an example.

                   cron "0 15 * * 1-4" {
                       func: override
                       text: System is normally down on evenings and
weekends - we only check this service during core business hours of 9:00 to
3:00 Monday through Friday.  The current override is for overnight.
                       mode: manual
                       expires: 64800
                       quiet: no
                   }
                   cron "0 15 * * 5" {
                       func: override
                       text: System is normally down on evenings and
weekends - we only check this service during core business hours of 9:00 to
3:00 Monday through Friday.  The current override is for the weekend.
                       mode: manual
                       expires: 237600
                       quiet: no
                   }

::
:: Matt Cleveland
:: Web Architect
:: Health Net Inc.
:: 916.935.1248
:: [email-masked]
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

             Jason 'XenoPhage'                                             
             Frisvold                                                      
             <[email-masked]                                          To 
             m>                        Discussion about Argus              
             Sent by:                  <[email-masked]>              
             arguslist-bounces                                          cc 
             @tcp4me.com                                                   
                                                                   Subject 
                                       Re: Cron Confusion.. Continued...   
             09/06/2005 07:59          *ugh*                               
             PM                                                            

             Please respond to                                             
             Discussion about                                              
                   Argus                                                   
             <arguslist@tcp4me                                             
                   .com>                                                   

Hi all,

Thanks!

--
---------------------------
Jason 'XenoPhage' Frisvold
Engine / Technology Programmer
[email-masked]
RedHat Certified - RHCE # 803004140609871
MySQL Pro Certified - ID# 207171862
MySQL Core Certified - ID# 205982910
---------------------------
"Something mysterious is formed, born in the silent void. Waiting alone and
unmoving, it is at once still and yet in constant motion. It is the source
of all programs. I do not know its name, so I will call it the Tao of
Programming."

This  message,together  with  any  attachments, is
intended only for the use of the individual or entity
to which it is addressed. It may contain information
that is confidential and prohibited from disclosure.
If you are not the intended recipient, you are hereby
notified that  any dissemination  or copying of this
message or any attachment is strictly prohibited. If
you have received this message in error, please notify
the  original  sender immediately by telephone or by
return e-mail and delete this message, along with any
attachments, from your computer.  Thank you.

---

From: [email-masked]
Date: Wed, 7 Sep 2005 15:38:40 +1000

Hi All,

I did some digging in version 3.2 on this issue and ended up using the 
system "cron" utility to call a script which makes use of "argusctl" to do 
the override thing.

>From memory, there was something to do with the use of "0" in the time 
spec. - notice Scott's timespec. doesn't have any zeros in it. From 
memory,  the 0 was handled the same as no value (undef) in the logic of 
one of the sub-routines in Cron.pm. The result was that the job was 
executed once, but when the code tried to reschedule it silently failed.

With my external "cron" script being stable, I haven't needed to look at 
3.3 with respect to this problem. 

Prehaps, if you use "59 3 * * *" as your timespec you'll get pretty much 
what you want? With the 6 fields in the example, and the run-once 
behaviour of the internal cron facility, I have just stuck with the 
external script. The following doesn't address your problem directly but 
might be of interest:

The script I use does some of the expected minimal input checking and then 
invokes the following

 argusctl override \
        object=$object \
        user="*external cronjob*" \
        text="expected nightly maintenance downtime" \
        mode=manual \
        expires=$relexpires

where "$object" is a given object name in the "Top:..." format and 
"$relexpires" is the calculated "epoch" value for when the override should 
expire.

The following is what I get in the argus log for an override of 13 hours 
from 6pm using the script snippet shown above on a argus-3.2 system:

Wed 7 Sep 07:00:06 2005 override    OVERRIDE - removed by system
Wed 7 Sep 07:00:06 2005 override    OVERRIDE - expired
Tue 6 Sep 23:47:37 2005 override    TRANSITION - override
Tue 6 Sep 18:00:04 2005 up                OVERRIDE - enabled by *external 
cronjob*
Tue 6 Sep 18:00:04 2005 up                OVERRIDE - expected nightly 
maintenance downtime

Hope this helps.

---
Cheers, Jeff

"Scott Hiemstra" <[email-masked]>
Sent by: [email-masked]
07/09/2005 01:11 PM
Please respond to Discussion about Argus
 
        To:     "'Discussion about Argus'" <[email-masked]>
        cc: 
        Subject:        RE: Cron Confusion.. Continued...  *ugh*
 Reference:   
  Expires on 

Jason,

I use the cron directive for nightly maintenance and it seems to work 
fine,
I get my nightly overrides and I don't get paged so I consider it success. 

Host "webserver" {

Scott

> >Wed 24 Aug 04:00:49 2005              down            OVERRIDE - 
enabled by *internal-
> cronjob*

**********************************************************************
IMPORTANT:  This e-mail is intended for the use of the addressee and may contain information that is confidential, commercially valuable or subject to legal or parliamentary privilege.  If you are not the intended recipient you are notified that any review, re-transmission, disclosure, use or dissemination of this communication is strictly prohibited by several Commonwealth Acts of Parliament.  If you have received this communication in error please notify the sender immediately and delete all copies of this transmission together with any attachments.
**********************************************************************

---

From: "Jason 'XenoPhage' Frisvold" <[email-masked]>
Date: Thu, 08 Sep 2005 08:20:38 -0400

>executed once, but when the code tried to reschedule it silently failed.

Hrm..  That's interesting..  I think I use 0 in all of the different 
crons I set up ...

I also thought taht *maybe* the issue was with where in the config I had 
cron declared.  The other night I moved the definition to be at the 
"top" of the service definition, and to my surprise, it seems to have 
worked.  It's worked for the past 2 days.  This morning, I adjusted the 
cron time to something non-zero and I'm waiting to see what happens 
tonite...

>3.3 with respect to this problem. 

Heh..  I never thought to use an external script to do this..  Doh :)

>Hope this helps.

It does..  If all else fails, I have a fallback plan now..  :)

>Cheers, Jeff

Jason

---

From: "Jason 'XenoPhage' Frisvold" <[email-masked]>
Date: Mon, 12 Sep 2005 20:22:03 -0400

Jason 'XenoPhage' Frisvold wrote:

> I also thought taht *maybe* the issue was with where in the config I
> had cron declared.  The other night I moved the definition to be at
> the "top" of the service definition, and to my surprise, it seems to
> have worked.  It's worked for the past 2 days.  This morning, I
> adjusted the cron time to something non-zero and I'm waiting to see
> what happens tonite...

So, this worked for one night.  The following night, the cron didn't
work, and it hasn't since.  I'm going to try restarting argus now and
see if the cron works tonite.  I suspect it will..

If so..  What information can I provide to determine the cause and fix
for this?

Thanks!

---

From: "Jason 'XenoPhage' Frisvold" <[email-masked]>
Date: Tue, 13 Sep 2005 09:48:26 -0400

>see if the cron works tonite.  I suspect it will..

As suspected, the cron worked last night...  So this would appear to be 
a problem with resetting the cron?

>If so..  What information can I provide to determine the cause and fix

?? Any thoughts on this?

Thanks!

Jason