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) |