leancloud / satori Goto Github PK
View Code? Open in Web Editor NEWSatori 是一个 LeanCloud 维护的监控系统,inspired by Open-Falcon
License: Apache License 2.0
Satori 是一个 LeanCloud 维护的监控系统,inspired by Open-Falcon
License: Apache License 2.0
现在报警时会留着老值和老时间,这个不对。
cpu
mem
---> Running in 94a6e9d2c594
Creating directory '/alarm/eggs'.
Creating directory '/alarm/bin'.
Creating directory '/alarm/parts'.
Creating directory '/alarm/develop-eggs'.
Develop: '/alarm/.'
Getting distribution for 'zc.recipe.egg>=2.0.0a3'.
Got zc.recipe.egg 2.0.3.
Getting distribution for 'pbp.recipe.noserunner'.
Got pbp.recipe.noserunner 0.2.6.
Getting distribution for 'nose'.
no previously-included directories found matching 'doc/.build'
Got nose 1.3.7.
Getting distribution for 'plone.recipe.command'.
Got plone.recipe.command 1.1.
Installing app.
Getting distribution for 'ipython'.
error: Setup script exited with error in ipython setup command: Invalid environment marker: sys_platform == "win32" and python_version < "3.6"
An error occurred when trying to install /tmp/tmpDqu6PPget_dist/ipython-5.3.0.tar.gz. Look above this message for any errors that were output by easy_install.
While:
Installing app.
Getting distribution for 'ipython'.
An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/zc.buildout-2.9.2-py2.7.egg/zc/buildout/buildout.py", line 1982, in main
getattr(buildout, command)(args)
File "/usr/local/lib/python2.7/dist-packages/zc.buildout-2.9.2-py2.7.egg/zc/buildout/buildout.py", line 668, in install
installed_files = self[part]._call(recipe.install)
File "/usr/local/lib/python2.7/dist-packages/zc.buildout-2.9.2-py2.7.egg/zc/buildout/buildout.py", line 1419, in _call
return f()
File "/alarm/eggs/zc.recipe.egg-2.0.3-py2.7.egg/zc/recipe/egg/egg.py", line 126, in install
reqs, ws = self.working_set()
File "/alarm/eggs/zc.recipe.egg-2.0.3-py2.7.egg/zc/recipe/egg/egg.py", line 84, in working_set
allow_hosts=self.allow_hosts)
File "/usr/local/lib/python2.7/dist-packages/zc.buildout-2.9.2-py2.7.egg/zc/buildout/easy_install.py", line 913, in install
return installer.install(specs, working_set)
File "/usr/local/lib/python2.7/dist-packages/zc.buildout-2.9.2-py2.7.egg/zc/buildout/easy_install.py", line 665, in install
for dist in self._get_dist(requirement, ws):
File "/usr/local/lib/python2.7/dist-packages/zc.buildout-2.9.2-py2.7.egg/zc/buildout/easy_install.py", line 563, in _get_dist
dists = [_move_to_eggs_dir_and_compile(dist, self._dest)]
File "/usr/local/lib/python2.7/dist-packages/zc.buildout-2.9.2-py2.7.egg/zc/buildout/easy_install.py", line 1699, in _move_to_eggs_dir_and_compile
[tmp_loc] = glob.glob(os.path.join(tmp_dest, '*'))
ValueError: need more than 0 values to unpack
ERROR: Service 'alarm' failed to build: The command '/bin/sh -c cd /alarm && buildout' returned a non-zero code: 1
hi:
fixed-event-window 3 可以拿到最近的3份数据. 能否在set-state-gapped 中判断所有的 event 是否都满足而报警或恢复.
3ks
存储用了influxdb, 用的是开源的版本,还是商业版本, 如果是开源版本, 请问高可用这块是怎么做的?
您好,DC/OS你们支持吗?
下面的问题是由于什么配置不对,请大神们帮忙确认一下:
Run
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got 'testuser@testserver1.(none)')
比如,在自己开发的工具中看到报警可以直接画出相关的监控图,或者直接跳到相关服务的 web interface 上去
在這一行
satori/agent/plugins/update.go
Line 107 in 9ce244c
建議加上 timeout ,改成如 cmd := exec.Command("timeout", "60s", "git", "fetch")
说好了 transfer 要有 gateway 的功能但是现在还没有
现在新添发送报警的方式需要修改 alarm 重新部署,增加的部署难度
需要考虑 SysV、upstart、systemd 3种启动方式
3ks
针对每个
可以做
users:
proton:
name: Proton
email: [email protected]
filters:
- filter: good_night # 夜晚时间段 1 级以下的报警不要通知我
mute_at: 0:00 - 8:00
mute_below_level: 1
- filter: threshold # 至少是 3 级报警才通知我
level: 3
filters 需要放在规则仓库内,随时可以做自定义
Dear,
I got a message blow, could you help me?
:: Preparing docker images
:: - Copy alarm to build dir
:: - Copy frontend to build dir
:: - Build golang executables
Unable to find image 'daocloud.io/golang:wheezy' locally
docker: Error response from daemon: Get https://daocloud.io/v1/_ping: dial tcp: lookup daocloud.io on [::1]:53: read udp [::1]:43387->[::1]:53: read: connection refused.
See 'docker run --help'.
文件:plugin/infra/60_kernel.py里边
endpoint = socket.gethostname() #这里调用的不是配置文件我配置的主机名
rt, thx!
hi:
能够把某一类规则挂到某一匹配的机器分组下. 比如 A 机器组是数据库 disk IO 阈值较高. B 机器组是 web 相应阈值就较低.
用来调试插件非常好
rt, ths!
Installing collected packages: pip, six, pyparsing, packaging, appdirs, setuptools, wheel
Found existing installation: six 1.8.0
Uninstalling six-1.8.0:
Exception:
Traceback (most recent call last):
File "/tmp/tmpdVDOcH/pip.zip/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/tmp/tmpdVDOcH/pip.zip/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/tmp/tmpdVDOcH/pip.zip/pip/req/req_set.py", line 778, in install
requirement.uninstall(auto_confirm=True)
File "/tmp/tmpdVDOcH/pip.zip/pip/req/req_install.py", line 754, in uninstall
paths_to_remove.remove(auto_confirm)
File "/tmp/tmpdVDOcH/pip.zip/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/tmp/tmpdVDOcH/pip.zip/pip/utils/init.py", line 267, in renames
shutil.move(old, new)
File "/usr/lib/python2.7/shutil.py", line 300, in move
rmtree(src)
File "/usr/lib/python2.7/shutil.py", line 256, in rmtree
onerror(os.rmdir, path, sys.exc_info())
File "/usr/lib/python2.7/shutil.py", line 254, in rmtree
os.rmdir(path)
OSError: [Errno 39] Directory not empty: '/usr/lib/python2.7/dist-packages/six-1.8.0.egg-info'
ERROR: Service 'alarm' failed to build: The command '/bin/sh -c python /alarm/get-pip.py' returned a non-zero code: 2
考虑支持或替换agent为telegraf吗?
https://github.com/influxdata/telegraf
理由如下:
如题。
机器删除后会留着旧条目,在一个时间内(比如2天)没有接到心跳,就将其除名
默认会安装 ipython 6,然而 ipython 6 并不支持 Python 2.x,所以会报错。
IPython 6 requires Python version 3.3 and above.
IPython 5.x LTS is the compatible release for Python 2.7. If you require Python 2 support, you must use IPython 5.x LTS. Please update your project configurations and requirements as necessary.
Line 11 in 3b1cec3
这边指定一下版本号?
[versions]
ipython = 5.3.0
现在的插件都是每一次收集都去执行一下相应的脚本。
有些收集脚本需要在内部保存状态,这个现在的模式就很难处理。
之后需要支持持续运行的脚本,脚本进程不停止,持续向 agent 输出 metric。
用来调试插件、报警
目前只能看日志
现在nginx访问页面打得开.似乎安装好了.
Got pyaml 17.8.0.
Getting distribution for 'redis'.
warning: no previously-included files found matching '__pycache__'
warning: no previously-included files matching '*.pyc' found under directory 'tests'
zip_safe flag not set; analyzing archive contents...
Got redis 2.10.6.
Getting distribution for 'gevent'.
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'cffi_modules'
warnings.warn(msg)
warning: no files found matching 'changelog.rst'
warning: no files found matching 'known_failures.py'
warning: no files found matching '.pep8'
no previously-included directories found matching '*/__pycache__'
warning: no previously-included files matching '*.so' found anywhere in distribution
warning: no previously-included files matching '*.o' found anywhere in distribution
warning: no previously-included files matching '*.lo' found anywhere in distribution
warning: no previously-included files matching '*.la' found anywhere in distribution
warning: no previously-included files matching 'config.log' found anywhere in distribution
warning: no previously-included files matching 'config.status' found anywhere in distribution
no previously-included directories found matching 'doc/_build'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '.coverage' found under directory 'src/greentest'
no previously-included directories found matching 'src/greentest/htmlcov'
warning: no previously-included files matching 'stamp-h?' found under directory 'deps/c-ares'
warning: no previously-included files matching 'ares_build.h.orig' found under directory 'deps/c-ares'
no previously-included directories found matching 'deps/libev/.deps'
warning: no previously-included files matching 'Makefile' found under directory 'deps/libev'
warning: no previously-included files matching 'libtool' found under directory 'deps/libev'
warning: no previously-included files matching 'stamp-h?' found under directory 'deps/libev'
warning: no previously-included files matching 'config.h' found under directory 'deps/libev'
warning: no previously-included files matching '_corecffi.c' found under directory 'src/gevent'
warning: no previously-included files found matching 'Makefile'
warning: no previously-included files found matching 'configure-output'
./configure: line 6318: /usr/bin/file: No such file or directory
In file included from src/gevent/libev/libev.h:2:0,
from src/gevent/libev/gevent.corecext.c:434:
/tmp/easy_install-EuLTIE/gevent-1.2.2/deps/libev/ev.c:483:48: warning: "/*" within comment [-Wcomment]
/*#define MIN_INTERVAL 0.00000095367431640625 /* 1/2**20, good till 2200 */
^
In file included from src/gevent/libev/libev.h:2:0,
from src/gevent/libev/gevent.corecext.c:434:
/tmp/easy_install-EuLTIE/gevent-1.2.2/deps/libev/ev.c:1831:31: warning: ‘ev_default_loop_ptr’ initialized and declared ‘extern’
EV_API_DECL struct ev_loop *ev_default_loop_ptr = 0; /* needs to be initialised to make it a definition despite extern */
^
In file included from src/gevent/libev/libev.h:2:0,
from src/gevent/libev/gevent.corecext.c:434:
/tmp/easy_install-EuLTIE/gevent-1.2.2/deps/libev/ev.c: In function ‘ev_io_start’:
/tmp/easy_install-EuLTIE/gevent-1.2.2/deps/libev/ev.c:3878:34: warning: suggest parentheses around arithmetic in operand of ‘|’ [-Wparentheses]
fd_change (EV_A_ fd, w->events & EV__IOFDSET | EV_ANFD_REIFY);
^
/tmp/easy_install-EuLTIE/gevent-1.2.2/deps/libev/ev.c: At top level:
/tmp/easy_install-EuLTIE/gevent-1.2.2/deps/libev/ev.c:5135:27: warning: "/*" within comment [-Wcomment]
/* EV_STAT 0x00001000 /* stat data changed */
^
/tmp/easy_install-EuLTIE/gevent-1.2.2/deps/libev/ev.c:5136:27: warning: "/*" within comment [-Wcomment]
/* EV_EMBED 0x00010000 /* embedded event loop needs sweep */
^
In file included from src/gevent/libev/libev.h:2:0,
from src/gevent/libev/gevent.corecext.c:434:
/tmp/easy_install-EuLTIE/gevent-1.2.2/deps/libev/ev.c: In function ‘evpipe_write’:
/tmp/easy_install-EuLTIE/gevent-1.2.2/deps/libev/ev.c:2468:11: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-resul
t]
write (evpipe [1], &counter, sizeof (uint64_t));
^
/tmp/easy_install-EuLTIE/gevent-1.2.2/deps/libev/ev.c:2480:11: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-resul
t]
write (evpipe [1], &(evpipe [1]), 1);
^
/tmp/easy_install-EuLTIE/gevent-1.2.2/deps/libev/ev.c: In function ‘pipecb’:
/tmp/easy_install-EuLTIE/gevent-1.2.2/deps/libev/ev.c:2501:11: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result
]
read (evpipe [1], &counter, sizeof (uint64_t));
^
/tmp/easy_install-EuLTIE/gevent-1.2.2/deps/libev/ev.c:2515:11: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result
]
read (evpipe [0], &dummy, sizeof (dummy));
^
./configure: line 10001: /usr/bin/file: No such file or directory
In file included from src/gevent/gevent.ares.c:435:0:
src/gevent/dnshelper.c:19:0: warning: "PyUnicode_FromString" redefined
#define PyUnicode_FromString PyBytes_FromString
^
In file included from /usr/include/python2.7/Python.h:85:0,
from src/gevent/gevent.ares.c:4:
/usr/include/python2.7/unicodeobject.h:281:0: note: this is the location of the previous definition
# define PyUnicode_FromString PyUnicodeUCS4_FromString
^
File "build/bdist.linux-x86_64/egg/gevent/_socket3.py", line 195
def makefile(self, mode="r", buffering=None, *,
^
SyntaxError: invalid syntax
File "/alarm/eggs/tmpNL6jem/gevent-1.2.2-py2.7-linux-x86_64.egg/gevent/_socket3.py", line 195
def makefile(self, mode="r", buffering=None, *,
^
SyntaxError: invalid syntax
Running '(cd "/tmp/easy_install-EuLTIE/gevent-1.2.2/deps/libev" && sh ./configure && cp config.h "$OLDPWD" ) > configure-output.txt' in /tmp/easy_install-EuLTIE/g
event-1.2.2/build/temp.linux-x86_64-2.7/libev
Running '(cd "/tmp/easy_install-EuLTIE/gevent-1.2.2/deps/c-ares" && if [ -r ares_build.h ]; then cp ares_build.h ares_build.h.orig; fi && sh ./configure --disable
-dependency-tracking CONFIG_COMMANDS= && cp ares_config.h ares_build.h "$OLDPWD" && mv ares_build.h.orig ares_build.h) > configure-output.txt' in /tmp/easy_instal
l-EuLTIE/gevent-1.2.2/build/temp.linux-x86_64-2.7/c-ares
Got gevent 1.2.2.
Getting distribution for 'bottle'.
warning: no files found matching 'LICENSE.txt'
zip_safe flag not set; analyzing archive contents...
bottle: module references __file__
bottle: module references __path__
Got bottle 0.12.13.
Getting distribution for 'certifi'.
/usr/local/lib/python2.7/dist-packages/setuptools/dist.py:351: UserWarning: Normalizing '2017.07.27.1' to '2017.7.27.1'
normalized_version,
Got certifi 2017.7.27.1.
Getting distribution for 'future>=0.16.0'.
warning: no files found matching '*.au' under directory 'tests'
warning: no files found matching '*.gif' under directory 'tests'
warning: no files found matching '*.txt' under directory 'tests'
zip_safe flag not set; analyzing archive contents...
future.backports.test.ssl_servers: module references __file__
future.backports.test.support: module references __file__
future.standard_library.__init__: module references __file__
future.standard_library.__init__: module references __path__
future.utils.__init__: module MAY be using inspect.stack
past.builtins.misc: module MAY be using inspect.stack
past.translation.__init__: module references __file__
past.translation.__init__: module references __path__
Got future 0.16.0.
Getting distribution for 'contextlib2'.
zip_safe flag not set; analyzing archive contents...
Got contextlib2 0.5.5.
Getting distribution for 'urllib3<1.23,>=1.21.1'.
warning: no previously-included files matching '*' found under directory 'docs/_build'
zip_safe flag not set; analyzing archive contents...
urllib3.packages.six: module references __path__
Got urllib3 1.22.
Getting distribution for 'idna<2.7,>=2.5'.
warning: no previously-included files matching '*.pyc' found under directory 'tools'
warning: no previously-included files matching '*.pyc' found under directory 'tests'
zip_safe flag not set; analyzing archive contents...
Got idna 2.6.
Getting distribution for 'chardet<3.1.0,>=3.0.2'.
warning: no files found matching 'requirements.txt'
zip_safe flag not set; analyzing archive contents...
Got chardet 3.0.4.
Getting distribution for 'PyYAML'.
build/temp.linux-x86_64-2.7/check_libyaml.c:2:18: fatal error: yaml.h: No such file or directory
#include <yaml.h>
^
compilation terminated.
libyaml is not found or a compiler error: forcing --without-libyaml
(if libyaml is installed correctly, you may need to
specify the option --include-dirs or uncomment and
modify the parameter include_dirs in setup.cfg)
zip_safe flag not set; analyzing archive contents...
Got PyYAML 3.12.
Getting distribution for 'greenlet>=0.4.10'.
因为规则是 riemann 下发的,riemann 的 plugin-dir
和 plugin-metric
是有冷却时间的(为了省 cpu 和带宽),reload 一段时间后就不再更新。这时添加新机器,不会下发相应的插件信息。
一定时间内没有心跳的机器做成事件发到 transfer
新手问题,请谅解!
我按照“添加规则”文档添加了一条如下的规则,能够正常完成报警,但是我怎么关闭它呢,尝试过均失败:删除这个文件,修改这个文件都没有起作用,并且commit
检查了agent的/var/lib/satori/plugin目录,能够正常同步satori-rules的代码,但是这条规则依旧在持续发挥作用(查看了agent日志,依旧是30s执行一次22端口检查)。
谢谢辛勤的开发者们。
(ns test.portlisten
(:use riemann.streams
agent-plugin
alarm))
(def test-portlisten-rules
(where (host "some-host-name")
(plugin-metric "net.port.listen" 30 {:port 22})
(where (and (service "net.port.listen")
#(= (:port %) 22))
(by :host
(set-state-gapped (< 1) (> 0)
(should-alarm-every 60
(! {:note "22 端口不监听了!"
:level 0
:groups [:operation :api]})))))))
日志:
Traceback (most recent call last):
File "/usr/bin/easy_install", line 9, in <module>
load_entry_point('setuptools==5.5.1', 'console_scripts', 'easy_install')()
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 2199, in main
lambda: setup(
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 2185, in with_ei_usage
return f()
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 2202, in <lambda>
distclass=DistributionWithoutHelpCommands, **kw
File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 393, in run
self.easy_install(spec, not self.no_deps)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 636, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 668, in install_item
self.process_distribution(spec, dist, deps)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 716, in process_distribution
[requirement], self.local_index, self.easy_install
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 631, in resolve
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 636, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 666, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 856, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1078, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1063, in run_setup
run_setup(setup_script, args)
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 68, in run_setup
DirectorySandbox(setup_dir).run(runner)
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 114, in run
return func()
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 67, in runner
_execfile(setup_script, ns)
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 43, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-cYPzF0/setuptools-30.2.0/setup.py", line 181, in <module>
File "/usr/lib/python2.7/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 266, in __init__
_Distribution.__init__(self,attrs)
File "/usr/lib/python2.7/distutils/dist.py", line 287, in __init__
self.finalize_options()
File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 301, in finalize_options
ep.load()(self, ep.name, value)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2195, in load
raise ImportError("%r has no %r attribute" % (entry, attr))
ImportError: <module 'setuptools.dist' from '/usr/lib/python2.7/dist-packages/setuptools/dist.pyc'> has no 'check_specifier' attribute
ERROR: Service 'alarm' failed to build: The command '/bin/sh -c easy_install -U pip zc.buildout setuptools' returned a non-zero code: 1
alarm 这个是 setuptools 的问题 ... pypa/pip#4104
这边 Docker build 退出后,重新安装需要再次重新输入所有参数
另外没有非交互式安装的功能 ...
https://github.com/leancloud/satori/blob/master/satori/install#L306
这边是不是检测到环境变量已定义后不出交互式提示比较好?
由于我们用的是腾讯云的邮箱,对方需要支持TLS,这块能否支持下?
open-falcon是使用 swcollector 来实现交换机监控的 ,不知道这个是否也可以使用 swcollector 来做交换机监控
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.