Ubuntu 9.1 上配置静态IP地址
[
2010/08/26 20:33 | by 张明辉 ]
2010/08/26 20:33 | by 张明辉 ]
今天我的Ubuntu 9.1 系统不能自动获取IP,自己手动设置静态IP和DNS上网
记录如下:
之前是使用DHCP获取IP.现在该为如下:
最后重启网卡服务
root@zhangmh:~# ifconfig
如下图:

最后配置DNS
8
完毕!
记录如下:
引用
root@zhangmh:~# cat /etc/network/interfaces
auto eth0
iface eth0 inet dhcp
auto eth0
iface eth0 inet dhcp
之前是使用DHCP获取IP.现在该为如下:
引用
root@zhangmh:~# cat /etc/network/interfaces
auto eth0
iface eth0 inet static
###add zhangmh####
address 192.168.1.27
netmask 255.255.255.0
gateway 192.168.0.9
auto eth0
iface eth0 inet static
###add zhangmh####
address 192.168.1.27
netmask 255.255.255.0
gateway 192.168.0.9
最后重启网卡服务
root@zhangmh:~# ifconfig
如下图:
最后配置DNS
引用
root@zhangmh:~# cat /etc/resolv.conf
nameserver 4.2.2.2
nameserver 8.8.8.
nameserver 4.2.2.2
nameserver 8.8.8.
完毕!
mysql4 通过mysql5认证
[
2010/07/19 14:23 | by 张明辉 ]
2010/07/19 14:23 | by 张明辉 ]
因为线上存在mysql版本的差异,因此经常需要mysql4从mysql5 server 上认证去拿资料
因此需要在mysql5上授权mysql4客户端。
方法如下:
mysql> GRANT SELECT ON somedatabase.sometables TO 'some_user'@'some_hosts' identified by 'password';
mysql> update mysql.user set PassWord = OLD_PASSWORD('newpassword')
-> where Host = 'some_host' and user = 'some_user';
mysql> flush privileges;
因此需要在mysql5上授权mysql4客户端。
方法如下:
引用
mysql> GRANT SELECT ON somedatabase.sometables TO 'some_user'@'some_hosts' identified by 'password';
mysql> update mysql.user set PassWord = OLD_PASSWORD('newpassword')
-> where Host = 'some_host' and user = 'some_user';
mysql> flush privileges;
使用Cacti监控Nginx状态
[
2010/02/09 09:53 | by 张明辉 ]
2010/02/09 09:53 | by 张明辉 ]
Cacti是一款不错的开源网络设备,系统监控软件。我们生产中就是使用Cacti中监控系统状态。今天介绍使用Cacti如何监控Nginx状态
Nginx中有一个很好的模块【http_stub_status_module】完成Nginx运行的状态。
但是它只能通过web页面查看状态,如果需要监控的话,就必须写脚本完成。以下就是用Perl脚本完成Nginx的监控
1:给系统安装LWP::UserAgent模块
RedHat下可以通过以下命令:
2:下载监控脚本
下载文件 (已下载 142 次)
3:添加监控模板
解压压缩包
cacti_graph_template_nginx_clients_stat.xml
cacti_graph_template_nginx_sockets_stat.xml
get_nginx_clients_status.pl
get_nginx_socket_status.pl
上传.pl 脚本到cacti 目录下scripts 并设置可执行权限跟755读写权限
然后打开Cacti的界面,点击左边导航条上的Import Templates。
如下图:

