PIXNET Logo登入

里歐's 布拉格

跳到主文

生活543

部落格全站分類:

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 9月 14 週三 201114:17
  • Syslog on Solaris

Syslog 基本資訊
設定檔:
 /etc/syslog.conf
(繼續閱讀...)
文章標籤

里歐 發表在 痞客邦 留言(0) 人氣(961)

  • 個人分類:Solaris
▲top
  • 7月 01 週五 201115:12
  • SNMP in Solaris











Contents
1 - Summary
2 - Dependencies
3 - Net-SNMP installation
4 - Service configuration
5 - Snmpget example
6 - Service check
1 - Summary
This guide will show how to install SNMP in Solaris. SNMP is a network protocol
used to monitor network devices. We will install Net-SNMP. This has been tested
in Solaris 9.
2 - Dependencies
Thet net-snmp package we will use is from http://www.sunfreeware.com/. The
following dependencies are needed. You can use either the libgcc or gcc
package. In this case, we will use the gcc package.
# cd ~
# mkdir net-snmp
# cd net-snmp/
# wget ftp://ftp.sunfreeware.com/pub/freeware/sparc/9/openssl-$rel-sol9-sparc-local.gz
# wget ftp://ftp.sunfreeware.com/pub/freeware/sparc/9/gcc-$rel-sol9-sparc-local.gz
# gunzip openssl-$rel-sol9-sparc-local.gz
# gunzip gcc-$rel-sol9-sparc-local.gz
# sudo pkgadd -d openssl-$rel-sol9-sparc-local.gz
Password:
# sudo pkgddd -d gcc-$rel-sol9-sparc-local.gz
Password:
3 - Net-SNMP installation
Download and install the net-snmp package.
# wget ftp://ftp.sunfreeware.com/pub/freeware/sparc/9/netsnmp-$rel-sol9-sparc-local.gz
# gunzip netsnmp-$rel-sol9-sparc-local.gz
# sudo pkgadd -d netsnmp-$rel-sol9-sparc-local.gz
Password:
# cd ~
# rm -fr net-snmp/
4 - Service
configuration
Find where the configuration file should be put.
# strings /usr/local/sbin/snmpd | grep .conf
(config search path: %s)
display configuration file directives understood
read FILE(s) as configuration file(s)
do not read the default configuration files
Reconfiguring daemon
You can create your own configuration file. For this example, we will use a
read only community name of public. We will put the configuration in the
/usr/local/etc/ directory.
rocommunity public
syslocation "Test"
syscontact "John Doe"
# sudo vim /usr/local/etc/snmpd.conf
Password:
# sudo chown root:root /usr/local/etc/snmpd.conf
Password:
Enable the net-snmp service so that it will start when the system starts up.
Here is a script I created to start and stop the net-snmp daemon.
#!/bin/sh
CONFIG=/usr/local/etc/snmpd.conf
DAEMON=/usr/local/sbin/snmpd
OPTIONS="-c $CONFIG -Lf /dev/null -p /var/run/snmpd.pid"
case "$1" in
start)
if [ -f $CONFIG -a -f $DAEMON ]; then
echo 'Starting snmpd.'
$DAEMON $OPTIONS
fi
;;
stop)
echo 'Stopping snmpd.'
pkill -TERM -x snmpd
;;
*)
echo "Usage: $0 { start | stop }"
exit 1
;;
esac
# sudo vim /etc/init.d/snmpd
Password:
# sudo chown root:sys /etc/init.d/snmpd
Password:
# sudo chmod 744 /etc/init.d/snmpd
Password:
# sudo cp /etc/init.d/snmpd /etc/rc3.d/S95snmpd
Password:
# sudo chown root:sys /etc/rc3.d/S95snmpd
Password:
Before starting the service, make sure that udp port 161 is open in case you
are running firewall software.
Start the net-snmp service.
# sudo /etc/init.d/snmpd start
Password:
Starting snmpd.
# sudo pgrep -d ' ' snmpd
Password:
2577
5 - Snmpget example
From another computer, run snmpget to view some SNMP information.
# sudo snmpget -Os -c public -v 2c server.test.com sysName.0 sysLocation.0 sysContact.0
Password:
sysName.0 = STRING: server
sysLocation.0 = STRING: "Test"
sysContact.0 = STRING: "John Doe"
6 - Service check
Reboot your computer. Log in like normal and check to see that the net-snmp
service is running. That's it, now you have snmp running in Solaris.
# sudo shutdown -y -g 0 -i 6
Password:
# sudo pgrep -d ' ' snmpd
Password:
267




