中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

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

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

Nagios+Centreon+Nrpe集成(二)

發布時間:2020-07-18 09:53:49 來源:網絡 閱讀:2652 作者:zhengweila 欄目:移動開發

 

4centreon集成

4.1應用程序安裝

### 版本:centreon-2.3.9.tar.gz
下載地址:http://www.centreon.com/Content-Download/donwload-centreon
安裝參考文檔:(1http://documentation.centreon.com/01-centreon/centreon_web/documentation/01-setup/installation_from_sources/step_05_-_centreon
2http://blog.sina.com.cn/s/blog_5611597901016qd2.html
 
# tar zxvf centreon-2.3.9.tar.gz
# cd centreon-2.3.9
# ./install.sh -i //以下是安裝過程中需要根據實際路徑修改的地方,其他均為y 回車(當然你也可以自己定制)

Where is your NDO ndomod binary ?

default to [/usr/sbin/ndomod.o]

> /usr/local/nagios/bin/ndomod.o

/usr/local/nagios/bin/ndomod.o                             OK

4.2 web installation

(1)以下服務均已啟動
# /etc/init.d/apache2 start
# /etc/init.d/mysqld start
# /etc/init.d/ndo2db start
# /etc/init.d/nagios start

(2)開始安裝:http://192.168.113.5/centreon/

### 備注參考內容:

http://documentation.centreon.com/01-centreon/centreon_web/documentation/01-setup/installation_from_sources/step_05_-_centreon

http://blog.sina.com.cn/s/blog_5611597901016qd2.html

### 部分配圖:其他基本next

圖示1mysql root密碼填寫,三個新庫密碼設置

圖示2:配置centreon管理員用戶、密碼、其他三項自定義

 

4.3在線安裝nagios

Centreon安裝時,其他應用在線安裝的,需要修改以下可能出現的路徑問題:

 

Where is installed Nagios ?

default to [/usr/local/nagios]

>  /usr/share/nagios3/

Path /usr/share/nagios3/                                   OK

 

Where is your nagios config directory

default to [/usr/local/nagios/etc]

> /etc/nagios3

Path /etc/nagios3                                          OK

 

Where is your Nagios var directory ?

default to [/usr/local/nagios/var]

>  /var/log/nagios3/

Path /var/log/nagios3/                                     OK

 

Where is your Nagios plugins (libexec) directory ?

default to [/usr/local/nagios/libexec]

> /usr/lib64/nagios/plugins

Path /usr/lib64/nagios/plugins                             OK

/usr/sbin/nagios3                                          OK

 

Where is your Nagios p_w_picpath directory ?

default to [/usr/local/nagios/share/p_w_picpaths/logos]

> /usr/share/nagios3/htdocs/p_w_picpaths/logos/

Path /usr/share/nagios3/htdocs/p_w_picpaths/logos/               OK

 

Where is your NDO ndomod binary ?

default to [/usr/sbin/ndomod.o]

> /usr/lib/ndoutils/ndomod-mysql-3x.o

/usr/lib/ndoutils/ndomod-mysql-3x.o                        OK

4.4 Web 安裝centreon完成后

### 參考鏈接:http://www.xodino.it/?page_id=968

Finalize Centreon configuration:

Open in webrowser: "http://<yourserverip>/centreon/", replace "<yourserverip>" with your Centreon server ip address or hostname.

 

Go to: Configuration -> Nagios -> cgi (in sidebar), Press on "CGI.cfg" link

Change settings to some options, as writed below:

- Physical HTML Path: /usr/share/nagios3/htdocs

- URL HTML Path : /nagios3

- Nagios Process Check Command: /usr/lib/nagios/plugins/check_nagios /var/cache/nagios3/status.dat 5 '/usr/sbin/nagios3'

Press Save

 

Go to: Configuration -> Nagios -> nagios.cfg (in sidebar), Press on "Nagios CFG 1" link, you should be in "Files" section of the configuration screen.

Make sure to set folowing configuration values:

- Log File : /var/log/nagios3/nagios.log

- Downtime File : /var/lib/nagios3/downtime.dat

- Comment File : /var/lib/nagios3/comment.dat

- Temp File : /var/cache/nagios3/nagios.tmp

- P1 File : /usr/lib/nagios3/p1.pl

- Lock File : /var/run/nagios3/nagios3.pid

- Object Cache File : /var/cache/nagios3/objects.cache

- Status File : /var/cache/nagios3/status.dat

- External Command File : /var/lib/nagios3/rw/nagios.cmd

 

Now Press on "Logs Options" tab to go to "Logs Options" section.

Make sure to set folowing configuration values:

- Log Archive Path : /var/log/nagios3/archives/

- State Retention File : /var/lib/nagios3/retention.dat

Press Save

 

Go to: Administration -> Options -> CentStorage (in sidebar)

Make sure to set folowing configuration values:

- Nagios current log file to parse: /var/log/nagios3/nagios.log

Press Save

 

Now let's apply our changes, go to: Configuration -> Nagios

Select as below:

- Generate Configuration Files

- Include Comments

- Run Nagios debug (-v)

- Move Export Files

- Restart Nagios

- Method: "External Command"

Press Export

 

This will restart Nagios & apply all changes you made in Web Interface.

You will do it every time you make changes, e.g. adding/modifying of hosts, commands, contacts, services...etc...

 

The installation of Centreon is completed.

 

Final fixes (very important):

Go to terminal console, then...

 

In Debian/Ubuntu the user "nagios" is set to "/bin/false" shell. Because of it "centcore" and "centstorage" daemons won't start. A reason for that is because those daemons use "su -c" command which requires a real shell, so the shell for

 

"nagios" user must be set to "/bin/sh":

# usermod -s /bin/sh nagios

 

Apply permissions for Web interface to be able to send "External Commands", perform the following commands to change directory permissions and to make the changes permanent:

# invoke-rc.d nagios3 stop

# dpkg-statoverride --update --add nagios www-data 2710 /var/lib/nagios3/rw

# dpkg-statoverride --update --add nagios nagios 751 /var/lib/nagios3

 

Add htaccess user with password "P@ssw0rd" for nagios CGI:

# htpasswd -bc /etc/nagios3/htpasswd.users nagiosadmin P@ssw0rd

 

Allow SNMP readonly access:

# echo "rocommunity public" > /etc/snmp/snmpd.conf

 

If you want to allow SNMP access only for localhost then use this instead:

# echo "rocommunity public 127.0.0.1" > /etc/snmp/snmpd.conf

 

# ls -al /usr/lib/nagios/plugins  //查看權限,需要具有sudo權限

# cd /usr/lib/nagios/

# chmod -R u+s plugins   //權限修改成 -rwsr-xr-x

### 不修改權限會報:Warning: This plugin must be either run as root or setuid root.

Now, restart the server

# reboot

4.5 常規信息監控

4.5.1激活配置

# /etc/init.d/nagios3 reload

# /etc/init.d/centcore restart or start

# /etc/init.d/centstorage restart or start

# /etc/init.d/ndoutils restart

# /etc/init.d/nagios-nrpe-server restart

4.5.2監控本機

1)配置監控主機

