1

I'm trying to use ommail to send notifications via email. Everything works fine but i like to send multiple lines in mailbody.

module(load="ommail")

template (name="mailBody"  type="string" string="%msg%")
template (name="nodeupdateSubject" type="string" string="Slurm Node 
Update on Cluster")
template (name="nodeerrorSubject" type="string" string="Slurm Node Error on Cluster")

if $programname == 'slurmctld' then {

if $msg contains "update_node" then {
action(type="ommail" server="<server>" port="25"
       mailfrom="<email>"
       mailto="<email>"
       body.enable="on"
       subject.template="nodeupdateSubject"
       action.execonlyonceeveryinterval="60")
}
else if $msg contains "error" then {
       action(type="ommail" server="<server>" port="25"
       mailfrom="<email>"
       mailto="<email>"
       body.enable="on"
       subject.template="nodeerrorSubject"
       action.execonlyonceeveryinterval="60")
   } 
}

For example my rsyslog messages are as below

slurmctld[28623]: error: Node cs1 Down
slurmctld[28623]: error: Node cs2 Down   

Rsyslog just sends me the first msg i.e, error: Node cs1 Down but i want the next message too error: Node cs2 Down

So how do I accomplish this? I googled a lot and I'm not sure which is right.

2
  • What is the time interval between these two alerts ? I suspect action.execonlyonceeveryinterval="60"
    – krisFR
    Sep 20, 2017 at 3:26
  • The messages are instantaneous: below are the timestamps Sep 19 20:21:38 Sep 19 20:21:38
    – Bhargav
    Sep 20, 2017 at 3:58

0

You must log in to answer this question.

Browse other questions tagged .