(繼續閱讀...)
文章標籤

里歐 發表在 痞客邦 留言(0) 人氣(608)

  • 個人分類:Solaris
▲top
  • 6月 17 週五 201111:54
  • ZFS基礎管理

[[ ZFS基礎管理 ]]
********************************************************************************************************
********************************************************************************************************
[磁碟池管理]
1. 檢查磁碟:
# devfsadm
# iostat -En
# format
2. 建立磁碟池:
2-a. 建立mirror:
# zpool create -f -m /zfs/mirror test_pool mirror c0t1d0 c0t1d1 mirror c0t1d2 c0t1d3 spare c0t1d4
2-b. 建立raidz:
# zpool create -f -m /zfs/raidz raidz_pool raidz c0t1d0 c0t1d1 c0t1d2 spare c0t1d3
2-c. 顯示組態而不實作
# zpool create -n test_pool mirror c0t1d0 c0t1d1 mirror c0t1d2 c0t1d3 spare c0t1d4
3. 檢視磁碟池:
# zpool list
# zpool status [-x]
# zpool iostat -v test_pool 5
4. 檢視/設定磁碟池參數:
# zpool get all test_pool
# zpool set autoreplace=on test_pool
5. 匯入/匯出磁碟池
# zpool import [-f] test_pool
# zpool export test_pool
PS. 使用localfile建立pool ( for test only... )
# mkfile 64m /tmp/f1 /tmp/f2 /tmp/f3
# zpool create -f test_pool mirror /tmp/f1 /tmp/f2 spare /tmp/f3
********************************************************************************************************
[檔案系統操作]
1. 建立檔案系統:
# zfs create test_pool/fs1
# zfs create -p test_pool/a/b/c
# zfs create -o mountpoint=/mnt/fs1 test_pool/fs1
2. 檢視/設定ZFS參數:
# zfs get all test_pool/fs1
# zfs set compression=on test_pool/fs1
# zfs set quota=10G test_pool/fs1
# zfs set reservation=1G test_pool/fs1
# zfs set mountpoint=/temp/mirror_dir test_pool/fs1
# zfs set mountpoint=legacy test_pool/fs1           => mount -F zfs test_pool/fs1 /mnt/fs1
# zfs set mountpoint=none test_pool/fs1
3. ZFS快照:
# zfs snapshot test_pool/fs1@20090817
# zfs rollback test_pool/fs1@20090817
# zfs clone test_pool/fs1@20090817 test_pool/fs2
# zfs promote test_pool/fs2
PS.
# zfs set snapdir=hidden|visible test_pool/fs1
4. 時間滑動軸
# svcs -a *auto-snapshot*
系統 -> 管理 -> 時間滑動軸 -> 啟動時間調整器 -> 進階選項 -> 自訂
開啟檔案瀏覽器 -> 復原 -> 移動滾軸
[[ Lab1 ]]
********************************************************************************************************
********************************************************************************************************
請建立下列環境:
* 建立一組使用三個硬碟(or slices)所構成的mirror的磁碟池(磁碟池的名稱為mypool), 其中一個硬碟(or slice)必須為hotspare.
* 變更磁碟池的掛載點為/mnt/mypool
* 建立一個mypool/fs1的檔案系統
* 在fs1上建立一個檔案(檔名為f1)
* 將fs1上設定一個快照(快照名為s1)
* 複製(clone)一個檔案系統(檔案系統名為c1)
* 使用promote子指令將c1取代掉f1, 並將c1的檔案系統名變更為f1
[[ 建立簡易NAS系統 smb + nfs + ftp ]]
********************************************************************************************************
********************************************************************************************************
[設定SMB client/server]
ref:
http://docs.sun.com/app/docs/doc/820-2429
0. 停用samba server
SMB server 與 samba server不能同時使用. 
所以需先停止samba server.
# svcs *samba*
# svcadm disable svc:/network/samba
# svcadm disable svc:/network/wins
1. 安裝SAMBA
點擊工作列, 系統 -> 管理 -> 套裝軟體管理員
開啟套裝軟體管理員後, 搜尋關鍵字 "smb"
點選套件 "SUNWsmbs, SUNWsmbskr", 點擊上方 "安裝/更新" 圖示
安裝完畢後, 重新啟動server.
# init 6
2. 啟動SMB server, 安裝PAM模組,  並加入WORKGROUP群組,
# svcadm enable -r smb/server
在/etc/pam.conf檔案中加入此行
other password required pam_smb_passwd.so.1 nowarn
註: password指令會自動產生SMB密碼, 但是, 對於已存的使用者, 必須手動在設定一次密碼.
# smbadm join -w WORKGROUP
3. 啟動SMB client
# svcadm enable -r smb/client
4.  建立SMB workgroup使用者/密碼
# pfexec su - (root/opensolaris)
# mkdir -p /export/home
# useradd -m -d /export/home/stanley stanley
# passwd stanley (stanley123)
註: samba密碼將存放在 /var/smb/smbpasswd
5. 設定SMB檔案分享
5-1. 建立ZFS
# zfs create -o casesensitivity=mixed -o nbmand=on rpool/nas
第一個-o告訴ZFS, UINX下區分大小寫, Windows下不分大小寫.
第二個-o告訴ZFS, SMB與NFS的鎖(Locking), ZFS均支援.
5-2. 使用ZFS指令分享檔案
# zfs set sharesmb=name=nas,rw=@192.168.1.0/24 rpool/nas
# smbutil view //stanley[:stanley123]@smb_server, 如果沒有輸入":stanley123", 則會出現密碼確認提示.
5-3. 使用 sharemgr指令分享檔案
建立分享群組
# sharemgr create nasgrp
將目錄加入分享
# sharemgr add-share -s /tmp -d "tmp folder" -r tmp nasgrp
# sharemgr set -P nfs -p anon=0 nasgrp
檢查分享設定
# sharemgr show -vp
6. 連線
a. OpenSolaris
a-1. 使用檔案管理員
位置 -> 連接到伺服器
服務類型: Windows分享
伺服器: smb_server
分享: rpool_share
使用者名稱: stanley
a-2. 使用mount指令
# mount -F smbfs //stanley[:stanley123]@smb_server/nas /mnt
b. Windows
開始 -> 執行
\\smb_server\
7. 查看SMB server的狀態
# smbstat -i
8. 移除分享
# sharemgr remove-share -s /tmp/nasgrp nasgrp
# sharemgr delete nasgrp
# sharemgr show -vp
********************************************************************************************************
********************************************************************************************************
[ 設定nfs]
1. 檢查NFS服務
svcs *nfs*
2. 啟動NFS服務
 svcadm enable -r nfs/server
