riemann电子邮件例外与SMTP [英] riemann email exception with SMTP

查看:174
本文介绍了riemann电子邮件例外与SMTP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我能够使用SMTP设置riemann。当满足条件时,Riemann似乎发送电子邮件,但我观察到异常(复制如下) - 任何洞察如何解决/修复这将感激。

I was able to set up riemann with SMTP. Riemann appears to send the email out when the condition is met but I observe an exception (copied below) - any insight on how to troubleshoot/fix this will be appreciated.

配置

    (def email (mailer {:host "xxx.xxx.xxx.xxx"
                        :port "xxxx"
                        :user "user@somewhere.com"
                        :pass "user12345"
                        :from "user@somewhere.com"}))

(streams
 (where (and (service #"^riemann netty execution-handler"))
        (email "user@somewhere.com")))

错误

#riemann.codec.Event{:host "ubuntu-3", :service "riemann netty execution-handler threads active", :state "ok", :description nil, :metric 0, :tags nil, :time 348380111059/250, :ttl 20000}
WARN [2014-02-27 12:00:44,278] Thread-10 - riemann.config - riemann.email$mailer$make_stream__16773$stream__16774@4e9c33e9 threw
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Number
        at postal.smtp$smtp_send_STAR_.invoke(smtp.clj:33)
        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__16773$stream__16774.invoke(email.clj:69)
        at riemann.config$eval40$stream__41$fn__46.invoke(riemann.config:44)
        at riemann.config$eval40$stream__41.invoke(riemann.config:44)
        at riemann.core$stream_BANG_$fn__10513.invoke(core.clj:19)
        at riemann.core$stream_BANG_.invoke(core.clj:18)
        at riemann.core$instrumentation_service$measure__10522.invoke(core.clj:56)
        at riemann.service.ThreadService$thread_service_runner__8329$fn__8330.invoke(service.clj:64)
        at riemann.service.ThreadService$thread_service_runner__8329.invoke(service.clj:63)
        at clojure.lang.AFn.run(AFn.java:24)
        at java.lang.Thread.run(Thread.java:744)


推荐答案

通过将端口号指定为数字

The issue was resolved by specifying the port number as a number (without the inverted commas).

配置

 (def email (mailer {:host "xxx.xxx.xxx.xxx"
                        :port xxxx
                        :user "user@somewhere.com"
                        :pass "user12345"
                        :from "user@somewhere.com"}))

(streams
 (where (and (service #"^riemann netty execution-handler"))
        (email "user@somewhere.com")))

这篇关于riemann电子邮件例外与SMTP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