目前分類:Solaris (18)

瀏覽方式: 標題列表 簡短摘要

Syslog 基本資訊

設定檔:

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

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) 人氣()

[[ ZFS基礎管理 ]]
********************************************************************************************************

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

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

prtconf

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

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

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

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>

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

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.

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

How to install SSH on Solaris 10 x86
UNIX / Linux - Solaris

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

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).

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

Installing Cacti on Solaris HOWTO
=================================

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

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

Solaris 系統管理命令及相關技術中英文對照
http://docs.google.com/Doc?id=dp8sbdh_54c4fwx5c3

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

呼叫指定變數
-bash-3.00#  echo $變數

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

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

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

This command will unconfig a solaris box back to its original state. It takes you back to the original setup for the network settings for the box. You will be prompted for the ip address, default route, etc just as if you were re-installing the operating system.

Command:
#sys-unconfig

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

-------------------------------------------------------------------------------------------------------------------------------

Show all network card status

ifocnifg -a (顯示目前所有網路介面狀態)

-------------------------------------------------------------------------------------------------------------------------------

 Enable the network card

方法一、

ifconfig elxl0 plumb (啟動網卡 重新開機就會失效)

方法二、

create /etc/hostname.elxl0 內容:elxl0 (開機啟動網卡)

Configuring ipaddress and netmask and making the interface status as up

方法一、

ifconfig elxl0 192.168.1.132 netmask 255.255.255.0 up (設定網卡 IP & NetMask 並啟用 重新開機就會失效)

方法二、

modify /etc/hosts 內容:192.168.1.132  elxl0 (開機設定IP)

-------------------------------------------------------------------------------------------------------------------------------
Setting up DHCP client

方法一、

ifconfig elxl0 dhcp (設定網卡自動取得IP 重新開機就會失效)

方法二、

touch /etc/hostname.hme0 (開機時啟動網卡)

touch /etc/dhcp.hme0 (設定網卡自動取得IP)

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

You can change your default shell by editing /etc/passwd.
Bash is alredy installed in /usr/bin/bash,

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