3. 設定NFS分享
4-2. 開啟NFS
# zfs set sharenfs=rw=@192.168.1.0/24,root=@192.168.1.0/24 rpool/nas
# zfs set sharenfs=on pool_name/fs
# sharemgr set -P nfs -p anon=0 nasgrp
4. 取消NFS分享
# zfs set sharenfs=off pool_name/fs
********************************************************************************************************
[設定ftp]
1. 檢查ftp服務
# svcs *ftp*
2. 啟動ftp服務
# svcadm enable ftp
3. 限制使用者連線至ftp server
/etc/ftpd/ftpusers
[[ Lab2 ]]
********************************************************************************************************
********************************************************************************************************
建立一個NAS系統:
* 這個系統必須能使用SMB方式與Windows系列的作業系統分享檔案.
* 建立一個SAMBA使用者, 並設定該帳號與作業系統的帳號/密碼結合.
* (延續LAB1)建立一個mypool/samba_share的ZFS檔案系統目錄,
   並將其掛載點設定在目錄/samba_share, 並使其透過zfs指令達成SMB的方式分享目錄內的檔案.
* 使用zfs指令來達成nfs的方式分享檔案.
開啟FTP伺服器.
 
(繼續閱讀...)
文章標籤

里歐 發表在 痞客邦 留言(0) 人氣(894)

  • 個人分類:Solaris
