cacti登录密码忘记解决方法
如果是admin 的密码丢失,id = 1;其他用户以此类推。
进入mysql
mysql> show databases;
mysql> use cacti;
mysql> show tables;
mysql> update user_auth set password=md5("newpassword") where id='1';
新的cacti密码就是newpassword了~~
以前自己曾经解决的,当时自己记住了,过了好长时间,重新在新的机器上安装cacti的时候,却忘记提前修改,导致一些不必要的麻烦。
帖出来希望对自己或者对大家有帮助
1、一般说来,图片的流量统计描述都是 |host_description| - Traffic - |query_ifName| 按照这个形式来描述的,对于华为的设备,Gi显示成GigabitEthernet,可能导致后面的模块号,端口好无法显示。如 GigabitEthernet4/3/2显示成GigabitEthernet,
解决办法:
Console -> Settings -> Visual -> Maximum Field Length: 默认 15,我修改成30就OK了。
The maximum number of characters to display for a data query field.
2、对于Traffic 大于800Mbits/s的无法显示问题: 在创建graph前修改 Data Templates -> Interface Traffic -> 1: traffic_in -> Maximum Value Use Per-Data Source Value 默认是100000000 后面再添 几个0就OK了,同样 2: traffic_out也要修改哦,最好在使用new graph创建新的graph之前修改后,否则之后修改会有一定的麻烦,甚至无法正常工作。
3、以前都是直接下载tar.gz源代码包安装的,按照readme就可以搞定一切。目前在FC4下可以直接通过yum instal cacti就安装完成,安装后却不知道怎么使用,也不知道安装到什么地方了,怎么让cacti工作。
首先了解rpm包安装了那些有用的文件:
rpm程序把cacit的php文件放到/usr/share/cacti目录下。
在/etc/httpd/conf.d/cacit.conf
==============================
#
# Cacti: An rrd based graphing tool
#
Alias /cacti /usr/share/cacti
<Directory /usr/share/cacti/>
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Directory>
==============================
在apache的配置里面只允许localhost访问/cacti这个虚拟目录。
[iyunv@elm ~]# cd /etc/cron.d
[iyunv@elm cron.d]# more cacti
*/5 * * * * cacti /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1
[iyunv@elm cron.d]#
定期执行程序的cron配置。
下面介绍如何让cacti工作:
首先,配置数据库:
[iyunv@elm local]# cd /usr/share/doc/cacti-0.8.6h/
[iyunv@elm cacti-0.8.6h]# ls
cacti.sql docs LICENSE README
[iyunv@elm cacti-0.8.6h]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 312 to server version: 4.1.16
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
Other也有R权限,那么请把机器的SElinux关闭,目前我不知道其他办法。
[iyunv@elm rra]# cd /etc/selinux/
[iyunv@elm selinux]# more config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted
[iyunv@elm selinux]#
注意红色部分,重新启动机器后就OK了。
6、我只想显示整数怎么办?
修改Graph Templates下的Graph Template Items的GPRINT Type,改成Exact Number
7、我原来使用的是rrdtool-1.0.x 升级到 1.2.x 后部分图像无法显示(Zoom)
修改Configuration -> Settings -> RRDTool Utility Version -> 1.2.x
snmpwalk -v 2c -c public yourIP if
如果有数据返回,则snmp的数据没有问题。如果出现“Timeout: No Response from ...”之类的错误信息则是snmp设置的问题。
再说有图无数据吧,一般这样的情况就是snmp采集的结果有问题。这种情况下,一般也会出现新建的device的Data Query里面的状态总是“ Success [0 Items, 0 Rows]”。通过执行snmp命令来检查:
snmpwalk -c community -v 2c hostIP if
通过结果可以看到是否允许cacti取这些OID的数据。
eg:
snmpwalk -c public -v1 192.168.0.221 .1.3.6.1.2.1.2.2.1.16.2
当cacti 有图没有数据时,而且状态为nan错误解决办法
解决办法:
1.
[iyunv@codfei rra]# pwd
/usr/local/apache2/htdocs/cacti/rra
[iyunv@codfei rra]# rrdtool fetch fxd-mdl11_traffic_in_365.rrd AVERAGE
按照以上命令执行如果结果输出为:
1197990600: nan nan
1197990900: nan nan
1197991200: nan nan
1197991500: nan nan
1197991800: nan nan
1197992100: nan nan
则表示snmp获取数据有问题,经过仔细检查发现不能获取流量的主机都是64位系统,
用以下命令检查:
[iyunv@codfei rra]# snmpwalk -c public -v 2c 192.168.1.2 IF-MIB::ifHCInOctets
输出内容如下,表明不支持64位MIB库,终于找到原因了。
IF-MIB::ifHCInOctets = No Such Object available on this agent at this OID
2,需要重新安装snmpd支持64位MIB库,不过正常用源码包安装时在make的时候会出现error,无法继续,
解决方法:
在源码包下config后,先不要make,请先修改以下两个文件。
[iyunv@codfei net-snmp-5.3.1]# vi apps/Makefile
TRAPDWITHAGENT = $(USETRAPLIBS) -ldl -lrpm -lrpmio -lpopt -lz -lcrypto -lm
替换成:
TRAPDWITHAGENT = $(USETRAPLIBS) -ldl -lrpm -lrpmio /usr/lib64/libpopt.so -lz -lcrypto -lm
[iyunv@codfei net-snmp-5.3.1]# vi agent/Makefile
LIBS = ../snmplib/libnetsnmp.$(LIB_EXTENSION)$(LIB_VERSION) -ldl -lrpm -lrpmio -lpopt -lz -lcrypto -lm $(PERLLDOPTS)
替换成:
LIBS = ../snmplib/libnetsnmp.$(LIB_EXTENSION)$(LIB_VERSION) -ldl -lrpm -lrpmio /usr/lib64/libpopt.so -lz -lcrypto -lm
然后在进行make && make install
3,停止当前linux自带的snmpd,通过daemoonls启动新安装的snmpd就能了。
这时在用snmpwalk检测,支持64位MIB库了,过一会流量监视的图片也出来了!
[iyunv@codfei rra]# snmpwalk -c public -v 2c 192.168.1.2 IF-MIB::ifHCInOctets
IF-MIB::ifHCInOctets.1 = Counter64: 2400309170
IF-MIB::ifHCInOctets.2 = Counter64: 256326257624
IF-MIB::ifHCInOctets.3 = Counter64: 0
IF-MIB::ifHCInOctets.4 = Counter64: 624808037429
IF-MIB::ifHCInOctets.5 = Counter64: 0
IF-MIB::ifHCInOctets.6 = Counter64: 0
IF-MIB::ifHCInOctets.7 = Counter64: 0
IF-MIB::ifHCInOctets.8 = Counter64: 0 Cacti监控远程服务器问题解决
使用模板ucd/net - Memory Usage,检测局域网内别的机器发现有图,但是无数据,都是nan,
cacti log有如下错误
04/22/2009 02:10:08 AM - CMDPHP: Poller[0] Host[7] DS[44] WARNING: Result from SNMP not valid. Partial Result: U
04/22/2009 02:10:08 AM - CMDPHP: Poller[0] Host[7] DS[43] WARNING: Result from SNMP not valid. Partial Result: U
04/22/2009 02:10:08 AM - CMDPHP: Poller[0] Host[7] DS[42] WARNING: Result from SNMP not valid. Partial Result: U
04/22/2009 02:10:08 AM - CMDPHP: Poller[0] Host[7] DS[41] WARNING: Result from SNMP not valid. Partial Result: U
04/22/2009 02:10:08 AM - CMDPHP: Poller[0] Host[7] DS[40] WARNING: Result from SNMP not valid. Partial Result: U
04/22/2009 02:10:08 AM - CMDPHP: Poller[0] Host[7] DS[39] WARNING: Result from SNMP not valid. Partial Result: U
于是
wget ftp://mirror.switch.ch/pool/1/mirror/scientificlinux/5rolling/i386/SL/net-snmp-utils-5.3.1-24.el5_2.1.i386.rpm
安装获得snmpget snmpwalk snmpbulkwakl snmpgetnext
snmpwalk -v 2c -c public your_remote_ip if
错误:
Timeout: No Response from your_remote_ip
于是修改snmpd配置 并启动snmpd
com2sec notConfigUser default public--->com2sec notConfigUser your_snmpd_server_ip public
#view all included .1 80---->view all included .1 80
snmpwalk -v 2c -c public your_remote_ip system ok
但
snmpwalk -v 2c -c public your_remote_ip if
错误:
IF-MIB::ifTable = No Such Object available on this agent at this OID
于是再次修改snmpd.conf,并重启snmpd
access notConfigGroup "" any noauth exact systemview none none-->
access notConfigGroup "" any noauth exact all none none
再次snmpwalk -v 2c -c public your_remote_ip if
ok
再访问页面终于图和数据出来了