【主機】檢視伺服器埠狀態
早上檢視郵件的時候 收到 oracle 1521 不能訪問的報警郵件。立即登入伺服器,檢視 lsnrctl status 一切正常!同事和網路工程師溝通了,發現是凌晨ACL 推演導致暫時不可訪問。
這裡總結幾種檢視伺服器上埠的狀態的方法:
1 netstat -an 檢視網路埠
oracle@yangDB2:/opt/oracle/10.2.0/orcl/network/admin>netstat -antp
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:2208 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:784 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:1521 0.0.0.0:* LISTEN 21883/tnslsnr
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:38173 0.0.0.0:* LISTEN 5902/ora_d000_orcl
tcp 0 0 127.0.0.1:2207 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:25045 127.0.0.1:1521 ESTABLISHED 5880/ora_pmon_orcl
tcp 0 0 127.0.0.1:1521 127.0.0.1:25045 ESTABLISHED 21883/tnslsnr
tcp 0 0 :::22 :::* LISTEN -
tcp 0 1036 ::ffff:10.250.7.230:22 ::ffff:10.1.165.1:51312 ESTABLISHED -
2 lsof -i :port,使用lsof -i :port就能看見所指定埠執行的程式,同時還有當前連線。
oracle@dba-host1:/home/oracle>lsof -i :1521
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
oracle 300 oracle 14u IPv4 380560725 TCP dba-host1.hz.ali.com:1521->10.250.3.42:32845 (ESTABLISHED)
oracle 302 oracle 14u IPv4 380560734 TCP dba-host1.hz.ali.com:1521->10.250.3.42:32846 (ESTABLISHED)
oracle 304 oracle 14u IPv4 380560743 TCP dba-host1.hz.ali.com:1521->10.250.3.42:32847 (ESTABLISHED)
oracle 306 oracle 14u IPv4 380560752 TCP dba-host1.hz.ali.com:1521->10.250.3.42:32848 (ESTABLISHED)
oracle 575 oracle 14u IPv4 386960754 TCP dba-host1.hz.ali.com:1521->10.1.170.195:55487 (ESTABLISHED)
oracle 952 oracle 14u IPv4 361820559 TCP dba-host1.hz.ali.com:1521->10.250.2.14:54674 (ESTABLISHED)
oracle 1445 oracle 14u IPv4 387183135 TCP dba-host1.hz.ali.com:1521->10.250.3.111:15845 (ESTABLISHED)
oracle 1548 oracle 14u IPv4 386924530 TCP dba-host1.hz.ali.com:1521->10.250.3.51:33970 (ESTABLISHED)
oracle 1550 oracle 14u IPv4 386924539 TCP dba-host1.hz.ali.com:1521->10.250.3.51:33971 (ESTABLISHED)
oracle 1650 oracle 14u IPv4 385984708 TCP dba-host1.hz.ali.com:1521->10.1.170.148:1717 (ESTABLISHED)
oracle 2036 oracle 14u IPv4 385310535 TCP dba-host1.hz.ali.com:1521->10.1.170.143:44647 (ESTABLISHED)
oracle 2734 oracle 14u IPv4 379270888 TCP dba-host1.hz.ali.com:1521->10.250.3.100:2837 (ESTABLISHED)
oracle 2736 oracle 14u IPv4 379270897 TCP dba-host1.hz.ali.com:1521->10.250.3.100:2849 (ESTABLISHED)
oracle 2738 oracle 14u IPv4 379270907 TCP dba-host1.hz.ali.com:1521->10.250.3.100:2855 (ESTABLISHED)
oracle 2740 oracle 14u IPv4 379270916 TCP dba-host1.hz.ali.com:1521->10.250.3.100:2856 (ESTABLISHED)
oracle 2742 oracle 14u IPv4 379270925 TCP dba-host1.hz.ali.com:1521->10.250.3.100:2857 (ESTABLISHED)
oracle 2744 oracle 14u IPv4 379270934 TCP dba-host1.hz.ali.com:1521->10.250.3.100:2859 (ESTABLISHED)
oracle 2746 oracle 14u IPv4 379270943 TCP dba-host1.hz.ali.com:1521->10.250.3.100:2860 (ESTABLISHED)
oracle 2748 oracle 14u IPv4 379270952 TCP dba-host1.hz.ali.com:1521->10.250.3.100:2861 (ESTABLISHED)
oracle 2828 oracle 14u IPv4 379271084 TCP dba-host1.hz.ali.com:1521->10.250.3.100:2875 (ESTABLISHED)
oracle 2830 oracle 14u IPv4 379271093 TCP dba-host1.hz.ali.com:1521->10.250.3.100:2877 (ESTABLISHED)
oracle 2832 oracle 14u IPv4 379271102 TCP dba-host1.hz.ali.com:1521->10.250.3.100:2878 (ESTABLISHED)
oracle 2834 oracle 14u IPv4 379271111 TCP dba-host1.hz.ali.com:1521->10.250.3.100:2880 (ESTABLISHED)
oracle 2836 oracle 14u IPv4 379271120 TCP dba-host1.hz.ali.com:1521->10.250.3.100:2881 (ESTABLISHED)
oracle 2838 oracle 14u IPv4 379271129 TCP dba-host1.hz.ali.com:1521->10.250.3.100:2882 (ESTABLISHED)
oracle 2840 oracle 14u IPv4 379271138 TCP dba-host1.hz.ali.com:1521->10.250.3.100:2884 (ESTABLISHED)
oracle 2842 oracle 14u IPv4 379271147 TCP dba-host1.hz.ali.com:1521->10.250.3.100:2885 (ESTABLISHED)
oracle 2856 oracle 14u IPv4 379271211 TCP dba-host1.hz.ali.com:1521->10.250.3.100:2895 (ESTABLISHED)
oracle 2858 oracle 14u IPv4 379271220 TCP dba-host1.hz.ali.com:1521->10.250.3.100:2896 (ESTABLISHED)
oracle 2870 oracle 14u IPv4 379271274 TCP dba-host1.hz.ali.com:1521->10.250.3.100:2905 (ESTABLISHED)
oracle 2872 oracle 14u IPv4 379271283 TCP dba-host1.hz.ali.com:1521->10.250.3.100:2906 (ESTABLISHED)
oracle 3456 oracle 14u IPv4 355696647 TCP dba-host1.hz.ali.com:1521->10.250.3.51:32818 (ESTABLISHED)
oracle 3460 oracle 14u IPv4 355696666 TCP dba-host1.hz.ali.com:1521->10.250.3.51:32821 (ESTABLISHED)
oracle 3464 oracle 14u IPv4 355696685 TCP dba-host1.hz.ali.com:1521->10.250.3.51:32823 (ESTABLISHED)
oracle 3466 oracle 14u IPv4 355696694 TCP dba-host1.hz.ali.com:1521->10.250.3.51:32824 (ESTABLISHED)
oracle 3475 oracle 14u IPv4 355696731 TCP dba-host1.hz.ali.com:1521->10.250.3.51:32828 (ESTABLISHED)
oracle 3543 oracle 14u IPv4 355696974 TCP dba-host1.hz.ali.com:1521->10.250.3.51:33015 (ESTABLISHED)
oracle 3545 oracle 14u IPv4 355696984 TCP dba-host1.hz.ali.com:1521->10.250.3.51:33016 (ESTABLISHED)
oracle 3547 oracle 14u IPv4 355696993 TCP dba-host1.hz.ali.com:1521->10.250.3.51:33017 (ESTABLISHED)
oracle 3549 oracle 14u IPv4 355697002 TCP dba-host1.hz.ali.com:1521->10.250.3.51:33018 (ESTABLISHED)
oracle 3551 oracle 14u IPv4 355697012 TCP dba-host1.hz.ali.com:1521->10.250.3.51:33019 (ESTABLISHED)
oracle 3553 oracle 14u IPv4 355697021 TCP dba-host1.hz.ali.com:1521->10.250.3.51:33020 (ESTABLISHED)
oracle 3555 oracle 14u IPv4 355697030 TCP dba-host1.hz.ali.com:1521->10.250.3.51:33021 (ESTABLISHED)
oracle 3557 oracle 14u IPv4 355697039 TCP dba-host1.hz.ali.com:1521->10.250.3.51:33022 (ESTABLISHED)
oracle 3559 oracle 14u IPv4 355697048 TCP dba-host1.hz.ali.com:1521->10.250.3.51:33023 (ESTABLISHED)
oracle 3561 oracle 14u IPv4 355697057 TCP dba-host1.hz.ali.com:1521->10.250.3.51:33024 (ESTABLISHED)
oracle 3742 oracle 14u IPv4 387787027 TCP dba-host1.hz.ali.com:1521->10.250.3.111:39453 (ESTABLISHED)
oracle 3915 oracle 14u IPv4 332853968 TCP dba-host1.hz.ali.com:1521->10.250.3.78:49232 (ESTABLISHED)
oracle 3917 oracle 14u IPv4 332853977 TCP dba-host1.hz.ali.com:1521->10.250.3.78:49233 (ESTABLISHED)
oracle 3919 oracle 14u IPv4 332853986 TCP dba-host1.hz.ali.com:1521->10.250.3.78:49234 (ESTABLISHED)
oracle 3921 oracle 14u IPv4 332853995 TCP dba-host1.hz.ali.com:1521->10.250.3.78:49235 (ESTABLISHED)
oracle 3923 oracle 14u IPv4 332854004 TCP dba-host1.hz.ali.com:1521->10.250.3.78:49236 (ESTABLISHED)
oracle 3925 oracle 14u IPv4 332854014 TCP dba-
3 nmap 埠掃描
oracle@yangDB2:/opt/oracle/10.2.0/orcl/network/admin>nmap 10.1.157.42
Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2011-08-18 21:31 CST
Interesting ports on 10.1.157.42:
Not shown: 1670 closed ports
PORT STATE SERVICE
22/tcp open ssh
111/tcp open rpcbind
952/tcp open unknown
1521/tcp open oracle
5801/tcp open vnc-http-1
5802/tcp open vnc-http-2
5901/tcp open vnc-1
5902/tcp open vnc-2
6001/tcp open X11:1
6002/tcp open X11:2
4 檔案/etc/services顯示的各個服務的埠號;
oracle@yangDB2:/opt/oracle/10.2.0/orcl/network/admin>cat /etc/services | more
# /etc/services:
# $Id: services,v 1.42 2006/02/23 13:09:23 pknirsch Exp $
#
# Network services, Internet style
#
# Note that it is presently the policy of IANA to assign a single well-known
# port number for both TCP and UDP; hence, most entries here have two entries
# even if the protocol doesn't support UDP operations.
# Updated from RFC 1700, ``Assigned Numbers'' (October 1994). Not all ports
# are included, only the more common ones.
#
# The latest IANA port assignments can be gotten from
#
# The Well Known Ports are those from 0 through 1023.
# The Registered Ports are those from 1024 through 49151
# The Dynamic and/or Private Ports are those from 49152 through 65535
#
# Each line describes one service, and is of the form.:
#
# service-name port/protocol [aliases ...] [# comment]
tcpmux 1/tcp # TCP port service multiplexer
tcpmux 1/udp # TCP port service multiplexer
rje 5/tcp # Remote Job Entry
rje 5/udp # Remote Job Entry
echo 7/tcp
echo 7/udp
discard 9/tcp sink null
discard 9/udp sink null
systat 11/tcp users
systat 11/udp users
daytime 13/tcp
daytime 13/udp
qotd 17/tcp quote
qotd 17/udp quote
msp 18/tcp # message send protocol
--More--
使用netstat -a 可以看見所有的埠號,這個自己測試啦。。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22664653/viewspace-705290/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 檢視一個通訊埠狀態
- Linux檢視埠使用狀態、關閉埠方法Linux
- Linux下用netstat檢視網路狀態、埠狀態Linux
- 伺服器埠狀態伺服器
- mysql檢視主從同步狀態的方法MySql主從同步
- linux檢查埠狀態命令Linux
- linux檢視伺服器狀態命令--lsloadLinux伺服器
- uptime命令檢視Linux伺服器健康狀態Linux伺服器
- 檢視linux伺服器狀態常用命令Linux伺服器
- 根據ip列表檢測主機狀態(shell指令碼)指令碼
- 檢視BW執行狀態
- 檢視看防火牆狀態防火牆
- 使用MegaCli工具檢視Raid磁碟陣列狀態[主站備]AI陣列
- 系統狀態檢視工具Sysstat
- firewalld:檢視版本/幫助/狀態
- GitLab 的元件狀態檢視Gitlab元件
- mysql 優化:使用show status檢視MySQL伺服器狀態資訊MySql優化伺服器
- 【知識分享】如何檢視伺服器埠及埠分類伺服器
- 埠狀態詳解
- 怎麼檢視伺服器的埠 雲伺服器的埠怎麼修改伺服器
- 使用 telescope 檢視 schedule 執行狀態
- 系統狀態統計和檢視
- 檢視映象資料庫的狀態資料庫
- linux perl 檢視檔案狀態Linux
- 系統狀態檢視工具systat(轉)
- Elasticsearch 檢視節點狀態資訊(qbit)Elasticsearch
- Kylin系統檢視firewalld狀態
- 如何檢視CATIA許可證狀態
- 雲伺服器如何檢視埠是否連通伺服器
- 檢視埠號
- C#機房重構-實時檢視上機餘額(狀態模式)C#模式
- mysql狀態檢視 QPSTPS快取命中率檢視MySql快取
- 【知識分享】檢視伺服器狀態經常使用的幾個命令伺服器
- Linux 檢視網路連線狀態Linux
- Solaris之檢視執行系統狀態
- OracleRAC管理 之 叢集狀態&資訊檢視Oracle
- cmd 檢視防火牆狀態以及關閉防火牆
- 檢視使用 MySQL Shell 的連線狀態MySql