▲top
  • 3月 22 週二 201118:11
  • Get Basic System Configuration Information on Solaris



Solaris includes a command line utility to get basic current system configuration information and output it to the console.


prtconf


The prtconf command is used to Print Configuration information to the console


Example:


# prtconf
System Configuration:  Sun Microsystems  sun4u
Memory size: 8192 Megabytes
System Peripherals (Software Nodes):

SUNW,Sun-Fire-480R
    packages (driver not attached)
        SUNW,builtin-drivers (driver not attached)
        deblocker (driver not attached)
        disk-label (driver not attached)
        terminal-emulator (driver not attached)
        SUNW,debug (driver not attached)
        dropins (driver not attached)
        obp-tftp (driver not attached)
        kbd-translator (driver not attached)
        SUNW,i2c-ram-device (driver not attached)
        SUNW,fru-device (driver not attached)
        ufs-file-system (driver not attached)
    chosen (driver not attached)
    openprom (driver not attached)
        client-services (driver not attached)
    options, instance #0
    aliases (driver not attached)
    memory (driver not attached)
    virtual-memory (driver not attached)
    SUNW,UltraSPARC-III+ (driver not attached)
    memory-controller, instance #0
    SUNW,UltraSPARC-III+ (driver not attached)
    memory-controller, instance #1
    SUNW,UltraSPARC-III+ (driver not attached)
    memory-controller, instance #2
    SUNW,UltraSPARC-III+ (driver not attached)
    memory-controller, instance #3
    pci, instance #0
        pci, instance #0
            network, instance #2
            network, instance #3
            scsi, instance #0
                disk (driver not attached)
                tape (driver not attached)
                sd, instance #1
                sd, instance #2 (driver not attached)
                sd, instance #3 (driver not attached)
                sd, instance #4 (driver not attached)
                sd, instance #5 (driver not attached)
                sd, instance #6 (driver not attached)
                sd, instance #7 (driver not attached)
                sd, instance #8 (driver not attached)
                sd, instance #9 (driver not attached)
                sd, instance #10 (driver not attached)
                sd, instance #11 (driver not attached)
                sd, instance #12 (driver not attached)
                sd, instance #13 (driver not attached)
                sd, instance #14 (driver not attached)
                sd, instance #15 (driver not attached)
            scsi, instance #1
                disk (driver not attached)
                tape (driver not attached)
                sd, instance #16 (driver not attached)
                sd, instance #17 (driver not attached)
                sd, instance #18 (driver not attached)
                sd, instance #19 (driver not attached)
                sd, instance #20 (driver not attached)
                sd, instance #21 (driver not attached)
                sd, instance #22 (driver not attached)
                sd, instance #23 (driver not attached)
                sd, instance #24 (driver not attached)
                sd, instance #25 (driver not attached)
                sd, instance #26 (driver not attached)
                sd, instance #27 (driver not attached)
                sd, instance #28 (driver not attached)
                sd, instance #29 (driver not attached)
                sd, instance #30 (driver not attached)
        ide, instance #0
            disk (driver not attached)
            cdrom (driver not attached)
            sd, instance #0
    pci, instance #1
    pci, instance #2
        ebus, instance #0
            flashprom (driver not attached)
            bbc (driver not attached)
            power (driver not attached)
            i2c, instance #1
                fru (driver not attached)
                fru (driver not attached)
                fru (driver not attached)
                fru (driver not attached)
                fru (driver not attached)
                fru (driver not attached)
                fru (driver not attached)
                fru (driver not attached)
                fru (driver not attached)
                fru (driver not attached)
                fru (driver not attached)
                fru (driver not attached)
                fru (driver not attached)
                fru (driver not attached)
                fru (driver not attached)
                fru (driver not attached)
                fru (driver not attached)
                fru (driver not attached)
                fru (driver not attached)
                fru (driver not attached)
                fru (driver not attached)
                fru (driver not attached)
                fru (driver not attached)
                fru (driver not attached)
                fru (driver not attached)
                fru (driver not attached)
                fru (driver not attached)
                fru (driver not attached)
                fru (driver not attached)
                fru (driver not attached)
                fru (driver not attached)
                fru (driver not attached)
                fru (driver not attached)
                fru (driver not attached)
                nvram (driver not attached)
                idprom (driver not attached)
                fru (driver not attached)
                fru (driver not attached)
            i2c, instance #0
                temperature, instance #0
                temperature, instance #1
                temperature, instance #2
                ioexp, instance #0
                ioexp, instance #1
                ioexp, instance #2
                temperature, instance #3
                ioexp, instance #3
                ioexp, instance #4
                ioexp, instance #0
                ioexp, instance #1
                temperature-sensor, instance #0
                fru (driver not attached)
                fru (driver not attached)
                fru (driver not attached)
                fru (driver not attached)
                fru (driver not attached)
                rscrtc (driver not attached)
            rtc, instance #0
            gpio (driver not attached)
            pmc (driver not attached)
            rsc-control (driver not attached)
            rsc-console (driver not attached)
            serial, instance #0
        usb, instance #0
        network, instance #0
    pci, instance #3
        network, instance #1
        SUNW,qlc, instance #0
            fp (driver not attached)
                disk (driver not attached)
            fp, instance #0
                ssd, instance #2
                ssd, instance #1
    pseudo, instance #0




