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

Re: [HTCondor-users] How to configure globally notify_user in config file instead of submit files



On 4/13/2015 2:31 AM, Sridhar Thumma wrote:
Ohk. In the same way, is it possible to use notification=error so that
it sends mail only to failed jobs?


Yes, but a small complication to keep in mind is condor_submit takes your submit description file and converts it into a job classad. Sometimes this conversion process will result in attribute names or values being slightly different, or in string constants (like 'error') being converted into integers. You could look over the Appendix in the HTCondor Manual to see details on the job classad attributes, but I find it easiest/fastest to just run condor_submit on a submit file and inspect the resulting job classad. Using the "-dump <file>" option to condor_submit, which just dumps the job classad out to a file instead of actually submitting it, is handy for this purpose.

So with this in mind I figured out how notification is encoded into the job classad like so:

  C:\temp\aaa>cat test.sub
  executable = test.bat
  notification = error
  queue

  C:\temp\aaa>condor_submit -dump - test.sub | grep -i notifi
  JobNotification=3

Thus what you want to append to the end of your condor_config is

  NotifyUser = "someone@xxxxxxxxxxxxx"
  JobNotification = 3
  SUBMIT_ATTRS = $(SUBMIT_ATTRS) NotifyUser JobNotification

Hope the above helps,
Todd


On Fri, Apr 10, 2015 at 9:36 PM, Todd Tannenbaum <tannenba@xxxxxxxxxxx
<mailto:tannenba@xxxxxxxxxxx>> wrote:

    On 4/7/2015 7:27 AM, Sridhar Thumma wrote:

        Hi,

        I want to send an email to specific email address whenever there
        is an
        error in condor. I found that if use notify_user in submit files, it
        will send email to that user. But, I want to configure that in
        config
        file instead of submit file.

        Please suggest me on this.


    You can make a default for notify_user in your condor_config file
    (or condor_config.local) by appending this to the bottom of the file:

       NotifyUser = "someone@xxxxxxxxxxxxx <mailto:someone@xxxxxxxxxxxxx>"
       SUBMIT_ATTRS = $(SUBMIT_ATTRS) NotifyUser

    Note that the user can still override the address you set in the
    condor_config by specifying NotifyUser (or notify_user) in the job
    submit file.

    Hope the above helps,
    Todd