博客首页 注册 建议与交流 排行榜 加入友情链接
推荐 投诉 搜索: 帮助

野狗之家

山间一寺一壶酒,独酌莫如去相亲,何必伶丁叹寂寥,碧海青天夜夜心,莫愁前路无知己,淘遍黄金始见沙,过尽千帆皆不是,终有一款适合您.--诺基亚真皮实!
wysilly.cublog.cn
Cacti 0.8.7a 中文版 (UTF-8) 及 plugin-0.8.7a-PA-v1.4
 
针对cacti-0.8.6j汉化版的诸多翻译错误进行了更正,重新考虑了安装问题,此版本不再需要php支持mbstring.安装方式与英文版基本相同.
下面是相关文件:cacti-0.8.7a的中文版文件(UTF-8)及Plugin Architecture v1.4的补丁.

文件: cacti-0.8.7a-cn-utf8.tar.gz
大小: 1963KB
下载: 下载

文件: cacti-plugin-0.8.7a-PA-v1.4-cn-utf8.diff.gz
大小: 11KB
下载: 下载

安装说明:
1.安装RRDtool-1.2.15或以上版本,不需要修改任何文件.
2.下载并安装cjkuni-fonts中文字体,字体名ukai.ttf,下载地址
http://ftp.tw.debian.org/debian/pool/main/t/ttf-arphic-ukai/ttf-arphic-ukai_0.1.20060928.orig.tar.gz
3.生成cacti数据库时注意定义character set为 utf8.
mysql> create database cacti default character set utf8;
#mysql cacti < <patch-cacti>/cacti.sql
4.安装完成后注意在"设置"中更改下面两个必改项.
常规->RRDTool应用程序版本 改为1.2.x,默认为1.0.x.不改可能图像不能正常显示出来.
路径->RRDTool默认字体路径 改为上面安装的ukai.ttf的文件路径,如/usr/share/fonts/ukai.ttf
5.除了在生成数据库是要指定字符集外,其它的安装方式与英文版完全一致.保证了版本的通用性.
6.相关补丁已打,将来会和官方版本同步.

7.关于在windows下安装,请使用官方版本的rrdtools-1.2.15,并修改lib/rrd.php,在第80
行(即$command_line = str_replace("\\\n", " ", $command_line);)下加入以下几行:

 if ($config["cacti_server_os"] == "win32") {
 if ( !ereg("^xport ", $command_line)) {
    $command_line = iconv("UTF-8","gb2312", $command_line);
 }
 }

感谢mijuu的提问.

 

例图:

发表于: 2007-11-07,修改于: 2007-12-20 21:37,已浏览3805次,有评论30条 推荐 投诉
网友: 本站网友 时间:2007-12-14 17:02:31 IP地址:219.148.111.★
不行呀,是不是版本文件有问题?安装不了

网友: wysilly 时间:2007-12-14 17:57:37 IP地址:221.223.108.★
出什么错?

网友: wysilly 时间:2007-12-14 18:14:31 IP地址:221.223.108.★
刚才从新安了一遍,没有什么问题.见例图

网友: mijuu 时间:2007-12-18 15:26:38 IP地址:218.1.21.★
在WIN SERVER 2K3,IIS.0,PHP 5.24环境下,Cacti页面一切正常,不过rrd图片无法显示,RRA目录下rrd文件缺少中文主机名,变成'_traffic_in_10.rrd'这样,如果主机名使用数字或者英文则正常.RRDtool测试'_traffic_in_10.rrd'文件是正确的,使用命令行出图正常.
之前也试过在Windows环境下Cacti的中文化,都是卡在RRDtool的出图上,出图均为乱码,手动命令行出图中文则正常,推断应该是PHP使用ISO-8859-1传递gb2312码给RRDtool的问题,可是找不到解决方法,不知道wysilly兄有没有什么方法解决.