(繼續閱讀...)
文章標籤

里歐 發表在 痞客邦 留言(0) 人氣(14)

  • 個人分類:Solaris
▲top
  • 3月 22 週二 201118:08
  • Set the Date and Time on Solaris



Setting the system date and time is fairly easy on solaris. Because you can easily set the time from the command line, you can set the time on a server remotely.


date mmddhhmmyy


The date command takes the syntax mmddhhmmyy, or “month day hour minute year”. You have to be superuser to set the time.


Example:



# date 1201010106
Fri Dec  1 01:01:00 PST 2006




(繼續閱讀...)
文章標籤

里歐 發表在 痞客邦 留言(0) 人氣(109)

  • 個人分類:Solaris
▲top
  • 3月 22 週二 201118:06
  • Set the Default Route on Solaris


Setting the default route on Solaris is easy. If you are trying to just set the route temporarily you can use the route command:



route add default <ipaddress>


Example:



route add default 192.168.1.1



If you want the route to be persisted when you reboot the system, you will need to set the route in the /etc/defaultrouter file.


/etc/defaultrouter


Example:



echo 192.168.1.1 > /etc/defaultrouter



Note that Solaris 10 includes “zones” that can also configure this same behavior. There will be more articles covering this in the future.



(繼續閱讀...)
文章標籤

里歐 發表在 痞客邦 留言(0) 人氣(41)

  • 個人分類:Solaris
▲top
  • 3月 22 週二 201118:03
  • Shut Down or Reboot a Solaris System



Solaris is usually used as a server operating system. Because of this, you want to make sure that you shut the system down as gracefully as possible to ensure there isn’t any data loss.


For every application that is installed on your server, you should make sure that you have the correct scripts in /etc/rc(x).d to gracefully shut down the service.


Shutdown
You have more than one command option that you can use. The best command is this, executed as root:



shutdown -y -i5 -g0



This will immediately shut the system down. You can also use the older command that still works:



sync;sync;init 5



You can even use:



poweroff



Reboot
If you are trying to reboot the system as opposed to turning it off, you could use:



shutdown -y -i6 -g0



Or:



sync;sync;init 6



Or even:



reboot



So many commands to do the same thing… almost seems silly.



(繼續閱讀...)
文章標籤

里歐 發表在 痞客邦 留言(0) 人氣(385)

  • 個人分類:Solaris
▲top
  • 3月 16 週三 201109:17
  • How to install SSH on Solaris 10 x86

How to install SSH on Solaris 10 x86
UNIX / Linux - Solaris
This guide will show you how to install SSH on Solaris 10 x86 from the Solaris installation DVD.
Mount CD
If you havent enabled the feature that will automatically mount your CDROM drive you will need to mount it using the following commands :
1.mkdir /cdrom
(繼續閱讀...)
文章標籤

里歐 發表在 痞客邦 留言(0) 人氣(42)

  • 個人分類:Solaris
▲top
  • 2月 08 週二 201114:26
  • How to Mount a USB Flash Drive on Solaris

