ncpa安裝

安裝

NCPA爲所有的目標平臺準備了安裝包。包括windows,linux RRM 和 DEB包,除此之外也爲其他較少使用的操作系統準備了tarballs。NCPA不支持未知的平臺。NCPA包爲所有的目標平臺提供了一個非常簡便的安裝方法,這個文檔將通過例子來講述如何安裝NCPA.

首先這裏講述的是如何進行簡便安裝,如果你有一個很複雜的環境,你或許得跳過這裏。除非你知道該如何去做,在這裏並不存在很複雜的安裝NCPA的方法

注意

這並不是一個能適應任何情況的指南,也許你應該調整你自己防火牆,爲NCPA放行5693端口。通常windows會自動放行這個端口,就象MAC OS 一樣。請你時刻記住這一點,當首次安裝後出現不能工作的情況,請檢查這一點。


在windows中安裝NCPA

首先下載安裝程序到機器中。安裝程序下載地址:NCPA’s Windows Installer link.

圖形化安裝

安裝程序下載以後,雙擊安裝程序,同意license後,你將會看到一個配置界面,這是詢問你填配置信息。

_p_w_picpaths/win-install-screenshot.png

NCPA作爲一個代理的時候,僅需要填寫一個簡單的進入token 到文本框中就可以單擊下一步了。 你必須記住這個token,在配置Nagios XI嚮導或使用check_ncpa.py plugin 需要用到它.如果你是安裝這個代理髮送被動的檢查結果給Nagios,有額外的信息需要填寫。 

  • Token - NCPA 使用它用來做身份驗證。你需要這個token當你安裝配置 Nagios的監控代理的時候。

對於被動代理這個token不是絕對必需的,有其他的參數需要指定:

  • NRDP URL

  • 這個URL是NCPA 作爲被動代理髮送檢查結果的目標。對於主動代理這個是不需要的。

    • NRDP Token

    • 這是NRDP身份驗證的token值。作爲被動代理時需要填寫。

  • Hostname

  • 這個主機名是代理將報告發回nagios需要填寫的主機名,由nagios進行定義。

    Config Name

  • This is the NRDS config name that the agent will request when contacting the NRDS server.

注意:

如果你使用被動檢查,在初始安裝的時候"NRDP token"由NRDP與NRDS共用。如果這個值請編ncpa.cfg. 

寂靜安裝

windows安裝包也支持寂靜安裝,效果與GUI安裝相同。

注意:


寂靜安裝請求在命令行實用 /S 參數。同時跟隨其他參數,如:

/<directive>="<value>"

這些參數都可以在命令行下使用

  • TOKEN

  • The token that will be used to access the agent’s API and web interface.

  • NRDPURL

  • This specifies the NRDP URL to use if passive checks are being implemented.

  • NRDPTOKEN

  • This is the token that will be used to authenticate NRDP passive checks and to authenticate with NRDS.

  • HOST

  • The host that the passive agent will report back as.

  • CONFIG

  • The name of the NRDS config the agent will be associated with.

這裏有一個使用寂靜安裝的例子 TOKEN ‘fishingrocks’:

ncpa-<version>.exe /S /TOKEN='fishingrocks'

Note

所有這些值都可以在安裝完之後,很容易的改變。當感覺到這些安裝參數通過後,請記錄下來。

現在NCPA服務已經安裝完畢並啓動。

To test your installation see Testing Your Installation.

使用RPM包安裝NCPA

首先根據操作系統類型下載對應的RPM安裝包。

Note

這些RPM或許未能覆蓋你的系統,或者在你的系統上無法工作,你可以從git上獲取源代碼進行build。

這是一個使用rpm進行安裝例子,當然你也可以使用yum或zypper也一樣。

rpm -ivh --nomd5 <path to the NCPA RPM>

現在NCPA 服務經安裝並啓動 。

你需要編輯  /usr/local/ncpa/etc/ncpa.cfg 去指定一個通訊字符串  在  [api] section 中 ,設置 你自己的  token:

[api]
community_string=<your token>

更改ncpa.cfg之後,需要重新啓動 ncpa_listener.重啓命令 :

/etc/init.d/ncpa_listener restart

To test your installation see Testing Your Installation.

使用 DEB Packaging安裝 NCPA

下載安裝包 

安裝命令 

dpkg -i <path to the NCPA deb>

修改  /usr/local/ncpa/etc/ncpa.cfg 中的通訊字符串 ,在  [api] section 中 設置你自己的 token:

[api]community_string=XXXXXX

重啓動服務 

/etc/init.d/ncpa_listener restart

To test your installation see Testing Your Installation.

在  Mac OS X 上安裝 

Note

The install process on Mac OS X is still experimental. If you would like to help make this process better, please get in contact with the author (whose address can be found at the bottom of the page.)

Download the DMG here .

Download the NCPA DMG here . You will need to log in as root, or at least as a user who can run commands as root to continue with the installation. Then, depending on where you installed it (we will assume you downloaded it to your /tmp directory), run the following commands:

cd /tmp
hdiutil attach /tmp/ncpa-<version>.dmg
sudo zsh /Volumes/NCPA-<version>/install.sh

What this script does:

  • Creates the folder /usr/local/ncpa if it does not exist

  • Moves all necessary files there

  • Sets the owner of /usr/local/ncpa to nagios:nagcmd

  • Sets the mode of /usr/local/ncpa to 775

  • Creates the group nagcmd if it does not exist

  • Creates the user nagios if it does not exist

  • Starts the listener daemon

If any of this fails, you will need to do the steps manually. The steps that may fail most often are adding users and groups. If they do, add the user ‘nagios’ and make sure the group ‘nagcmd’ exists and that ‘nagios’ user is in the group ‘nagcmd’.

測試你的安裝結果 

Warning

配置防火牆放行  5693 端口 

你需要知道以下信息 

  • 代理者 IP

  • 在  [api] 中定義的  community_string (這個  token field 在  Windows Installer時定義 )

打開瀏覽器輸入 https://ip:5693, 如果提示你輸入 token意味着安裝成功 .


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章