2015年7月30日

CentOS 6.6安裝Smokeping流程


0.      關閉SELiunx
vi /etc/selinux/config
SELINUX=enforcing 改成disabled
(Setenforce 0 暫時關閉SELiunx)

開啟iptables port 80
system-config-firewall-tui

1.      安裝相關套件

2.      安裝rrdtool
yum -y install libart_lgpl-devel zlib-devel libpng-devel freetype-devel  cairo-devel libxml2-devel pango-devel dejavu-lgc-fonts* pango* freetype* rrdtool-perl

cd /opt

cd rrdtool-1.5.3

./configure -prefix=/usr/local/

make
make install

whereis rrdtool
rrdtool: /usr/local/bin/rrdtool

3.      安裝fping
cd /opt
tar –zxvpf fping-3.10.tar.gz
cd fping-3.10

./configure
make
make install

whereis fping
fping: /usr/local/sbin/fping

4.      安裝smokeping
cd /opt
tar –zxvpf smokeping-2.6.11.tar.gz


./configure –prefix=/usr/local/smokeping

gmake install

whereis smokeping
smokeping: /usr/local/smokeping /opt/smokeping-2.6.11/bin/smokeping


建立smokeping存放資料目錄
mkdir -p /usr/local/smokeping/cache
mkdir -p /usr/local/smokeping/data
mkdir -p /usr/local/smokeping/var

修改資料目錄權限
chmod –R apache.apache /usr/local/smokeping/cache
chmod –R apache.apache /usr/local/smokeping/data
chmod –R apache.apache /usr/local/smokeping/var

vi /usr/local/smokeping/bin/smokeping
找到use lib qw(/usr/pack/rrdtool-1.0.33-to/lib/perl);
將路徑改為use lib qw(/usr/local/rrdtool/lib/perl/5.10.1);




建立修改smokeping設定檔
cd /usr/local/smokeping/etc
cp config.dist config
vi config

檢查修改config檔內容為以下路徑
cgiu imgcache = /usr/local/smokeping/cache
imgurl = cache
datadir = /usr/local/smokeping/data
piddir = /usr/local/smokeping/var
cgiurl = http://some.url/smokeping.cgi
tmail = /usr/local/smokeping/etc/tmail.dist

檢查修改FPing路徑
+ FPing
binary = /usr/sbin/fping
修改為 /usr/local/sbin/fping

修改httpd.conf設定
vi /etc/httpd/conf/httpd.conf
找到下行新增ExecCGI
Options Indexes FollowSymLinks ExecCGI
AddHandler cgi-script .cgi

httpd.conf加入以下內容
ScriptAlias /smokeping/ "/usr/local/smokeping/htdocs/”

Directory "/usr/local/smokeping/htdocs/">
    AllowOverride None
    Options Indexes FollowSymLinks ExecCGI
    Order allow,deny
    Allow from all


設定httpd document root連結
cd /var/www/html/
ln -s /usr/local/smokeping/htdocs/ smokeping
cd /usr/local/smokeping/htdocs/
cp /usr/local/smokeping/htdocs/smokeping.fcgi smokeping.cgi
ln -s /usr/local/smokeping/cache cache


修改smokeping_secrets.dist 權限為600
chmod 600 /usr/local/smokeping/etc/smokeping_secrets.dist

設定smokeping開機啟動:
vi /etc/init.d/smokeping
將以下連結內容copy至新建檔案etc/init.d/smokepinghttps://oss.oetiker.ch/smokeping/pub/contrib/smokeping-start-script-rh72
5.      修改etc/init.d/smokeping內容的路徑
SMOKEPING=/usr/local/smokeping/bin/smokeping
CONFIG=/usr/local/smokeping/etc/config

修改smokeping 啟動權限
chmod 755 /etc/init.d/smokeping

設定開機自動啟動
chkconfig --add smokeping
chkconfig smokeping on

2015年7月29日

Cisco FastEthernet1 VRF aware設定

Fa1 Interface and mgmtVrf


Caution The Ethernet management port is intended for out-of-band access only. Like the console port, the Ethernet management port has direct access to critical resources on the switch. Connecting this port to an in-band network might cause performance degradation and vulnerability to a denial of service attack.