How to Mount a USB Flash Drive
Vinay Krishna, June 2007
These steps for mounting a pen drive are applicable to the Solaris 8, and 9 OS. This tip should also work with Linux (kernel version 2.5 and above).
USB flash drives are named sda1, sda2, and so on, and they are mounted by default in /dev. If sda1 is not the name for your drive, use some type of hardware browser to find the name. Let's assume sda1 needs to be mounted.
(繼續閱讀...)
文章標籤

里歐 發表在 痞客邦 留言(0) 人氣(346)

  • 個人分類:Solaris
▲top
  • 11月 06 週四 200817:52
  • [Solaris][Cacti] HOWTO Installing Cacti on Solaris

Installing Cacti on Solaris HOWTO
=================================
http://forums.cacti.net/about5748.html
================================= 
 
Javier Vidal Postigo, zanaguara at yahoo dot es
 
V0.1, 2004-DEC-09
 
This document explains how to install all the required components by
Cacti on a Solaris host.
 
 
1. INTRODUCTION
 
1.1 Disclaimer
 
Use the information in this document at your own risk. I disavow any
potential liability for the contents of this document. Use of the
concepts, examples, and/or other content of this document is
entirely at your own risk.
                                                                               
All copyrights are owned by their owners, unless specifically noted
otherwise. Use of a term in this document should not be regarded as
affecting the validity of any trademark or service mark.
                                                                               
Naming of particular products or brands should not be seen as
endorsements.
                                                                               
You are strongly recommended to take a backup of your system before
major installation and backups at regular intervals.
 
1.2 Software Versions
 
In my case, I have been able to install Cacti on a Solaris host
using the software versions listed below. It does not mean you
should use those versions. Version numbers are provided as a
reference.
 
- Solaris 9 Update 7 for SPARC
- Solaris 9 Recommended Patch Cluster (2004-NOV-10)
- Sunfreeware.com packages:
    autoconf-2.59
    automake-1.9
    bash-3.0
    bison-1.875d
    flex-2.5.31
    gcc-3.4.2
    libiconv-1.8
    libtool-1.5
    make-3.80
    sed-4.1.1
- Perl 5.8.5
- RRDtool 1.0.49
- Apache 2.0.52
- MySQL 4.1.7
- libxml2 2.6.16
- zlib 1.2.1
- PHP 5.0.2
- NET-SNMP 5.1.2
- Cacti 0.8.6b
 
 
2. INSTALL SOLARIS
 
- Install Solaris following the instructions in http://docs.sun.com/
- Install the lastest recommended patch cluster from
  http://sunsolve.sun.com/
 
Notes:
 
- Install at least Solaris 8, because Solaris 7 end of support date
  is approaching (2005-AUG-15). Check:
 
  http://sunsolve.sun.com/search/document.do?assetkey=1-9-10012-1
 
- I suppose Cacti should work fine on Solaris x86 as well.
 
- I have installed the "Developer System Support" configuration
  (64-bit)
 
 
3. INSTALL SUNFREEWARE PACKAGES
 
Solaris does not provide a C compiler, so it is necessary to install
some development tools. I recommend to install at least the
following packages from http://www.sunfreeware.com/. Be sure to pick
the packages that have been compiled for your OS version and
architecture.
 
    autoconf-2.59
    automake-1.9
    bash-3.0
    bison-1.875d
    flex-2.5.31
    gcc-3.4.2
    libiconv-1.8
    libtool-1.5
    make-3.80
    sed-4.1.1
 
 
4. CACTI USER ACCOUNT
 
It is highly recommended to run any application with a non-root
user, so create a specific group and user for Cacti. For example:
 
  # mkdir /export/home
  # groupadd -g 100 cacti
  # useradd -u 100 -g cacti -s /usr/bin/bash \
  > -d /export/home/cacti -m cacti
  # passwd cacti
 
From here, a command entered by root will have the "#" prompt, and
if the user is cacti, the shell prompt will be "$".
 
Before start compiling, it is extremely important to have both PATH
and LD_LIBRARY_PATH environment variables properly set. This is my
.bash_profile:
 
PATH=/opt/perl/bin:/usr/local/bin:/usr/bin:/usr/sbin:/usr/ccs/bin
PATH=$PATH:/opt/php/bin:/opt/mysql/bin:/opt/rrdtool/bin
PATH=$PATH:/opt/net-snmp/bin
 
