Oct18

zabbix2.0.8添加磁盘io监控

Author: leeon  Click: 8748   Comments: 0 Category: 架构  Tag: zabbix,disk,io

先修改zabbix_agentd.conf文件确认有Include配置项指向到用户自定义的配置目录:

通常为zabbix程序etc目录zabbix_agentd.conf.d下。

然后在zabbix_agentd.conf.d 目录下创建userparameter_diskio.conf文件,同时写入如下信息:

[code="plain"]
UserParameter=custom.vfs.dev.read.ops[*],cat /proc/diskstats | egrep $1 | head -1 | awk '{print $$4}'
UserParameter=custom.vfs.dev.read.ms[*],cat /proc/diskstats | egrep $1 | head -1 | awk '{print $$7}'
UserParameter=custom.vfs.dev.write.ops[*],cat /proc/diskstats | egrep $1 | head -1 | awk '{print $$8}'
UserParameter=custom.vfs.dev.write.ms[*],cat /proc/diskstats | egrep $1 | head -1 | awk '{print $$11}'
UserParameter=custom.vfs.dev.io.active[*],cat /proc/diskstats | egrep $1 | head -1 | awk '{print $$12}'
UserParameter=custom.vfs.dev.io.ms[*],cat /proc/diskstats | egrep $1 | head -1 y| awk '{print $$13}'
UserParameter=custom.vfs.dev.read.sectors[*],cat /proc/diskstats | egrep $1 | head -1 | awk '{print $$6}'
UserParameter=custom.vfs.dev.write.sectors[*],cat /proc/diskstats | egrep $1 | head -1 | awk '{print $$10}'
[/code]

然后到zabbix的后台“配置-模版”中导入如下模版即可:

http://www.leeon.me/upload/other/zbx_export_templates.xml



Sep7

【原创】ganglia监控部署小记

Author: leeon  Click: 6705   Comments: 0 Category: 架构  Tag: ganglia,python,plugin,monitor,监控

最近在捣鼓研究ganglia,汇总分享一些可能遇到的问题:

1.为什么编译ganglia的时候加了with-python还是没有lib/ganglia的目录下出现modpython.so?

这个问题主要是注意两点:

(1)with-python后面跟的是python的二进制路径,比如:

./configure --with-python=/usr/local/python/bin/python2.7
(2)python的libpython.so 必须软链到系统可识别的动态库路径下,就算在/et/ld.so.conf下指定了python的so路径都不行。例如
ln -s /usr/local/python/lib/libpython2.7.so /usr/local/lib/libpython2.7.so

软链后也要在/etc/ld.so.conf 下把/usr/local/python/lib 添加进去。


2. ganglia 的很多扩展插件在最新的ganglia的tar包下已经有封装了,直接拿来用就好了,不需要到网上到处找。路径就在解压缩后的路径下,例如:

ganglia-3.5.0/gmond/moduels 这个目录是用来告诉加载perl,python,php的so扩展。提供如下三个脚本插件的运行环境和相关配置。 

ganglia-3.5.0/gmond/perl_moduels perl语言监控插件脚本

ganglia-3.5.0/gmond/php_moduels  php语言监控插件脚本

ganglia-3.5.0/gmond/python_moduels python语言监控插件脚本


具体的配置含义可以看官方的文档http://sourceforge.net/apps/trac/ganglia/wiki/ganglia_gmond_python_modules

Cchecklist

To confirm that your Ganglia installation has Python support correctly setup, double check the following:

  • gmond.conf has a line which reads something along the lines of include ("/etc/ganglia/conf.d/*.conf"). This is the directory where you should place configuration files for your Python modules as.pyconf files
  • modpython.conf exists in /etc/ganglia/conf.d - it contains a directive which will include the pyconf files
  • You have modpython.so in /usr/lib{64}/ganglia
  • The directory /usr/lib{64}/ganglia/python_modules exists. This is the directory where Python modules should be placed as .py files.