All features that use fa1 now need to be VRF-aware.

Note You cannot configure any other interface in the same routing domain and you cannot configure a different routing domain for the Fa1 interface.

On bootup the fa1 port assumes the following default configuration:
ip unicast-routing 
ip vrf mgmtVrf 
!
interface FastEthernet1
 ip vrf forwarding mgmtVrf
speed auto
duplex auto 
Switch# show ip vrf 
  Name                             Default RD          Interfaces
  mgmtVrf                                                   Fa1 
Because the management port is placed in mgmtVrf, you should be aware of the VRF aware commands required for the following tasks:
Ping
Telnet
TFTP
FTP
SSH

Note Command usage specific to the mgmtVrf are mentioned below. The additional configuration needed to make the feature work needs to be configured.

Ping

If you want to ping an IP address that is reachable through an fa1 port, enter the following command:
Switch# ping vrf  mgmtVrf ip address
  
For example,
Switch# ping vrf mgmtVrf 20.20.20.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 20.20.20.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms

TraceRoute

Switch# traceroute vrf mgmtVrf ip address
Eg: Switch# traceroute vrf mgmtVrf 20.20.20.1
Type escape sequence to abort.
Tracing the route to 20.20.20.1
 1 20.20.20.1 0 msec 0 msec *

Telnet

If you want to Telnet to a remote switch through the Fa1 port, enter the following command:
Switch# telnet  /vrf mgmtVrf
word  IP address or hostname of a remote system
An example
Switch# telnet 20.20.20.1 /vrf mgmtVrf
Trying 20.20.20.1 ... Open
User Access Verification
Password: 
switch> en
Password: 
switch#

TFTP

If you want to use Fa1 port for TFTP operation, configure the Fa1 port as the source interface for TFTP as follows:
Switch# ip tftp source-interface fastEthernet1

FTP

If you want to use an Fa1 port for an FTP operation, configure the Fa1 port as the source interface for FTP as follows:
Switch# ip ftp source-interface fastEthernet1

SSH

If you want initiate SSH from your switch through the Fa1 port, enter the following command:
Switch# ssh -l <login name> -vrf mgmtVrf <ip address>
For example,
Switch# ssh -l xyz -vrf mgmtVrf 20.20.20.1

2015年2月9日

Command rejected: An interface whose trunk encapsulation is "Auto" can not be configured to "trunk" mode.

Command rejected: An interface whose trunk encapsulation is "Auto" can not be configured to "trunk" mode.


解決方法:
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#switchport mode trunk

2014年7月2日

Exchange 2010 Management Shell 匯出範例

查網路上的匯出範本
http://community.spiceworks.com/topic/151529-list-of-all-mailboxes-on-exchange-2010-sp1

結果中文姓名是問號

export-csv後面要加參數 -encoding utf8即可解決

get-mailbox | select-object displayname, SamAccountName, Organization, OrganizationalUnit, HiddenFromAddressListsEnabled, PrimarySmtpAddress, RecipientType, RecipientTypeDetails | export-csv -path c:\test.csv -encoding utf8



Get-Mailbox -ResultSize Unlimited | ForEach-Object {Get-MailboxStatistics -Identity $_.Identity | Select-Object DisplayName, TotalItemSize}

2013年9月13日

手動更新Exchange Server 2010離線通訊錄

Exchange Management Console-->組織組態-->信箱-->離線通訊錄-->右鍵-->更新

或按右鍵內容可以設定排程

2012年4月25日

設定httpd遇到的錯誤訊息

DocumentRoot must be a directory  -->關閉selinux

echo 0 > /selinux/enforce


httpd apr_sockaddr_info_get() failed --> /etc/hosts 設定主機名稱

httpd start failed without error message -->  logs資料夾不存在






2012年4月10日

VNC在Win7無法使用Ctrl+Alt+Del登入

開啟 本機群組原則管理器->電腦設定->系統管理範本->Windows元件->Windows登入選項->停用或啟用軟體Secure Attention Sequence->啟用

追蹤者