2)定義主機服務

Go to: Configuration -> Serivces -> Add -> Services by host

Add---關系(Relations)保存后生效,然后激活配置

4.5.3通過nrpe插件監控本機

1)定義check_nrpe命令

命令名:check_nrpe

命令行:$USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$

Go to: Configuration -> Commands -> Checks -> Add -> Services by host

2nrpe常用模版修改

# vim /etc/nagios/nrpe.cfg

# The following examples use hardcoded command arguments...

command[check_users]=/usr/lib/nagios/plugins/check_users -w 5 -c 10

command[check_load]=/usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20

#command[check_hda1]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hda1

command[check_disk]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /

command[check_zombie_procs]=/usr/lib/nagios/plugins/check_procs -w 5 -c 10 -s Z

command[check_total_procs]=/usr/lib/nagios/plugins/check_procs -w 150 -c 200

3)添加check_load

Go to: Configuration -> Services -> Templates -> Add -> Save

依次對照填寫以下內容

3)關聯模版

因為 Centreon-Server繼承的是generic-host主機模板,所以我們在generic-host模板里將剛才的服務模板都關聯上

Go to: Configuration -> HOsts -> Templates -> generic-host –> Relations

Go to: Configuration -> HOsts -> Centreon-Server

再次查看Centreon-Serve服務,已經生成  //若沒有以下狀態,可以重啟nagios-nrpe-server ndoutils 服務

Go to: Monitoring -> Services -> All Serveices

4.6 Linux客戶端監控

# apt-get install build-essential

4.6.1 nagios-plugins install

# groupadd nagios    # useradd –g nagios nagios
# tar zxvf  nagios-plugins-1.4.16.tar.gz
# cd nagios-plugins-1.4.16/
# ./configure
# make && make install
# chown nagios.nagios /usr/local/nagios
# chown -R nagios.nagios /usr/local/nagios/libexec

4.6.2 nrpe install

# apt-get install libssl-dev
# tar zxvf nrpe-2.13.tar.gz //以下為源碼安裝
# cd nrpe-2.13
# ./configure
# make all
# make install-plugin
# make install-daemon
# make install-daemon-config
# vim /usr/local/nagios/etc/nrpe.cfg

allowed_hosts=127.0.0.1,192.168.113.5

# The following examples use hardcoded command arguments...

command[check_users]=/usr/lib/nagios/plugins/check_users -w 5 -c 10

command[check_load]=/usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20

#command[check_hda1]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hda1

command[check_desk]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /

command[check_zombie_procs]=/usr/lib/nagios/plugins/check_procs -w 5 -c 10 -s Z

command[check_total_procs]=/usr/lib/nagios/plugins/check_procs -w 150 -c 200

# cp init-script.debian /etc/init.d/nrpe
# chmod +x /etc/init.d/nrpe    # /etc/init.d/nrpe start
# netstat -antup |grep 5666
# /usr/local/nagios/libexec/check_nrpe -H 127.0.0.1  //在線安裝路徑
# /usr/lib/nagios/plugins/check_nrpe -H 192.168.113.6 //在監控服務器

4.6.3 web centreon configuration

1Go to: Configuration -> HOsts -> Templates ->Servers-Linux –> Relations -> Save

   

2Go to: Configuration -> HOsts -> Add –> Save

   
   
 
 

 

 

 

4.6 可能的報錯信息

1)報錯解決:

Error: Could not create external command file '/var/log/nagios3/rw/nagios.cmd'

解決:mkdir /var/log/nagios3/rw

Chown nagios.nagios rw

2)在線安裝ndoutils,啟動ndo2前一定要修改:/etc/default/ndoutils

ENABLE_NDOUTILS=1

向AI問一下細節

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

AI

泰宁县| 泰和县| 内江市| 弋阳县| 延寿县| 泊头市| 英德市| 永清县| 阿鲁科尔沁旗| 祁阳县| 虞城县| 体育| 龙州县| 灵璧县| 延长县| 盘山县| 北流市| 双柏县| 辉县市| 石林| 洪江市| 宁乡县| 盐津县| 普兰店市| 双辽市| 茂名市| 内黄县| 龙海市| 建德市| 太仆寺旗| 宜丰县| 行唐县| 甘孜| 中江县| 沙坪坝区| 宝丰县| 顺昌县| 沙田区| 湘潭县| 盈江县| 额济纳旗|