NetWorker:如何使用 nsradmin 命令列公用程式來管理 NetWorker 資源

Summary: nsradmin 是由 NetWorker 軟體提供的命令列公用程式。nsradmin 可用來修改 NetWorker 伺服器資源資料庫 (nsrdb) 和用戶端/安全性資料庫 (nsrladb)。本 KB 提供 nsradmin 功能和使用案例的一般概觀。

This article applies to This article does not apply to This article is not tied to any specific product. Not all product versions are identified in this article.

Instructions

概觀

NetWorker 資源包含在兩個主要資料夾中:
    /nsr/res/nsrdb/ - 僅在 NetWorker 伺服器上找到。這是 NetWorker 伺服器資源資料庫。
    /nsr/res/nsrladb/ - 在所有 NetWorker 系統上找到。這包含安全性組態 (對等憑證等)。

注意:在 Windows 作業系統上,nsrdb 和 nsrladb 的預設路徑為「C:\Program Files\EMC NetWorker\nsr\res.」

nsradmin 可讓您變更、建立或刪除 nsrdb 和 nsrladb 資料庫中的資源。為了確保安全性並防止不必要的篡改,必須使用 root 或系統管理員命令提示字元。如果限制系統使用者使用 root 或系統管理員命令提示字元,則 nsrlogin 可以使用命令。 nsrlogin 使用 NetWorker 驗證服務中所設定 (本機或外部) 的帳戶進行驗證。 nsrlogin 頒發基於時間的令牌,允許使用者(如果允許)通過以下方式進行更改 nsradmin ,並使用其他提升權限的 NetWorker 命令:

  • 本機使用者帳戶: nsrlogin -u username
  • 外部驗證 (AD/LDAP): nsrlogin -t tenant_name -d domain_name -u user_name
  • 登出:nsrlogout

存取 nsradmin

列出特定 NetWorker 資源 (例如用戶端) 的所有屬性。

您可以在線上或離線使用該工具,但如果您將 nsrdb 或 nsrladb 變更為離線,則必須重新啟動 NetWorker 服務才能套用。

線上:  nsradmin 與線上伺服器上執行的 NetWorker 精靈互動,以檢視或變更資源屬性。
nsradmin
線上 (nsrladb):默認情況下,如果未指定其他標誌, nsradmin 嘗試開啟與 nsrdb 的連線。若要存取 nsrladb,您必須指定用戶端程序 (nsrexec)。
nsradmin -p nsrexecd
離線:  nsradmin 指向相關資源資料庫以查看或更改資源屬性。
nsradmin -d /path_to/nsrdb
遠端:您必須使用 -s 切換至執行 nsradmin 在要連線的遠端 NetWorker 系統上 nsradmin 在網路上的另一個 NetWorker 系統上。 
nsradmin -s remote_networker_system [-p nsrexecd]

輸入檔案:從檔而不是標準輸入中獲取輸入命令。在此模式下,不會列印互動式提示。

nsradmin -i file
其他功能與操作詳述於 nsradmin 「NetWorker 命令參考指南」一節,可透過以下方式取得: https://www.dell.com/support/product-details/product/networker/docs

記錄

透過下列方式執行的 nsrdb 變更: nsradmin 已登入 NetWorker 伺服器的 /nsr/logs/rap.log (預設值: C:\Program Files\EMC NetWorker\nsr\logs\rap.log 在 Windows 作業系統上)
 

使用 nsradmin

nsradmin 模式

nsradmin 可以在兩種模式下使用:

  • 命令模式(預設)和可視化模式;命令模式是檢視和操作的常用方法 nsradmin。不需要其他選項即可使用此模式。
  • 視覺化模式提供全螢幕命令列介面,可用於檢視和管理 NetWorker 資源。當特定資源或 屬性時,此方法可能很有用: 未知;但是,它在批處理操作中受到限制。要進入視覺模式,請輸入 visualnsradmin 速:
[root@nsr ~]# nsradmin
NetWorker administration program.
Use the "help" command for help, "visual" for full-screen mode.
nsradmin> visual
注意:此知識文章僅提供命令模式的指示。

 

NetWorker 資源類型

獲取已知資源類型的清單。Enter typensradmin 速。NetWorker 伺服器的範例:

nsradmin> type
                 Known types: NSR, NSR auditlog, NSR client, NSR client fix,
                              NSR cloneconfig, NSR Data Domain, NSR device,
                              NSR directive, NSR hypervisor, NSR label,
                              NSR license, NSR lockbox,
                              NSR NAS discovery task, NSR notification,
                              NSR policy, NSR pool, NSR Protection Group,
                              NSR Protection Policy, NSR recover, NSR Rule,
                              NSR savesets count, NSR SCG, NSR schedule,
                              NSR service, NSR stage, NSR Storage Node,
                              NSR task, NSR usergroup, NSR VMware proxy,
                              NSR vproxy log aggregate;

內部作業 nsradmin 如下:

         bind [query]
         create attrlist
         delete [query]
           edit [query]
           help [command]
          print [query] (set current query)
         server [name]
           show [attrlist]
          types
         update attrlist
         append attrlist
           quit
         visual [query]
         option [list]
          unset [list]
              . [query]
              ? [command]
           exit

Where:
        query ::= attrlist
        attrlist ::= attribute [; attribute]*
        attribute ::= name [: [value [, value]* ]

查詢 NetWorker 資源

若要查詢 NetWorker 資源,請在下列位置輸入下列命令: nsradmin 速:
nsradmin> print type:NetWorker_resource; attribute:value 
資源的所有屬性都由返回的 屬性 組合標識。
例如,若要查詢名為 Pluto 的 NetWorker 用戶端資源的所有屬性,請鍵入下列命令:
nsradmin> print type: NSR client; name: win-srvr01.amer.lan

列出與篩選 nsradmin 結果

若要列出所有客戶機資源的特定屬性,請在下列位置輸入下列命令: nsradmin 速:
nsradmin> . type: NSR client; name: client_name 
nsradmin> show 
nsradmin> print

若要列出特定保護群組中的所有用戶端,請在 nsradmin 速:

nsradmin> . type: nsr client; protection group list:Protection_Group_Name
nsradmin> show name 
nsradmin> print

若要列印所有已註冊用戶端及其作業系統的清單,請在以下位置輸入以下命令: nsradmin 速:

nsradmin> . type: NSR client 
nsradmin> show name; OS 
nsradmin> print

若要列出所有處於服務模式的裝置,請在 nsradmin 速:

nsradmin> show name
nsradmin> print type: NSR device; enabled: Service

在查詢任何資源類型之前,可以輸入下列內容來顯示隱藏選項:

nsradmin> option hidden

若要透過輸入 show 屬性來重設查詢規格,請輸入 show

nsradmin> show

更新資源

若要更新 NetWorker 資源,請在 nsradmin 速:
nsradmin>. type:NetWorker_resource; attribute:value 
nsradmin> update action; attribute1:value; attribute2:value
您可以更新資源的多個屬性。屬性 組合會以分號 (;) 分隔。例如,若要修改用戶端使用的儲存集和備份命令:
nsradmin> . type: nsr client; name: win-srvr01.amer.local 
nsradmin> update save set:"MSSQL:DELL"; backup command:nsrsqlsv
注意:正確指定屬性名稱和值,包括屬性值的正確案例。如果屬性名稱和值未正確指定,則屬性不會更新,也不會提供錯誤訊息。

刪除資源

警示:確保您只刪除應該刪除的資源。具有相依性的 NetWorker 資源會阻止您刪除相依性 (如果相依性仍然存在)。此外,某些資源無法在 NetWorker 服務執行時刪除,或 nsradmin 使用線上模式。在變更這些資料庫之前,最好先建立 /nsr/res/nsrdb (伺服器) 和 /nsr/res/nsrladb (用戶端) 的備份。

要刪除任何資源,請在設置資源類型后輸入刪除;比如:

nsradmin> . type: NetWorker_Resource; attribute:value
nsradmin> delete
有相依性的 NetWorker 資源無法刪除;通知您無法刪除的內容。
範例:
nsradmin> delete type: nsr pool; name: DD_Bootstrap 
name: DD_Bootstrap; 
Delete? yes 
delete failed: Pool `DD_Bootstrap' cannot be deleted because it has active volumes in the media database.
注意:您必須透過更新相依性或將其移除來解決問題。在某些情況下,可能需要使用 nsradmin 在離線模式下;但是,無論依賴項是否已解決,這都會刪除資源。伺服器上的服務重新開機後,將會不再顯示已刪除的資源。

建立資源

若要建立資源,請輸入下列內容:
nsradmin> create type: Networker_resource; name:resource_name; attribute1:value; attribute2:value 
create? yes

Additional Information

Affected Products

NetWorker

Products

NetWorker Series
Article Properties
Article Number: 000203325
Article Type: How To
Last Modified: 14 Feb 2025
Version:  11
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.