Cacti
cacti日志报错: 05/25/2011 11:40:01 AM – SPINE: Poller[0] ERROR: SQL Failed! Error:'1062', Message:'Duplicate entry '3-mem_buffers-2011-05-25 11:40:01' for key 'PRIMARY'', SQL Fragment:'INSERT INTO poller_output (local_data_id, rrd_name, time, output) VALUES (3,'mem_buffers','2011-05-25 11:40:01','927912'),(4,'mem_swap','2011-05-25 11:40:01','4192956'),(5,'','2011-05-25 11:40:01','1min:0.10 5min:0.16 10min:0.23'),(6,'users','2011-05-25 11:40:01','4'),(7,'proc','2011-05-25 11:40:01','169'),(8,'hdd_free','2011-05-25 11:40:01','47949780'),(8,'hdd_used','2011-05-25 11:40:01','44424292')' Check – /etc/crontab – /etc/cron.d/cacti – crontab of root and cactiuser cat /etc/crontab SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root HOME=/ # [...]
spine是一个基于C语言的,非常快速的轮询引擎。使用 spine 比 使用 cmd.php 效率高,特别是在当 cmd.php 执行接近或超过 300 秒的时候。cmd.php采集存在大的延迟,从添加设备到up,spine通常不到一分钟,而cmd.php等的时间较长,超过10分钟。当设备down后 2分钟之内spine可以发出alert,而cmd.php可能需要10分钟以上。 yum install cacti-spine -y 配置 chmod +r /etc/spine.conf vim /etc/spine.conf 创建一个软链接文件(因为spine默认会去读取该sock文件) ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock 验证spine是否正常 /bin/spine 用管理员帐号登陆Cacti.在系统参数中制定Spine/Cactid的物理路径. Console -> Configuration -> Settings -> Paths -> Alternate Poller Path -> Spine Poller File Path /usr/bin/spine Cacti Settings (Poller)-> Poller Type spine Cacti在centos上的安装: yum [...]
模板下载: http://forums.cacti.net/about9861.html 安装脚本 wget http://forums.cacti.net/download.php?id=9907 gzip -d ws_apachestats.pl.gz cp apache.apache ws_apachestats.pl <path_cacti>/scripts/ chmod 0755 <path_cacti>/scripts/apache.apache ws_apachestats.pl 下载 xml 文件 http://forums.cacti.net/download.php?id=12524 在cacti控制台把 cacti087b_host_template_webserver__apache_444.xml 导入 cacti 客户机配置 <IfModule mod_status.c> <location /server-status> SetHandler server-status Order Deny,Allow Deny from all Allow from 127.0.0.1 Allow from 192.168.8.8 </location> 监控服务器(192.168.8.8)测试: ./ws_apachestats.pl clint_ip apache_busy_workers:33 apache_idle_workers:42 thread_O:949 threadC:2 [...]
模板下载: http://forums.cacti.net/about26458.html&highlight=nginx cp get_nginx_clients_status.pl <path_cacti>/scripts/ cp get_nginx_socket_status.pl <path_cacti>/scripts/ chmod 0755 <path_cacti>/scripts/get_nginx_socket_status.pl chmod 0755 <path_cacti>/scripts/get_nginx_clients_status.pl 安装perl模块: yum install perl-libwww-perl 导入模板 cacti_graph_template_nginx_clients_stat.xml cacti_graph_template_nginx_sockets_stat.xml 添加主机、图像时url要包含客户机地址,比如http://XX.YY.AA.ZZ/nginx_status/, 而不是/nginx_status/ 客户机启用 nginx http_stub_status_module 模块 vi nginx.conf location /nginx_status { stub_status on; disable access_log if requared access_log off; allow XX.YY.AA.ZZ; deny all; } XX.YY.AA.ZZ为网管监控服务器ip地址。
安装Python支持: yum install python-setuptools 下载安装python for memecached api,Python Client API Installation: 地址: http://dealnews.com/developers/cacti/memcached.html tar xzf python-memcached-<ver>.tar.gz. python setup.py install 模板安装,Template Installation: 下载 cacti-memcached-.tar.gz tar xzf cacti-memcached-<ver>.tar.gz Copy (or upload) the memcached.py script to the <cacti path>/scripts/ directory on the server that cacti is installed on. [optional] – Verify that the memcached.py script properly works by [...]
目前最好用的监控mysql InnoDB 数据库的方法之一 http://code.google.com/p/mysql-cacti-templates/ wget http://mysql-cacti-templates.googlecode.com/files/better-cacti-templates-1.1.7.tar.gz tar -xzf better-cacti-templates-1.1.7.tar.gz -C /usr/local/src cd /usr/local/src/better-cacti-templates-1.1.7 cp scripts/ss_get_mysql_stats.php /usr/local/www/html/cacti/scripts cd /usr/local/www/html/cacti/scripts vim ss_get_mysql_stats.php $mysql_user = 'cacti'; $mysql_pass = 'cacti'; $mysql_port = 3306; 设置准备监控的数据库的账户相关信息 创建监控Mysql需要的账户以及权限 配置MySQL服务器,让cacti所在机器能够访问MySQL服务器的状态信息,必须拥有”process”权限。如果要监控InnoDB状态,还必须有”SUPER”权限。 grant process,super on *.* to 'cacti'@'%' identified by 'cacti'; flush privileges; 帐号测试: cd /usr/local/www/html/cacti/scripts php -q ./ss_get_mysql_stats.php –host 10.88.1.134 –items cv,cx,cy,cz –user cacti [...]
手工运行snmpwalk命令正常: snmpwalk -v 1 10.168.12.90 -c public system SNMPv2-MIB::sysDescr.0 = STRING: DGS-1248T snmpwalk -v2c -c public 10.168.12.90 if IF-MIB::ifIndex.1 = INTEGER: 1 DGS-1248T 支持snmp v2,不支持64位MIB库.如下如果返回的有几行含有“Counter64:”的话.那么表明是支持的。 snmpwalk -v2c -c public 10.168.12.90 ifHCInOctets cacti snmp error,同时debug信息为: Data Query Debug Information + XML file parsed ok. + Executing SNMP walk for list of indexes @ '.1.3.6.1.2.1.2.2.1.1' + No [...]
近期评论