Hi,
I am seeing that this command is sending mail even when the nawk command in untrue ( does not have any output ). I only want it to send mail, where it goes above the threshold, and has some output.
nawk -F'(MOD dn="uid=)|(DEL dn="uid=)|[,]' '/(MOD dn="uid=)|(DEL dn="uid=)/ {u[$2]++}END{for(i in u) if(u>thr) print "user",i,"has crossed ["u"] the thresold limit ",thr}' thr=100 access | mailx -s 'Thresold Email' TO_EMAIL_ID
Can someone help me on this?
Thanks.