簡介
本文檔介紹使用基於Java的命令列介面(CLI)的Cisco Finesse Server或任何其他基於Cisco Voice Operating System(VOS)產品的多個故障排除場景。
附註:本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路正在作用,請確保您已瞭解任何指令可能造成的影響。
使用CLI對基於Cisco VOS的Finesse伺服器進行故障排除
通用概述
Cisco VOS CLI提供了一組命令,允許以非常有效的方式完成某些故障排除任務。
清理磁碟空間
任何基於VOS的伺服器都有一個非常常見的任務,那就是清理公共分割槽中的空間。此命令可用於此目的。
首先,列出日誌檔案,並指定路徑和可選鍵。
admin:file list activelog /desktop/logs/webservices date detail
11 Aug,2016 20:26:23 1,927,946 Desktop-webservices.2016-08-11T15-53-39.646.startup.log.zip
11 Aug,2016 21:44:42 1,105,322 Error-Desktop-webservices.2016-08-11T15-53-40.166.startup.log.zip
12 Aug,2016 01:48:58 1,741,638 Desktop-webservices.2016-08-11T20-26-23.164.log.zip
12 Aug,2016 03:35:30 1,126,078 Error-Desktop-webservices.2016-08-11T21-44-42.664.log.zip
12 Aug,2016 07:11:33 1,753,064 Desktop-webservices.2016-08-12T01-48-58.164.log.zip
12 Aug,2016 09:26:17 1,125,984 Error-Desktop-webservices.2016-08-12T03-35-30.164.log.zip
12 Aug,2016 12:34:08 1,741,476 Desktop-webservices.2016-08-12T07-11-33.664.log.zip
12 Aug,2016 15:17:05 1,125,790 Error-Desktop-webservices.2016-08-12T09-26-17.664.log.zip
然後刪除舊日誌檔案。(可選)您可以指定noconfirm鍵以避免確認,也可以不按yes進行確認。
admin:file delete activelog /desktop/logs/webservices/*webservices.2016-08-11* noconfirm
files: found = 4, deleted = 4
輸入的稽核CLI命令
此命令列出輸入的所有VOS CLI命令。即使命令執行失敗。
從輸出中,您可以看到系統已重新啟動,Tomcat-trust證書已匯入,並且Tomcat服務在此之後重新啟動。
admin:file search activelog platform/log/cli* "running command" ignorecase recurs
Searching path: /var/log/active/platform/log/cli*
2016-11-03 09:59:12,558 INFO [main] sdMain.main - running command -> [utils system restart ]
2016-11-03 09:38:52,623 INFO [main] sdMain.main - running command -> [set cert import trust tomcat]
2016-11-03 09:39:30,978 INFO [main] sdMain.main - running command -> [utils service restart Cisco Tomcat]
2016-11-03 09:41:16,664 INFO [main] sdMain.main - running command -> [show cert own tomcat]
Search completed
附註:在某些基於VOS的伺服器上ignorecase金鑰不可用。
聯機檢視日誌
查詢相關日誌檔案
如果特定錯誤消息顯示在Finesse客戶端中,則可以使用搜尋選項案例來確定準確的時間戳和日誌檔案。
admin:file search activelog /desktop/logs/ "100011" recurs ignorecase
Searching path: /var/log/active//desktop/logs/
/var/log/active//desktop/logs/realm/realm.log:1289383032: Nov 18 2016 08:14:15.076 +0100:
[http-bio-8445-exec-10] INFO CCRealmConfig.finesseAuthenticate(): Unable to authenticate user: 100011
Search completed
輸出顯示了準確的日誌檔案、具有msec精度的時間戳和生成的錯誤消息「無法驗證使用者:100011」。
聯機檢視檔案
找到相關日誌檔案後的下一步是檢視它。對於大型日誌檔案使用file dump選項不是很有用。可以使用file view代替,這樣您就可以直接導航到檔案的末尾。
admin:file view activelog /desktop/logs/realm/realm.log
0: Aug 11 2016 15:52:14.423 +0200: [localhost-startStop-1] INFO
Loaded realm log config file at: /opt/cisco/desktop/conf/realm/log4j.xml
55577: Aug 11 2016 15:53:10.000 +0200: [Infrastructure Initialization, completed] INFO
Loaded realm log config file at: /opt/cisco/desktop/conf/realm/log4j.xml
options: q=quit, n=next, p=prev, b=begin, e=end (lines 1 - 20 of 374) :
956921239: Nov 14 2016 11:53:13.283 +0100: [http-bio-8445-exec-12] INFO
CCRealmConfig.finesseAuthenticate(): Unable to authenticate user: 1012
1206572479: Nov 17 2016 09:14:04.523 +0100: [http-bio-8082-exec-6] INFO
CCRealmConfig.finesseAuthenticate(): Unable to authenticate user: MEDIASENSE_API
1217996207: Nov 17 2016 12:24:28.251 +0100: [http-bio-8082-exec-10] INFO
CCRealmConfig.finesseAuthenticate(): Unable to authenticate user: MEDIASENSE_API
1289292089: Nov 18 2016 08:12:44.133 +0100: [http-bio-8445-exec-22] INFO
CCRealmConfig.finesseAuthenticate(): Unable to authenticate user: 5678
1289383032: Nov 18 2016 08:14:15.076 +0100: [http-bio-8445-exec-10] INFO
CCRealmConfig.finesseAuthenticate(): Unable to authenticate user: 100011
end of the file reached
options: q=quit, n=next, p=prev, b=begin, e=end (lines 361 - 374 of 374) :
瀏覽VOS中的目錄
可以因多種原因使用。其中包括檢查是否生成日誌檔案以證明進程運行、檢查日誌大小以清除磁碟或進行自學。
此命令將給出按提供的名稱過濾的日誌檔案的清單。選項詳細資訊顯示日期和大小。附加鍵日期根據檔案生成的時間對輸出進行排序。
admin:file list activelog /desktop/logs/webservices/*2016-08-12* det date
12 Aug,2016 07:11:33 1,753,064 Desktop-webservices.2016-08-12T01-48-58.164.log.zip
12 Aug,2016 09:26:17 1,125,984 Error-Desktop-webservices.2016-08-12T03-35-30.164.log.zip
12 Aug,2016 12:34:08 1,741,476 Desktop-webservices.2016-08-12T07-11-33.664.log.zip
12 Aug,2016 15:17:05 1,125,790 Error-Desktop-webservices.2016-08-12T09-26-17.664.log.zip
12 Aug,2016 17:56:43 1,741,988 Desktop-webservices.2016-08-12T12-34-08.664.log.zip
12 Aug,2016 21:07:52 1,125,050 Error-Desktop-webservices.2016-08-12T15-17-05.164.log.zip
12 Aug,2016 23:19:18 1,753,089 Desktop-webservices.2016-08-12T17-56-43.663.log.zip
13 Aug,2016 02:58:40 1,125,382 Error-Desktop-webservices.2016-08-12T21-07-52.664.log.zip
13 Aug,2016 04:41:53 1,742,441 Desktop-webservices.2016-08-12T23-19-18.664.log.zip
dir count = 0, file count = 9
檢查平台歷史記錄
有關伺服器升級、思科選項包(COP)檔案安裝和重新啟動的基本診斷資訊非常有用。尤其是在故障排除過程中。
admin:file dump install system-history.log
=======================================
Product Name - Cisco Finesse
Product Version - 11.0.1.10000-24
Kernel Image - 2.6.32-431.20.3.el6.x86_64
=======================================
08/11/2016 12:46:19 | root: Install 11.0.1.10000-24 Start
08/11/2016 06:02:15 | root: Boot 11.0.1.10000-24 Start
08/11/2016 15:45:52 | root: Install 11.0.1.10000-24 Success
08/11/2016 15:45:53 | root: Boot 11.0.1.10000-24 Start
08/26/2016 12:50:14 | root: Cisco Option Install finesse-cce.1101.ES05.10000.cop Start
08/26/2016 13:25:51 | root: Cisco Option Install finesse-cce.1101.ES05.10000.cop Success
08/26/2016 13:51:14 | root: Restart 11.0.1.10000-24 Start
08/26/2016 13:51:40 | root: Boot 11.0.1.10000-24 Start
10/19/2016 17:16:48 | root: Shutdown 11.0.1.10000-24 Start
10/20/2016 12:17:10 | root: Boot 11.0.1.10000-24 Start
下載日誌
如果需要從系統中抽取日誌以進行進一步分析,則可以使用此命令。當Cisco Tomcat Web Server關閉且無法使用即時監控工具(RTMT)時,該功能不可替換。
您可以根據時間過濾器提取日誌。在此示例中,最近兩個小時。
admin:file get activelog /desktop/logs/webservices/ reltime hours 2 compress
This command can take significantly long time,
and can also affect the system wide IOWAIT on your system.
Would you like to proceed [y/n]?y
Please wait while the system is gathering files info ...done.
Sub-directories were not traversed.
Number of files affected: 1
Total size in Bytes: 3460015
Total size in Kbytes: 3378.921
Would you like to proceed [y/n]? y
SFTP server IP:
此外,還可以根據名稱過濾器提取日誌。在本示例中,僅從安裝目錄提取具有日誌副檔名的檔案。檔案未壓縮。
admin:file get install /*.log
Please wait while the system is gathering files info ...done.
Sub-directories were not traversed.
Number of files affected: 10
Total size in Bytes: 2640585
Total size in Kbytes: 2578.6963
Would you like to proceed [y/n]? n
Files transfer cancelled.
另一個有用的案例是收集特定時間範圍內根本原因分析的日誌。
admin:file get activelog /desktop/logs/ abstime 09:00:11/13/16 09:00:11/14/16 recurs
Please wait while the system is gathering files info ...done.
Sub-directories were traversed.
Number of files affected: 2
Total size in Bytes: 7446444
Total size in Kbytes: 7271.918
Would you like to proceed [y/n]?
附註:確保驗證總大小值,如果值太大,請縮小時間範圍或放置更具體的目錄。