网友: wysilly 时间:2007-12-18 20:43:25 IP地址:221.223.108.★
正常的,使用中文时文件名均为类似的形式(_traffic_in_10.rrd'),现在你的问题很可能是没有正确设置rrd的版本为1.2.x.
见我上面写的.再发一张图做参考.

网友: mijuu 时间:2007-12-18 21:18:21 IP地址:124.77.167.★
汗…… RRDtool版本不可能会搞错的。。  win下的RRDtool是自己用minGW32编译的,官方编译的win32版本也用过,直接命令行调用RRDtool出图完全正常,中文显示也不乱码。
现在觉得问题应该就是win下php环境和linux下有些标准上的区别,比如win下的cacti如果不修改php代码setlocale(LC_TIME),查看图像中的预置图像区间时间就会用GMT+0。
关于文件名,正常的文件名应该是(1.1.1.1_traffic_in_10.rrd)或者(servername_traffic_in_10.rrd)这样,可是我出来的是(_traffic_in_10.rrd),前面的主机名就完全被省略掉了,或者这个是中文版的一个BUG?

网友: wysilly 时间:2007-12-20 00:25:14 IP地址:221.223.96.★
我使用的是官方版本rrdtool-1.2.15-win32-perl58.zip,使用此版本,修改rrd.php,在第80行,即$command_line = str_replace("\\\n", " ", $command_line);后加入以下几行即可.
    if ($config["cacti_server_os"] == "win32") {
    $command_line = iconv("UTF-8","gb2312", $command_line);
    }

网友: mijuu 时间:2007-12-20 16:15:22 IP地址:218.1.21.★
OK,搞定了~
昨天将wysilly兄的中文版8.7a全部换为GB2312的格式和代码,已经能正常出图.不过怎么就没想到再把命令行转回gb2312~  hehe
还是换回wysilly兄的原版好了.
对了,关于输出的RRA文件名,英文版中加入中文服务器名输出也是不正常的,看起来是被过滤掉了.
中文版的cacti非常漂亮,感谢wysilly兄

网友: 恍若如梦 时间:2007-12-20 18:01:27 IP地址:221.7.131.★
请问如何将0.87a转成gb2312呢?我目前使用的是0.86j,请问可以升级到0.87a吗?步骤如何呢?谢谢~

网友: wysilly 时间:2007-12-20 21:42:16 IP地址:221.223.112.★
mijuu:更完善的方案如下.可以保证graph_xport.php导出的csv文件内容正常.
if ($config["cacti_server_os"] == "win32") {
 if ( !ereg("^xport ", $command_line)) {
    $command_line = iconv("UTF-8","gb2312", $command_line);
 }
 }

恍若如梦 :
在我以前写的0.8.6j中文版的文档中有相关内容,你可以参考一下.翻一下我的blog就可以看到.

网友: yerunian 时间:2007-12-21 02:57:09 IP地址:59.36.166.★
我下载解压好像出问题

网友: 本站网友 时间:2007-12-21 03:23:57 IP地址:59.36.166.★
我的邮箱是这个你能不能发一个cacti-0.8.7a-cn-utf8.tar.gz给我呢还有补丁
谢谢
yerunian@163.com

网友: wysilly 时间:2007-12-21 19:26:10 IP地址:221.223.99.★
下载后为*.gz文件,把它改为*.tar.gz,这样winrar就可以解压了.
linux下,直接tar -zxvf *.gz

网友: 本站网友 时间:2007-12-29 14:04:54 IP地址:219.134.177.★
您好,我在linux下安装了cacti中文版,能够正常使用,但是我想安装cacti相关的插件,使用cacti-plugin-0.8.7a-PA-v1.4-cn-utf8.diff.gz进行插件的安装却不行呢,我的方法如下,请帮忙看看是否哪里出错了
----------
1.安装cacti utf8-cn版本
2.下载cacti-plugin-0.8.7a-PA-v1.4-cn-utf8.diff.gz和cacti-plugin-arch.tar.gz,解压后者,然后再解压前者,覆盖cacti-plugin-0.8.7a-PA-v1.4.diff文件,进入cacti utf8-cn目录使用patch进行插件模块安装,结果提示失败,信息如下
----------------------
patch -p1 -N <cacti-plugin-0.8.7a-PA-v1.4-cn-utf8.diff 
patching file auth_changepassword.php
patching file auth_login.php
Hunk #2 succeeded at 255 (offset -2 lines).
Hunk #3 succeeded at 321 with fuzz 1.
patching file data_sources.php
Hunk #1 FAILED at 1138.
1 out of 1 hunk FAILED -- saving rejects to file data_sources.php.rej
patching file graph_image.php
patching file graph.php
Hunk #1 FAILED at 93.
Hunk #2 FAILED at 208.
Hunk #3 FAILED at 241.
3 out of 3 hunks FAILED -- saving rejects to file graph.php.rej
patching file graphs_new.php
Hunk #1 FAILED at 473.
1 out of 1 hunk FAILED -- saving rejects to file graphs_new.php.rej
patching file graphs.php
Hunk #1 succeeded at 45 with fuzz 1.
Hunk #3 succeeded at 503 (offset 6 lines).
patching file host.php
Hunk #1 succeeded at 44 with fuzz 1.
Hunk #3 succeeded at 449 (offset 3 lines).
patching file include/auth.php
Hunk #1 FAILED at 76.
Hunk #2 FAILED at 84.
2 out of 2 hunks FAILED -- saving rejects to file include/auth.php.rej
patching file include/global_arrays.php
Hunk #1 succeeded at 22 with fuzz 1.
Hunk #2 succeeded at 597 with fuzz 1 (offset 2 lines).
patching file include/global_form.php
Hunk #2 succeeded at 1154 (offset 9 lines).
patching file include/global.php
patching file include/global_settings.php
patching file include/plugins.php
patching file include/top_graph_header.php
Hunk #1 FAILED at 92.
Hunk #2 FAILED at 127.
Hunk #3 succeeded at 142 (offset -1 lines).
Hunk #4 FAILED at 154.
3 out of 5 hunks FAILED -- saving rejects to file include/top_graph_header.php.rej
patching file include/top_header.php
Hunk #1 FAILED at 22.
Hunk #2 FAILED at 49.
Hunk #3 succeeded at 61 (offset -1 lines).
Hunk #4 FAILED at 73.
Hunk #6 succeeded at 94 (offset -1 lines).
3 out of 6 hunks FAILED -- saving rejects to file include/top_header.php.rej
patching file index.php
Hunk #2 succeeded at 48 (offset 1 line).
patching file lib/api_device.php
patching file lib/functions.php
Hunk #1 succeeded at 1476 (offset -1 lines).
Hunk #2 FAILED at 1489.
Hunk #3 succeeded at 1567 with fuzz 1.
1 out of 3 hunks FAILED -- saving rejects to file lib/functions.php.rej
patching file lib/html_form.php
Hunk #1 FAILED at 655.
Hunk #3 FAILED at 693.
2 out of 3 hunks FAILED -- saving rejects to file lib/html_form.php.rej
patching file lib/html.php
Hunk #2 FAILED at 100.
Hunk #4 FAILED at 147.
Hunk #8 FAILED at 596.
3 out of 8 hunks FAILED -- saving rejects to file lib/html.php.rej
patching file lib/html_tree.php
patching file lib/poller.php
patching file lib/rrd.php
Hunk #1 succeeded at 484 (offset -1 lines).
Hunk #2 succeeded at 1165 (offset -21 lines).
Hunk #3 succeeded at 1200 (offset -1 lines).
patching file lib/variables.php
patching file plugins/index.php
patching file poller.php
Hunk #4 succeeded at 426 with fuzz 1.
patching file user_admin.php
Hunk #4 FAILED at 904.
Hunk #5 succeeded at 932 with fuzz 2.
1 out of 6 hunks FAILED -- saving rejects to file user_admin.php.rej
patching file utilities.php
Hunk #2 succeeded at 1323 (offset -3 lines).
3.下载相关插件进行安装配置,无法显示插件界面

但是用cacti原版,和原版插件是能够正常使用的

网友: 本站网友 时间:2007-12-29 14:31:35 IP地址:219.134.177.★
哦,不好意思,原来是可以的,是因为个人疏忽,把目录搞错了所以出现以上打补丁失败的错误

谢谢楼主了

网友: 本站网友 时间:2008-01-28 17:41:34 IP地址:61.220.56.★
 可以用繁體版嗎

网友: 恍若如梦 时间:2008-02-02 10:05:35 IP地址:221.7.131.★
请问,如何让cacti0.87a 导出csv是中文呢?我导出的时候是乱码,在rra.php和graph_xport.php也找不到楼上所说的代码呢~

网友: wysilly 时间:2008-02-02 21:24:23 IP地址:221.223.111.★
是lib/rrd.php.

网友: wysilly 时间:2008-02-02 21:26:42 IP地址:221.223.111.★
关于繁体版,找一个批量转换工具来进行简繁转换.,

网友: 本站网友 时间:2008-02-10 03:04:12 IP地址:124.227.210.★
你好,wysilly ,我使用的你的版本,安装好后,打开ip/cacti后,一片空白,页面已经跳转到cacti/install,这是什么原因呢? 我用英文原版的cacti是可以显示出安装页面的,另外,我不会装字体,是不是因为没有装字体的原因造成的呢?如果是。那么字体怎么装?谢谢

网友: wysilly 时间:2008-02-11 11:11:26 IP地址:221.223.100.★
出现空白时,清一下ie的缓存,我遇到过这种情况,没有进一步分析,只是关闭ie,重新打开就好了.
安装完成后,指字字体文件所在路径即可.

网友: 恍若如梦 时间:2008-02-13 14:41:09 IP地址:221.7.131.★
HI,先祝wysilly新年快乐,身体健康,鼠钱数不完,呵.
新的cacti 0.87b已经放出来了,请问,会第一时间更新吗?
这次更些了些什么呢?

网友: timemax 时间:2008-03-12 11:27:50 IP地址:58.248.180.★
 mijuu 兄,看到你可以在widows 命令行下手动出rrdtool中文的图,我这里出的图中文部分怎么都是乱码的,1.2.15以上的版本基本都试边了,真是急死人了,望见贴指教一二或留下你的email。timemax@163.com

网友: 本站网友 时间:2008-03-28 16:14:18 IP地址:61.190.196.★
字体文件只是解压就可以了吗?

网友: berg 时间:2008-08-05 22:51:43 IP地址:125.96.147.★
wysilly,我想请问一下 
为什么我用IE打开之后一片空白?
按照上面你说的我清空缓存,删除历史、脱机内容,甚至重启,都没有效果
而且我换用别的电脑登陆问题依旧
但是用firefox就可以顺利访问
能帮我一下吗? 谢谢了!!

网友: berg 时间:2008-08-05 22:58:55 IP地址:125.96.147.★
另外还有一个问题
只有从  设备--为此设备生成图像  才可以生成图吗?
怎么我在别的地方添加以后都不出图呢?

网友: berg 时间:2008-08-05 23:48:22 IP地址:125.96.147.★
刚才我又查了一下
好像和这段代码有关
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
但是cacti的index.php中又调用了其他两个php页面。
我不太懂php。。麻烦博主帮我看一下吧
万分感谢!!

网友: wysilly 时间:2008-08-08 09:27:44 IP地址:222.223.229.★
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
放在<head></head>段的第一行,ie解析html时,有点怪异.

网友: 本站网友 时间:2008-10-24 11:05:01 IP地址:219.143.88.★
页面空白,看看PHP.ini里是不是设置了默认字符集!
试修改PHP.ini 的default_charset = "gb2312" 改成 default_charset = "utf-8"

网友: james81 时间:2008-10-24 11:10:47 IP地址:219.143.88.★
像上面的测试一下, 重起apache,就应该可以了!! 


给我留言
版权所有 ChinaUnix.net 页面生成时间:0.81223