LD_LIBRARY_PATH=/opt/libxml2/lib:/usr/lib:/etc/lib:/opt/zlib/lib
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/sparcv9
 
MANPATH=/usr/man:/usr/local/man:/opt/rrdtool/man:/opt/net-snmp/man
 
PS1="`/usr/ucb/whoami`@"`hostname`"$ "
PS2="`/usr/ucb/whoami`@"`hostname`"> "
 
export PATH LD_LIBRARY_PATH MANPATH
export PS1 PS2
 
 
5. INSTALL PERL (5.8.5)
 
Solaris provides a version of Perl (/usr/bin/perl), but I prefer to
install mine. In my case, I have compiled 5.8.5 from
http://perl.org/ and installed it on /opt/perl:
 
  $ rm -f config.sh Policy.sh
  $ sh Configure -Dprefix=/opt/perl -des
  $ make
  $ make test
  # make install
 
 
6. INSTALL RRDTOOL (1.0.49)
 
Download RRDtool from
http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/ and:
 
  $ sh configure --prefix=/opt/rrdtool
  $ make
  # make install
 
7. INSTALL APACHE (2.0.52)
 
Download Apache from http://www.apache.org/ and:
 
  $ configure --prefix=/opt/apache --enable-so
  $ make
  # make install
 
(Optional) I have edited my /opt/apache/conf/httpd.conf so:
 
  User cacti
  Group cacti
 
  ServerName 'hostname'
 
  ServerRoot /opt/cacti/cacti-0.8.6b
 
Notes:
 
- 'hostname' can be the real hostname.
- /opt/cacti/cacti-0.8.6b is the path where Cacti is going to be
  installed.
 
 
8. INSTALL MYSQL (4.1.7)
 
First of all, you need to create a group and a user for MySQL:
 
  # groupadd -g 101 mysql
  # useradd -u 101 -g mysql -s /usr/bin/bash -d \
  > /export/home/mysql -m mysql
  # passwd mysql
 
Download MySQL from http://www.mysql.com/ and:
 
  $ ./configure --prefix=/opt/mysql
  $ make
  # make install
  # cp support-files/my-large.cnf /etc/my.cnf
  # cd /opt/mysql
  # bin/mysql_install_db --user=mysql
  # chown -R root  .
  # chown -R mysql var
  # chgrp -R mysql .
 
Start MySQL:
 
  # bin/mysqld_safe --user=mysql &
 
Set a password for the root user:
 
  $ mysqladmin -u root password 'new-password'
  $ mysqladmin -u root -h 'hostname' password 'new-password'
 
Note:
 
- If you 'make clean', be careful because there is a bug in MySQL.
  'make clean' does not remove the file sql/lex_hash.h and it
  should be removed by hand.
 
 
9. INSTALL LIBXML2 (2.6.16)
 
PHP 5 requires a recent version of libxml2. The version that comes
with Solaris 9 is too old. Download it from http://xmlsoft.org/ and:
 
  $ ./configure --prefix=/opt/libxml2
  $ make
  # make install
 
 
10. INSTALL ZLIB (1.2.1)
 
zlib is also required by PHP 5. Download it from
http://www.gzip.org/zlib/ and:
 
  $ ./configure --prefix=/opt/zlib
  $ make
  # make install
 
 
11. INSTALL PHP (5.0.2)
 
I have not been able to compile PHP 5 with SNMP support, it is in my
'to do' list. If you do not have PHP support activated Cacti will use
NET-SNMP instead.
 
Download PHP from http://www.php.net/ and:
 
  $ ./configure --with-apxs2=/opt/apache/bin/apxs \
  > --with-mysql=/opt/mysql --prefix=/opt/php \
  > --with-libxml-dir=/opt/libxml2 --with-zlib=/opt/zlib
  $ make
  # make install
 
You have to add several lines to your Apache configuration file
(/opt/apache/conf/httpd.conf):
 
  AddType application/x-httpd-php .php
  DirectoryIndex index.html index.html.var index.php
 
Be sure PHP installation have added:
 
  LoadModule php5_module        modules/libphp5.so
 
And add index.php to the DirectoryIndex directive:
 
  DirectoryIndex index.html index.php
 