Nginx中有一个很好的模块【http_stub_status_module】完成Nginx运行的状态。
但是它只能通过web页面查看状态,如果需要监控的话,就必须写脚本完成。以下就是用Perl脚本完成Nginx的监控
1:给系统安装LWP::UserAgent模块
RedHat下可以通过以下命令:
引用
yum -y install perl-libwww-perl
或者
cpan -i LWP::UserAgent
或者
cpan -i LWP::UserAgent
2:下载监控脚本
下载文件 (已下载 142 次)3:添加监控模板
解压压缩包
cacti_graph_template_nginx_clients_stat.xml
cacti_graph_template_nginx_sockets_stat.xml
get_nginx_clients_status.pl
get_nginx_socket_status.pl
上传.pl 脚本到cacti 目录下scripts 并设置可执行权限跟755读写权限
然后打开Cacti的界面,点击左边导航条上的Import Templates。
如下图:
syslog-ng 日志系统深入研究【原创】
[
2009/12/09 12:38 | by 张明辉 ]
2009/12/09 12:38 | by 张明辉 ]
syslog-ng 软件是syslog 升级版。他解决了syslog 上不能灵活定制系统log 路径和过滤机制,并且它有自定义规则,允许client 端自定义消息内容,支持正则表达式.... 等等。
本人所管理的服务器中就是用了syslog-ng 作为日志系统的实例。

下面介绍最基本的syslog-ng安装配置
1:通过Yum 安装
本人所管理的服务器中就是用了syslog-ng 作为日志系统的实例。
下面介绍最基本的syslog-ng安装配置
1:通过Yum 安装
引用
[root@cactiez tmp]# rpm -e --nodeps syslog
卸载系统自带的syslog,或者将其停止 services syslog stop;checkconfig syslogd off
[root@cactiez tmp]# yum -y install syslog-ng
安装新的syslog-ng
卸载系统自带的syslog,或者将其停止 services syslog stop;checkconfig syslogd off
[root@cactiez tmp]# yum -y install syslog-ng
安装新的syslog-ng
Cacti Cisco 模板汇总
[
2009/11/25 18:51 | by 张明辉 ]
2009/11/25 18:51 | by 张明辉 ]
Switch
http://forums.cacti.net/about4843.html 【Cisco 2900-3500 switch template】
http://forums.cacti.net/about4846.html 【Cisco 4500 switch template】
http://forums.cacti.net/about10085.html 【Few Templates (NetScreen,Nokia,Cisco,Fortigate)】
http://forums.cacti.net/about4844.html 【Cisco 6500 switch template】
Router
http://forums.cacti.net/about4841.html 【Cisco 2600-3600 router template】
http://forums.cacti.net/about4845.html 【Cisco 7200 router template】
http://forums.cacti.net/about4333.html 【Cisco router - buffer failure templates】
http://forums.cacti.net/about5603.html 【Cisco routers (cpu, temperature and memory) templates】
http://forums.cacti.net/about7401.html 【Cisco CBWFQ monitoring】
http://forums.cacti.net/about17775.html 【Cisco Router - Class Map statistics】
http://forums.cacti.net/about4136.html 【Cisco Router - Cisco SAA Jitter/Jitter-error/http template】
http://forums.cacti.net/about30177.html 【Cisco BGP Peer Accepted Prefixes count SNMP query】
引用
http://forums.cacti.net/about4843.html 【Cisco 2900-3500 switch template】
http://forums.cacti.net/about4846.html 【Cisco 4500 switch template】
http://forums.cacti.net/about10085.html 【Few Templates (NetScreen,Nokia,Cisco,Fortigate)】
http://forums.cacti.net/about4844.html 【Cisco 6500 switch template】
Router
引用
http://forums.cacti.net/about4841.html 【Cisco 2600-3600 router template】
http://forums.cacti.net/about4845.html 【Cisco 7200 router template】
http://forums.cacti.net/about4333.html 【Cisco router - buffer failure templates】
http://forums.cacti.net/about5603.html 【Cisco routers (cpu, temperature and memory) templates】
http://forums.cacti.net/about7401.html 【Cisco CBWFQ monitoring】
http://forums.cacti.net/about17775.html 【Cisco Router - Class Map statistics】
http://forums.cacti.net/about4136.html 【Cisco Router - Cisco SAA Jitter/Jitter-error/http template】
http://forums.cacti.net/about30177.html 【Cisco BGP Peer Accepted Prefixes count SNMP query】




