• 這是一篇限定共同作者觀看的文章。
    若您是共同作者,登入後即可閱讀。

cd /tmp
mkdir cactiupgrade

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

Print Spooler  (Disable)
管理所有本機和網路列印佇列,並控制所有列印工作。如果這個服務被停止,本機電腦列印將無法使用。如果這個服務被停用,任何明確依存於它的服務將無法啟動。 

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

安裝 ntp 伺服器
yum install ntp tzdata

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

Memtest86+:  This runs from a boot disk or CD and should eliminate or confirm if your one or more of your memory sticks are bad or the SPD values in the BIOS are correct.
Let it run for as long as you can: 2,4,6,8 or more hours (at least 3 full passes), if no errors by then your ram is OK.

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

Increasing Disk Space in CentOS using LVM  


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

Syslog 基本資訊

設定檔:

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

Contents
1 - Summary
2 - Console set to secure
3 - Console set to insecure


1 - Summary

This guide will show how to reset the root password in case you forgot it.
This has been tested in Red Hat Enterprise Linux 4 and 5.


2 - Console set to secure

This method works where the console is set to secure in the /etc/inittab file
without the following line: ~~:S:wait:/sbin/sulogin. When booting into
single-user mode it doesn't prompt for the root password. If you use default
boot loader GRUB, press any key to enter the GRUB menu. Using the arrow keys
select the version of the kernel that you want to edit and press [e] to enter
into edit mode. Go to the end of the line and press space once then add the
word single to tell GRUB to boot into single-user mode. In Red Hat Enterprise
Linux 4 press [b] to boot while in Red Hat Enterprise Linux press [Enter] to
boot.
grub append> ro root=LABEL=/ rhgb quiet single

Reset the password for the root user.
sh-3.2# passwd root
Changing password for user root.
New UNIX password: ********
Retype new UNIX password: ********
passwd: all authentication tokens updated successfully.

Reboot the system and log in with the root account using the new password.
sh-3.2# shutdown -r now


3 - Console set to insecure

This method works where the console is set to insecure in the /etc/inittab file
with the following line: ~~:S:wait:/sbin/sulogin. When booting into single-user
mode it does prompt for the root password. Boot from the installation CD. In
Red Hat Enterprise Linux 4 you will need to type "linux rescue selinux=0" while
in Red Hat Enterprise Linux 5 type the following at the installation boot
prompt.
boot: linux rescue

Select a language at the Language menu and hit [Enter]. Select a keyboard at
the Keyboard Type menu and hit [Enter]. Select No at the Setup Networking
screen. Select Continue at the Rescue menu and hit [Enter]. The rescue
environment will try to find the Linux installation and mount it under the
directory /mnt/sysimage. The next screen lets you know if it was successful or
failed. Hit [Enter] to continue.

Get a list of the disks.
sh-3.2# fdisk -l | grep Disk
Disk /dev/hda: 80.0 GB, 80026361856 bytes

Get information about the hard disk.
sh-3.2# dmesg | grep hda:
<6>    ide0: BM-DMA at 0xf000-0xf007, BIOS settings: hda:DMA, hdb:DMA
<4>hda: WDC WD800BB-75CAA0, ATA DISK drive
<6>hda: max request size: 128KiB
<6>hda: Host Protected Area detected.
<6>hda: Host Protected Area disabled.
<6>hda: 156301488 sectors (80026 MB) w/2048KiB Cache, CHS=65535/16/63, UDMA(100)
<6>hda: cache flushes not supported
<6> hda: hda1 hda2 hda3

View information about the file systems.
sh-3.2# cat /mnt/sysimage/etc/fstab
LABEL=/                 /                       ext3    defaults        1 1
LABEL=/data             /data                   ext3    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
LABEL=SWAP-hda3         swap                    swap    defaults        0 0

Change the root directory to point to /mnt/sysimage and run the passwd command
for the root user.
sh-3.2# chroot /mnt/sysimage /usr/bin/passwd root
Changing password for root user.
New UNIX password: ********
Retype new UNIX password: ********
passwd: all authentication tokens updated successfully.

Reboot the system and login with the root account using the new password. Make
sure to remove the installation CD.
sh-3.2# exit



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

 

 

里歐 發表在 痞客邦 留言(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) 人氣()