Now restart Apache:
 
  # ./apachectl stop
  # ./apachectl start
 
In the Apache error_log file you should see a message saying
"PHP/5.0.2 configured".
 
 
12. INSTALL NET-SNMP (5.1.2)
 
Stop Solaris SNMP daemons:
 
  # cd /etc/rc3.d
  # ./S76snmpdx stop
  # ./S77dmi stop
  # mv S76snmpdx _S76snmpdx
  # mv S77dmi _S77dmi
 
Note:
 
- You could have more Solaris SNMP daemons running. Please check
  NET-SNMP documentation.
 
Download NET-SNMP from http://www.net-snmp.org/ and:
 
  $ ./configure --prefix=/opt/net-snmp \
  > --with-default-snmp-version=3 \
  > --with-sys-contact=someone@domain.com \
  > --with-sys-location=somelocation \
  > --with-logfile=/opt/net-snmp/log/snmpd.log \
  > --with-persistent-directory=/opt/net-snmp/var
  $ make
  $ make test
  # make install
  # cd /opt/net-snmp
  # mkdir var
  # mkdir log
  # ./snmpconf -g basic_setup
 
Answer to all question asked. Then start NET-SNMP:
 
  # /opt/net-snmp/sbin/snmpd -c /opt/net-snmp/bin/snmpd.conf
 
And check NET-SNMP agent is working fine:
 
  $ /opt/net-snmp/bin/snmpget -v 1 -c community \
  > localhost sysUpTime.0
 
 
13. INSTALL CACTI (0.8.6b)
 
Once you have installed all the required components you can follow
chapter 2 of Cacti documentation (Installing Under Unix).
 
Note:
 
- If you try to execute 'php poller.php' directly in the crontab is
  not going to work because php can not find all the dynamic
  libraries needed. The simplest solution is to have in the crontab:
 
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /opt/cacti/poller_cron
 
being 'poller_cron' the following script:
 
  . /export/home/cacti/.bash_profile
  /opt/php/bin/php /opt/cacti/cacti-0.8.6b/poller.php
 
Note:
 
- Notice the space between the dot and the .bash_profile path.
(繼續閱讀...)
文章標籤

里歐 發表在 痞客邦 留言(0) 人氣(64)

  • 個人分類:Solaris
▲top
12»

自訂側欄

自訂側欄

個人資訊

里歐
暱稱:
里歐
分類:
好友:
累積中
地區:

熱門文章

  • (285)Enterasys A2 Switch Restore Configuration to factory defaults (Reset Password)
  • (10,640)[Linux][CentOS]設定 yum mirror 為台灣地區
  • (988)[Linux] Configuring the Softflowd NetFlow Exporter
  • (2,547)[Linux] 調整時區、系統時間、BIOS時間、同步系統時間 For Redhat
  • (1,344)Solaris 環境變數設定
  • (602)Windows 2008 R2找KMS Server做產品啟動時,出現0xC004F074錯誤
  • (4,821)手動設定windows ntp client (w32tm & reg)

文章分類

  • Mikrotik (0)
  • 理財 (0)
  • Cacti (1)
  • XenServer (1)
  • VMware (1)
  • 旅遊 & 飲食 (1)
  • Network (1)
  • Cisco (12)
  • Windows (6)
  • MySQL (7)
  • Solaris (18)
  • Symantec (6)
  • 文章 (3)
  • Acronis (0)
  • FortiGate (3)
  • Linux (48)
  • Microsoft (5)
  • 未分類文章 (1)

最新文章

  • Installation vsftpd-3.0.2 with xinetd on CentOS 6 .4 x86_64
  • MPLS QoS Example
  • 手動設定windows ntp client (w32tm & reg)
  • Installation Memcached On CentOS 6.3
  • Installation vsFTPd on CentOS
  • Solaris Command
  • Windows 2008 R2找KMS Server做產品啟動時,出現0xC004F074錯誤
  • Windows Update Server IP
  • CactiEZ 0.6 upgrade to Cacti 0.8.7i
  • Windows 2003 Server 關閉不必要的服務

動態訂閱

文章精選

文章搜尋

誰來我家

參觀人氣

  • 本日人氣:
  • 累積人氣: