Chinaunix首页 | 论坛 | 博客
  • 博客访问: 71884
  • 博文数量: 21
  • 博客积分: 1410
  • 博客等级: 上尉
  • 技术积分: 250
  • 用 户 组: 普通用户
  • 注册时间: 2007-12-29 09:40
文章分类
文章存档

2008年(13)

2007年(8)

我的朋友
最近访客

分类: 系统运维

2007-12-29 09:43:47

CACTI服务器
客户端(WEB 服务器)
下午WEB服务器上httpd进程突然变成了将近300个 严重印象了网站访问速度 重新启动HTTPD服务
于是在CACTI服务器上做了一幅HTTPD进程数显示的图 过程虽简单 但还是记下来吧 步骤如下

1.在CACTI服务器上做 DATA template、GRAPH template 然后新建 DATA sources、Graph
  其中DATA和GRAPH的template可参见其他摸版 不再具体记录
注:DATA Template中OID我用的是.1.3.6.1.4.1.2021.59.101.1 (具体可参考man snmpd.conf)
exec MIBNUM NAME PROG ARGS
              If MIBNUM is not specified, the agent executes the named PROG with arguments of ARGS  and  returns  the  exit status and the first line of the STDOUT output of the PROG program to queries of the 1.3.6.1.4.1.2021.8.1.100 and 1.3.6.1.4.1.2021.8.1.101 mib columns (respectively).  All STDOUT output beyond the first line is silently truncated.
              If  MIBNUM  is  specified, it acts as above but returns the exit status to MIBNUM.100.0 and the entire STDOUT output to the table MIBNUM.101 in a MIB table.  In this case, the MIBNUM.101 mib contains the  entire  STDOUT output,  one  MIB table entry per line of output (ie, the first line is output as MIBNUM.101.1, the second at  MIBNUM.101.2, etc...).
2.在客户端WEB服务器
    建立只一语句的脚本/opt/performance/linux/httpprocess-no.sh
       ps aux|grep httpd|wc -l
    修改/etc/snmmp/snmpd.conf 添加语句
       exec .1.3.6.1.4.1.2021.59 /bin/bash /opt/performance/linux/httpprocess-no.sh
    然后重新启动snmpd服务
       service snmpd reload
3.在客户端WEB服务器上可以查看是否有正确结果 命令
    snmpwalk -v 1 localhost -c **** .1.3.6.1.4.1.2021.59
    看是否有正确结果输出
4.在CACTI服务器上执行命令
    su - cactiuser
    php /***/www/html/cacti/poller.php
    执行脚本读取客户端WEB服务器上的数据 然后刷新CACTI的页面 即可看到图象 或者执行
    rrdtool fetch /***/www/html/cacti/rra/***.rrd AVERAGE 看时候有数据写入
其中 最烦琐的工作是建立DATA和GRAPH摸版 :(
阅读(552) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:cacti监控LVS

给主人留下些什么吧!~~