黎曼电子邮件断言失败了吗?

时间:2014-06-25 11:29:04

标签: clojure logstash riemann

我在logstash中使用riemann输出插件,我想在用户字段为root时使用riemann提醒。

Logstash-配置:

if "server2-cronlog" in [tags]{
        riemann {
            riemann_event =>  [
                        "service", "My Awesome Logs",
                        "username", "%{user}",
                        "description", "%{command}"
                      ]
          }
    }

Riemann-config:我在riemann配置文件内容的末尾添加以下行(就像安装riemann时一样)

(def email(mailer {    :host "xyz"
            :port 25
            :user "abc@gmail.com"
            :from "abc@gmail.com"
}))

(def tell-ops(rollup 3 3600 (email "cde@gmail.com")))

(streams
(where (username "root") tell-ops)
)

; print events to the log
(streams
        prn)

注意:我们的smtp服务器不需要密码,因此不会在配置中写入。

我从logstash控制台看到生成了riemann事件。

在我的riemann服务器控制台中,我收到以下警告:

WARN [2014-06-25 16:18:23,007] pool-1-thread-8 - riemann.streams - riemann.email$mailer$make_stream__17457$stream__17458@782bbb7b threw
java.lang.AssertionError: Assert failed: (or (and (nil? user) (nil? pass)) (and user pass))
    at postal.smtp$smtp_send_STAR_.invoke(smtp.clj:31)
    at postal.smtp$smtp_send.doInvoke(smtp.clj:58)
    at clojure.lang.RestFn.invoke(RestFn.java:423)
    at postal.core$send_message.invoke(core.clj:35)
    at riemann.email$email_event.invoke(email.clj:18)
    at riemann.email$mailer$make_stream__17457$stream__17458.invoke(email.clj:69)
    at riemann.streams$rollup$side_effects__10105$fn__10111.invoke(streams.clj:1040)
    at riemann.streams$rollup$side_effects__10105.invoke(streams.clj:1040)
    at riemann.streams$part_time_simple$stream__9560.invoke(streams.clj:611)
    at riemann.config$eval43$stream__44$fn__49.invoke(riemann.config:39)
    at riemann.config$eval43$stream__44.invoke(riemann.config:39)
    at riemann.core$stream_BANG_$fn__11096.invoke(core.clj:19)
    at riemann.core$stream_BANG_.invoke(core.clj:18)
    at riemann.transport$handle.invoke(transport.clj:116)
    at riemann.transport.tcp$tcp_handler.invoke(tcp.clj:84)
    at riemann.transport.tcp$gen_tcp_handler$fn__11316.invoke(tcp.clj:65)
    at riemann.transport.tcp.proxy$org.jboss.netty.channel.SimpleChannelHandler$ff19274a.messageReceived(Unknown Source)
    at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:88)
    at riemann.transport.tcp.proxy$org.jboss.netty.channel.SimpleChannelHandler$ff19274a.handleUpstream(Unknown Source)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
    at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
    at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296)
    at org.jboss.netty.handler.codec.oneone.OneToOneDecoder.handleUpstream(OneToOneDecoder.java:70)
    at riemann.transport.proxy$org.jboss.netty.handler.codec.oneone.OneToOneDecoder$ff19274a.handleUpstream(Unknown Source)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
    at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
    at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296)
    at org.jboss.netty.handler.codec.oneone.OneToOneDecoder.handleUpstream(OneToOneDecoder.java:70)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
    at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
    at org.jboss.netty.handler.execution.ChannelUpstreamEventRunnable.doRun(ChannelUpstreamEventRunnable.java:43)
    at org.jboss.netty.handler.execution.ChannelEventRunnable.run(ChannelEventRunnable.java:67)
    at org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor$ChildExecutor.run(OrderedMemoryAwareThreadPoolExecutor.java:314)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
    at java.lang.Thread.run(Thread.java:662)

所以控制台是:上面的警告,然后三个事件描述与状态,描述,然后相同的警告和结束nullpointer异常。

电子邮件未发送给用户。有什么不对?

0 个答案:

没有答案