91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

nconf的安裝和配置

發布時間:2020-05-12 13:50:18 來源:億速云 閱讀:460 作者:Leah 欄目:移動開發

本文在介紹關于nconf的安裝和配置的基礎上,重點探討了其具體步驟,步驟簡單易上手操作,文章內容步步緊湊,希望大家根據這篇文章可以有所收獲。

nconf提供WEB界面,管理nagios配置,其將nagios配置文件放入數據庫,用戶做相應修改后點擊生成配置文件,Nconf會從數據庫中將配置寫入配置文件。所以最后nagios的配置還是以文件的形式存在,這是相對與nagioSQL本人比較喜歡Nconf的原因,其次Nconf還提供了靜態文件的修改頁面。

一、初始化數據庫
mysql> create database nconf default character set utf8;
mysql> grant all privileges on nconf.* to 'nconf'@'localhost' identified by 'XXXX' with grant option;
mysql> grant all privileges on nconf.* to 'nconf'@'%' identified by 'XXXX' with grant option;
mysql> flush privileges;

二、安裝Nconf
#tar -zxvf  nconf-1.3.0-0.tgz -C /var/www/html/
#chown -R apache:apache /var/www/html/nconf

三、初始化Nconf

nconf的安裝和配置

第二步驟需要建立軟連接,并且注意原文件的權限最好修改為777
#chmod 777 /usr/local/nagios/bin/nagios
#ln -s /usr/local/nagios/bin/nagios /var/www/html/nconf/bin/

nconf的安裝和配置

#第四步結束后刪除臨時文件
#rm -rf /var/www/html/nconf/{INSTALL,INSTALL.php,UPDATE,UPDATE.php}


三、配置Nconf sudo權限和自動生成配置文件

#visudo

apache    ALL=(ALL)       NOPASSWD:/etc/init.d/nagios

//修改nconf配置文件
#cat /var/www/html/nconf/config/deployment.ini
[extract config]
type        = local
source_file = "/var/www/html/nconf/output/NagiosConfig.tgz"
target_file = "/var/www/html/nconf/temp/"
action      = extract

[copy collector config]
type        = local
source_file = "/var/www/html/nconf/temp/Default_collector/"
target_file = "/usr/local/nagios/etc/Default_collector/"
action      = copy

[copy global config]
type        = local
source_file = "/var/www/html/nconf/temp/global/"
target_file = "/usr/local/nagios/etc/global/"
action      = copy
reload_command = "sudo /etc/rc.d/init.d/nagios reload"


四、nconf生成配置文件的流程

nconf的安裝和配置

點擊 Generate Nagios config 后會檢測Nagios配置文件是否有問題


nconf的安裝和配置

無問題后點擊 Deploy ,就會安裝下面的流程和上面配置文件中配置的路徑去執行相關操作。

nconf的安裝和配置

(1)在 [extract config] 配置的source_file下生成壓縮文件同時備份之前的壓縮文件,之后解壓到target_file下面

nconf的安裝和配置


(2)按照[copy collector config][copy global config] 的配置,將source_file 的文件復制到target_file 下。

(3)執行 sudo /etc/init.d/nagios reload


五、將現有配置導入Nconf中

(1)注意事項
按以下方式導入可避免配置文件之間的沖突:
1. timeperiods
2. misccommands & check_commands
3. contacts
4. contactgroups (considering that some contactgroups might be linked to others)
5. host-templates
6. parent-hosts, then remaining hosts
7. hostgroups (considering that some hostgroups might be linked to others)
8. host-dependencies(主機依賴)
9. service-templates
10. services
11. advanced-services
12. servicegroups (considering that some servicegroups might be linked to others)
13. service-dependencies

現有配置文件按屬性做更精細的分離,確保每個配置文件里面只有對應的配置屬性

(2)語法
Usage:
/var/www/html/nconf/bin/add_items_from_nagios.pl -c class -f /path/to/file [-x (1-5)] [-s]

Help:

 required

 -c  Specify the class of items that you wish to import. Must correspond to an NConf class
     (e.g. "host", "service, "hostgroup", "checkcommand", "contact", "timeperiod"...)

 -f  The path to the file which is to be imported. CAUTION: Make sure you have
     only items of one class in the same file (e.g. "hosts.cfg", "services.cfg"...)
     Also make sure you import host- or service-templates separately ("host" or
     "service" items containing a "name" attribute)

 optional

 -x  Set a custom loglevel (1 = lowest, 5 = most verbose)

 -s  Simulate only. Do not make any actual modifications to the database.
 
 #-s為測試模式,不會往數據庫插入任何數據
 /var/www/html/nconf/bin/add_items_from_nagios.pl -c timeperiod -f /usr/local/nagios/etc/objects/timeperiods.cfg -s
 
 (3)實戰
/var/www/html/nconf/bin/add_items_from_nagios.pl -c timeperiod -f /usr/local/nagios/etc/objects/timeperiods.cfg -s
/var/www/html/nconf/bin/add_items_from_nagios.pl -c misccommand  -f /usr/local/nagios/etc/objects/misccommands.cfg -s
/var/www/html/nconf/bin/add_items_from_nagios.pl -c checkcommand -f /usr/local/nagios/etc/objects/checkcommands.cfg -s
/var/www/html/nconf/bin/add_items_from_nagios.pl -c contact -f /usr/local/nagios/etc/objects/contacts.cfg -s
/var/www/html/nconf/bin/add_items_from_nagios.pl -c contactgroup -f /usr/local/nagios/etc/objects/contactgroup.cfg -s
/var/www/html/nconf/bin/add_items_from_nagios.pl -c host-template -f /usr/local/nagios/etc/objects/host-template.cfg -s
/var/www/html/nconf/bin/add_items_from_nagios.pl -c host -f /usr/local/nagios/etc/objects/hosts.cfg -s
/var/www/html/nconf/bin/add_items_from_nagios.pl -c service-template -f /usr/local/nagios/etc/objects/service-template.cfg -s
/var/www/html/nconf/bin/add_items_from_nagios.pl -c service -f /usr/local/nagios/etc/objects/services.cfg -s
/var/www/html/nconf/bin/add_items_from_nagios.pl -c service -f /usr/local/nagios/etc/objects/localhost.cfg -s


六、靜態文件修改功能

static_cfg默認路徑為/var/www/html/nconf/static_cfg

//創建一個測試文件

#echo "您好kjklsj111" >>/var/www/html/nconf/static_cfg/test.txt 


頁面點擊Administration->Edit static config files,你會發現有保存和下載按鈕,直接編輯文件后點擊保存就可

nconf的安裝和配置

關于nconf的安裝和配置就分享到這里了,希望以上內容可以對大家有一定的幫助,可以學到更多知識。如果喜歡這篇文章,不如把它分享出去讓更多的人看到。

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

会宁县| 武功县| 榆树市| 泽库县| 保定市| 腾冲县| 胶南市| 长兴县| 永宁县| 博爱县| 刚察县| 保康县| 永昌县| 井陉县| 金乡县| 祥云县| 乐东| 平定县| 常宁市| 沙雅县| 鹿泉市| 湖州市| 克东县| 分宜县| 武城县| 衡阳市| 绍兴市| 北京市| 唐海县| 布拖县| 崇阳县| 铅山县| 称多县| 潼南县| 宁德市| 迭部县| 灌阳县| 津南区| 团风县| 昌都县| 双鸭山市|