精品伊人久久大香线蕉,开心久久婷婷综合中文字幕,杏田冲梨,人妻无码aⅴ不卡中文字幕

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
也談cacti整合nagios(centos)
花了近一天的時間整合了cacti和nagios,cacti用來檢測運行狀態nagios主要用來預警。期間參考了很多網友的文章,在此感謝下!在這里記錄一下配置過程,以備后忘。。說整合其實只是表面的,cacti和nagios還是以他們原來的方式進行工作,ndo負責將nagios收集的數據存在數據庫中,cacti的npc插件會從數據庫中取數據在cacti的npc標簽中來展現。

環境是cenos5.1+最小化安裝+development tools
開始配置。。

vi /etc/yum.repos.d/Dag.repo###定義第三方源
[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
http://rh-
mirror.linux.iastate.edu/pub/dag/redhat/el$releasever/en/$basearch/dag
http://wftp.tu-
chemnitz.de/pub/linux/dag/redhat/el$releasever/en/$basearch/dag
http://archive.cs.uu.nl/mirror/dag.wieers/redhat/el$releasever/en/$basearch/dag
http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
http://mirror.cpsc.ucalgary.ca/mirror/dag/redhat/el$releasever/en/$basearch/dag
http://rpmfind.net/linux/dag/redhat/el$releasever/en/$basearch/dag
http://ftp.riken.jp/Linux/dag/redhat/el$releasever/en/$basearch/dag
http://mirrors.ircam.fr/pub/dag/redhat/el$releasever/en/$basearch/dag
gpgcheck=0
enabled=1
protect=0
gpgcheck=1
gpgkey=http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt

##################################################

vi utterramblings.repo ###定義php獨立源

name=Jason's Utter Ramblings Repo
baseurl=http://www.jasonlitka.com/media/EL$releasever/$basearch/    
enabled=1    
gpgcheck=1    
gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
#########################################################################


一次性安裝所需軟件
yum -y install httpd mysql-server rrdtool mysql-devel php-devel net-snmp php php-mysql php-gd php-pdo   php-snmp cacti nagios nagios-plugins
或者也可以直接安裝centos官方推薦軟件庫:
下載rpm包
wget http://apt.sw.be/redhat/el5/en/i386/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

安裝DAG的PGP Key
rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt

驗證下載包的完整性
rpm -K rpmforge-release-0.3.6-1.el5.rf.*.rpm

安裝包
rpm -ivh rpmforge-release-0.3.6-1.el5.rf.*.rpm

參考網址:
http://doc.linuxpk.com/58083.html


安裝php-json
wget http://www.aurore.net/projects/php-json/php-json-ext-1.2.0.tar.bz2
tar xvjf php-json-ext-1.2.0.tar.bz2
cd php-json-ext-1.2.0
###初始化PHP環境
phpize
./configure
make&&make install#####

(如果提示沒有這個命令則首先要
yum -y install php-devel
如果還不行,說明你的編譯工具有問題,安裝一下就可以了
yum -y install autoconf
yum -y install automake
yum -y install libtool

查看有沒有安裝成功
find / -name '*json.so'
./usr/lib/php/modules/json.so
說明已經有了
vi /etc/php.ini
添加 include ('/etc/php.d/json.ini')

vi /etc/php.d/json.ini
內容如下:
extension=json.so
重啟httpd
apachectl graceful

到此所需要的軟件都安裝完畢

開始配置cacti
修改cacti訪問權限
vi /etc/httpd/conf.d/cacti.conf
如下:
<Directory /var/www/cacti/>
    DirectoryIndex index.php
    Options -Indexes
    AllowOverride all
    order deny,allow
    #deny from all
    #allow from 127.0.0.1
    allow from all
    AddType application/x-httpd-php .php
    php_flag magic_quotes_gpc on
    php_flag track_vars on
</Directory>

建立cacti數據庫和授權
mysqladmin create cacti
mysql>grant all privileges on cacti.* to cacti@localhost identified by 'cacti';
mysql>flush privileges;
mysql>exit;

導入數據:
cd /var/www/cacti
mysql -ucacti -p  cacti<cacti.sql

更改配置:
vi /var/www/cacti/include/config.php
$database_username = "cacti";
$database_password = "cacti";

vi /var/www/cacti/include/globle.php
$database_username = "cacti";
$database_password = "cacti";

制定任務計劃:
crontab -e -u cacti

*/5 * * * * php -f /var/www/cacti/poller.php >/dev/null 2>&1
重新啟動apache
service httpd restart

訪問http://yourserver/cacti/ 進行安裝,用戶名密碼都是admin
下載cacti插件管理器
wget http://mirror.cactiusers.org/downloads/plugins/cacti-plugin-0.8.7d-PA-v2.4.zip
unzip cacti-plugin-0.8.7d-PA-v2.4.zip
cd files-0.8.7d
cp -rf * /var/www/cacti/

導入數據:
cd ..
mysql -ucacti -pcacti cacti<pa.sql####也可以使用root

更改訪問路徑:
vi /var/www/cacti/include/globle.php
$config['url_path'] = '/cacti/';


配置nagios
我這里面沒有更進一步配置nagios,npc安裝完后nagios會自動啟動本機的一些監控項目,如果想要監控其他的主機,則需要單獨配置nagios,npc會予以展示
更改apache訪問權限使nagios可以正常使用
htpasswd -c /etc/nagios/htpasswd.users nagiosadmin

安裝ndoutils
wget http://sourceforge.net/project/downloading.php?group_id=26589&filename=ndoutils-1.4b7.tar.gz
tar zxvf ndoutils-1.4b7.tar.gz
cd ndoutils-1.4b7
./configure  --with-mysql-inc=/usr/include/mysql --with-mysql-lib=/usr/lib/mysql --enable-mysql --disable-pgsql --with-ndo2db-user=nagios --with-ndo2db-group=nagios
make clean
make
復制文件
cd src
cp ndomod-3x.o ndo2db-3x log2ndo file2sock /usr/bin/
cd ../config
cp ndo2db.cfg ndomod.cfg /etc/nagios/
配置文件
vi /etc/nagios/ndo2db.cfg

socket_name=/var/nagios/ndo.sock
db_name=cacti
db_prefix=npc_
db_user=cacti
db_pass=cacti
debug_level=1
debug_file=/var/nagios/ndo2db.debug

vi /etc/nagios/ndomod.cfg
output=/var/nagios/ndo.sock
buffer_file=/var/nagios/ndomod.tmp

vi /etc/nagios/nagios.cfg ##確認以下五項的值正確
check_external_commands=1
command_check_interval = -1    
event_broker_options = -1
broker_module = /usr/bin/ndomod-3x.o config_file=/etc/nagios/ndomod.cfg
process_performance_data=1


安裝npc
wget http://www.assembla.com/spaces/npc/documents/aUjAwmdW8r3BuPab7jnrAJ/download?filename=npc-2.0.0b.166.tar.gz
tar zxvf npc-2.0.0b.166.tar.gz
cd npc
拷貝內容到cacti plugins文件夾
cp npc /var/www/cacti/plugins/
添加插件識別
vi /var/www/cacti/include/globle.php
$plugins[] = 'npc';
到此 所有需要安裝的東西完畢

使用npc
進入你的cacti主頁面
在'User Management'中選擇'admin',在下邊'Realm Permissions'中鉤選'Plugin Management'。這時右側會出現'Plugin Management'連接,進去后在'uninstalled'中安裝npc,然后在'intalled'中enable npc,然后在回去admin的'Realm Permissions'中會出現'use npc',把它選中。
接著在右側欄目中選擇settings,點選npc的標簽
鉤選Remote Commands
Nagios Command File Path:      /var/nagios/rw/nagios.cmd
Nagios URL:                    http://yourserver/nagios/
save一下

 
可能出現的問題
1.npc頁面空白或者提示無法訪問npc.php
確認安裝并配置php-jsion正確
2.cacti無圖或者沒有數據
這個問題很多
參考http://www.youyongming.cn/blog/article.asp?id=790
3.出現類似Error: Missing Dependency: mysql = 5.0.45-7.el5 is needed by package mysql-server的情況
請刪除系統中已經安裝的包,例如已經安裝不同版本的mysql則出現上述問題
4.使用root登陸時候提示:Access denied for user 'root'@'localhost' (using password: NO/YES)
默認使用yum安裝mysql后,root密碼為空,出現這個問題從下面兩個點入手,以下部分內容參考網絡,感謝網友;
如果此方法行不通,那么參考我如下的方法(偶弄了半天,畢竟是菜鳥。。)
service mysqld stop
 mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
 mysql -uroot mysql
select user();查看返回的內容,如果如下所示:
+--------+
| user() |
+--------+
| root@  |
+--------+
則需更改root登陸主機,參考如下命令:
mysql> UPDATE mysql.user SET Host='%' WHERE Host=' ' ;
mysql>GRANT ALL PRIVILEGES ON *.* TO root@"%";
mysql> FLUSH PRIVILEGES ;
mysql>exit
service mysqld restart
登陸成功。至于這個問題是如何引起的,還不明確,懷疑和主機名有關系,知道的高手們請指點下,小弟mysql超級菜鳥
本站僅提供存儲服務,所有內容均由用戶發布,如發現有害或侵權內容,請點擊舉報
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
nagios+cacti整合文檔
Nagios 整合Cacti
手把手實現企業級開源監控軟件cacti nagios ntop整合(圖解)
【博文推薦】Cacti+Nagios監控平臺完美整合(2)
利用Rpmforge更新centos?yum源快速安裝nagios與cacti(實踐)
centos5.X yum安裝最新cacti(Version 0.8.7e)
更多類似文章 >>
生活服務
分享 收藏 導長圖 關注 下載文章
綁定賬號成功
后續可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點擊這里聯系客服!

聯系客服

主站蜘蛛池模板: 东乡县| 祥云县| 故城县| 开江县| 绥阳县| 怀远县| 旅游| 铅山县| 三江| 东乌珠穆沁旗| 库尔勒市| 广东省| 辛集市| 正阳县| 拜城县| 滕州市| 涪陵区| 遵义县| 灌阳县| 永德县| 龙井市| 肥城市| 罗平县| 黔西| 德清县| 文成县| 来凤县| 儋州市| 贡山| 阿巴嘎旗| 辰溪县| 团风县| 梅州市| 荆州市| 滕州市| 沂源县| 盱眙县| 石家庄市| 滦平县| 土默特左旗| 吉安市|