These things should be automatically done for you if you installed Python modules support via binary packages. If that is not the case please file a bug at the distribution's corresponding bug tracker.

Ubuntu 10.10 notes

Ubuntu 10.10 does not come with Python support for gmond fully setup. You will need to:

  • Create /etc/ganglia/conf.d/modpython.conf and make it look like https://sourceforge.net/apps/trac/ganglia/browser/trunk/monitor-core/gmond/modules/conf.d/modpython.conf.in - for instance:
    modules {
      module {
         name = "python_module"
         path = "/usr/lib(64)/ganglia/modpython.so"
         params = "/usr/lib(64)/ganglia/python_modules"
      }
    }
    
    include('/etc/ganglia/conf.d/*.pyconf')
  • Create the directory /usr/lib(64)/ganglia/python_modules
  • Ensure that /usr/lib(64)/ganglia/modpython.so already exists (Ubuntu 10.10 gets this one right when you install ganglia via apt)




Jul14

【原创】Nutch2.2 部署问题小记

Author: leeon  Click: 6802   Comments: 0 Category: 架构  Tag: nutch,2,2,mysql

最近Nutch出新的2.2.1版本了,上个月才用2.1这个月就已经2.2.1,版本更新实在太快,以至于升级到新版本又遇到不少坑。索性再次记录一下一些比较麻烦的问题。

1. 从2.2版本开始对mysql数据源的配置就和2.1的默认支持不同了,这个地方的调整一定要严格遵守http://nlp.solutions.asia/?p=362 此文的说明对配置文件进行修改。

2. 切忌一定要在ivy文件修改后再去执行ant命令,这样才能自动的去下载指定的gora-sql版本的jar文件提供给mysql用,要不然nutch会每次执行命令提示找不到jdbc库。

3. 2.2版本的抓去命令没有2.1来的方便,而且目前测试发现处理性能比2.1要慢不少,但是内存占用要小一些。

Oct28

HAProxy学习小记

Author: leeon  Click: 7885   Comments: 0 Category: 架构  Tag: haproxy

近日研究了下haproxy,感觉很容易上手,遇到一些问题,索性记录一下:

1.关于日志输出的问题

现在haproxy的配置中文的global段里设置:

log 127.0.0.1   local3 info

因为我用的是rhel,里面内置的是rsyslogd,那么haproxy会类似于远程日志的方式通过rsyslog来输出日志,这里的ip就是配置的本地地址,通过514端口写入到系统日志进程中。local3 是日志标记,这个需要在/etc/rsyslog.conf中添加一行,类似于:

local3.* /usr/local/haproxy/log/haproxy.log

同时需要注意rsyslog进程需开启接收远程日志功能,在rsyslog.conf文件中将注释的端口启用参数开启即可

# Provides UDP syslog reception
$ModLoad imudp
$UDPServerRun 514

# Provides TCP syslog reception
$ModLoad imtcp
$InputTCPServerRun 514

如上所示。

 

2.haproxy进程 优雅重启

[code="bash"]
./haproxy -f ../conf/haproxy.cfg -st `cat ../log/haproxy.pid`
[/code]

 

3.haproxy的页面统计功能开启

stats   uri     /haproxy

 

分类

标签

归档

最新评论

Abyss在00:04:28评论了
Linux中ramdisk,tmpfs,ramfs的介绍与性能测试
shallwe99在10:21:17评论了
【原创】如何在微信小程序开发中正确的使用vant ui组件
默一在09:04:53评论了
Berkeley DB 由浅入深【转自架构师杨建】
Memory在14:09:22评论了
【原创】最佳PHP框架选择(phalcon,yaf,laravel,thinkphp,yii)
leo在17:57:04评论了
shell中使用while循环ssh的注意事项

我看过的书

链接

其他

访问本站种子 本站平均热度:8823 c° 本站链接数:1 个 本站标签数:464 个 本站被评论次数:94 次