Linux安装与配置Snmpd

Posted by 4Aiur on 03/16/2011 in Linux |

Linux安装与配置Snmpd 下面是两个主流的Linux,CentOS与Ubuntu的snmpd安装与自动配置脚本 Script on CentOS #!/usr/bin/bash # Install snmp and agent yum install -y net-snmp net-snmp-utils # Backup snmpd.conf mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf-date +%Y%m%d%H%M%S # Write new snmpd config cat > /etc/snmp/snmpd.conf (configure /etc/snmp/snmp.local.conf) disk / 20% EOF chkconfig snmpd on /etc/init.d/snmpd restart Script on Unbuntu #!/usr/bin/bash # Install snmp and agent apt-get -y install snmpd […]

Tags: ,

制作jdk1.6rpm包

Posted by 4Aiur on 04/06/2010 in Linux |

制作jdk1.6rpm包 制作rpm包的几个步骤: 制作Makefile 生成jdk压缩包 生成build rpm使用的spec文件 生成rpm包 1) 制作Makefile [root@localhost foo]# cat Makefile # Makefile all: @echo Make jdk-1.6.0_08-fcs @echo Java(TM) Platform Standard Edition Development Kitinstall: mkdir -p /usr/java/ tar -zxf jdk1.6.0_18.tar.gz -C /usr/java cp -pf /etc/profile /etc/profile.save if ! grep JAVA_HOME /etc/profile >/dev/null 2>&1 ; then\ echo ‘export JAVA_HOME=/usr/java/jdk1.6.0_18/’ >> /etc/profile; \ echo ‘export […]

Tags: ,

创建本地yum源服务器

Posted by 4Aiur on 04/06/2010 in Linux |

创建本地yum源服务器 # 安装createrepo包 [root@localhost centos]# yum -y install createrepo [root@localhost centos]# cat update.sh #!/bin/bash # set -x rsync –progress -rvu -lptD –exclude=”isos/” –exclude=”SRPMS/” –exclude=”x86_64″ rsync://rsync.kddilabs.jp/centos/5.4/ mirror/ createrepo -v –update mirror/myapp/i386/ # 同步本地yum库 [root@localhost centos]# ./update.sh 生成yum配置文件提供客户端使用 [root@localhost foo]# cat myyumsource.repo # log.repo [myapp] name=CentOS-$releasever – myapp baseurl=http://192.168.3.63:9999/mirror/myapp/i386/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 [base] name=CentOS-$releasever – Base #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/ […]

Tags: ,

网络上的一些XEN资料

Posted by 4Aiur on 04/06/2010 in SysAdmin |

网络上的一些XEN资料 北南南北-Xen 初学者指南 鳥哥的 Linux 私房菜- 利用 Xen 設計虛擬機器 xen安装及配置笔记 RedHat 5.0配置XEN虚拟机(上) RedHat 5.0配置XEN虚拟机(下)

Tags: ,

ls long listing format各个字段的含义

Posted by 4Aiur on 04/06/2010 in Linux |

ls long listing format各个字段的含义 ls -l total 8 -rw-r–r– 1 root root 2 Jul 27 13:30 bar -rw-rw-r– 1 root root 7056 Jul 27 13:27 foo For each directory that is listed, preface the files with a line ‘total BLOCKS’, where BLOCKS is the total disk allocation for all files in that directory. The block […]

Tags:

Linux学习循序渐进

Posted by 4Aiur on 04/06/2010 in Linux |

Linux学习循序渐进

Tags:

带特殊字符文件的删除方法

Posted by 4Aiur on 03/31/2010 in Linux |

带特殊字符文件的删除方法 list文件列表的时候发现有个"?"文件,直接删除?是删不掉的。 ~]# ll total 75040 -rw-r–r– 1 root root 0 Nov 7 14:46 ? # 使用cat -A 查看这个文件是带有特殊字符的文件 ~]# ll | cat -A total 75040$ -rw-r–r– 1 root root 0 Nov 7 14:46 M-

Tags: ,

磁盘空间满故障排除

Posted by 4Aiur on 03/31/2010 in SysAdmin |

磁盘空间满故障排除 磁盘空间满一般情况下使用du可以快速定位到那个目录占用了大量的磁盘空间。 这里主要讲两个使用du无法查看的情况。 现象/mnt分区磁盘使用率达到100% # df -h Filesystem Size Used Avail Use% Mounted on /dev/sda2 97G 1.5G 90G 2% / /dev/sda1 190M 12M 169M 7% /boot none 2.0G 0 2.0G 0% /dev/shm /dev/sda3 97G 6.3G 85G 7% /usr /dev/sda6 191G 408M 181G 1% /var tmpfs 300M 300M 0 100% /mnt /dev/loop0 190M 106M 74M 60% […]

Tags: ,

自动修改crontab配置

Posted by 4Aiur on 03/31/2010 in Shell |

自动修改crontab配置 方法1:使用crontab -l把crontab内容导出到文件中,使用编辑器或脚本修改导出的文件,之后使用新的配置文件覆盖掉现有的配置。 [4Aur@4Aiur ~]$ crontab -l > cron[4Aur@4Aiur ~]$ sed -i ‘s/ls/dir/’ cron [4Aur@4Aiur ~]$ crontab cron 方法2:使用here文档的方式更新crontab的配置。 [4Aur@4Aiur ~]$ crontab -l0 * * * * ls [4Aur@4Aiur ~]$ sh cron_modify.sh [4Aur@4Aiur ~]$ crontab -l 0 * * * * dir [4Aur@4Aiur ~]$ cat cron_modify.sh crontab -e /dev/null :%s/ls/dir/g :wq EOF [4Aur@4Aiur ~]$

Tags: ,

系统管理的几个小技巧

Posted by 4Aiur on 03/31/2010 in Linux |

系统管理的几个小技巧 一、SecureCRT的使用技巧 1、由于网络条件问题,SecureCRT经常会在不使用的时候开服务器的连接。 用下面的方法设置会很大程度上解决上面的问题。(以SecureCRT Version 5.1.0为例) 打开SecureCRT选择Options的General,点Default Session之后选择Edit Default Settions 再选择Terminal,把Send protocol NO_OP 选上之后全部点ok即可。 注: 同样利用screen命令也可以 使用方法 SSH登录后执行 # screen -S freebsd 一旦断线可使用 # screen -x freebsd 来恢复 2、密钥的使用 使用密钥便于连接与管理服务器,也极大的增加了系统的安全性。 个人建议禁止root直接登陆服务器,禁用密码直接登陆服务器,安装密钥时设置密码。 具体使用方法可以到网上搜集资料,这里不再多说。 3、与服务器之间的文件传输 设置连接的属性 选中一连接后鼠标右键点Properties,选择第一项Connection,把Protocol里面的Terminal设置为SSH2,File设置为SFTP(注需要事先安装SecureFX,否则没有次选项) 进入一个连接后点File菜单,点Connect SFTP Tab(快捷键为alt+p),会打开SFTP窗口,可以使用命令传输文件。 命令举例: lcd 进入本地目录 lpwd 显示本地目录路径 cd 进入服务器本身的目录 pwd 显示服务器本身的路径 get 下载服务器文件至本地目录 put 上传本地文件至服务器 SecureFX是一个使用sftp协议的客户端程序,使用方法与其他ftp客户端类似。 4、使用鼠标键的左键复制与中键粘贴 二、关于BASH命令行使用的 输入set […]

Tags: ,

Copyright © 2010-2024 4Aiur All rights reserved.
This site is using the Desk Mess Mirrored theme, v2.5, from BuyNowShop.com.