caci 與 nagios 一些總結 【一】

來源:互聯網
上載者:User

標籤:style   blog   http   color   os   io   ar   strong   檔案   

1.首先請檢查ndo2db的進程是不是二個 

nagios 16825 0.0 0.1 6784 396 ? Ss 19:05 0:00 /usr/local/nagios/bin/ndo2db -c /usr/l 
nagios 17032 0.0 0.3 6784 1268 ? S 19:09 0:00 /usr/local/nagios/bin/ndo2db -c 
2、檢查nagios.log日誌看看最後有沒有 
could not safely copy module ‘/usr/local/nagios/bin/ndomod-3x.o‘ 這樣的錯誤 
如果是下面這樣是正確的 
ndomod: NDOMOD 1.4b7 (10-31-2007) Copyright (c) 2005-2007 Ethan Galstad ([email protected]) 
[1272020945] ndomod: Successfully connected to data sink. 4897 queued items to flush. 
[1272020951] ndomod: Successfully flushed 4897 queued items to data sink. 
[1272020951] Event broker module ‘/usr/local/nagios/bin/ndomod-3x.o‘ initialized successfully. 
上面只是檢查工作,解決方案如下 
1、安裝nagios3.0 如果是2.9的朋友可以升級安裝、升級安裝方法的方法很簡單

#cd /usr/local/ 
#cp -r nagios/ nagios2.9 
#cd /etc/init.d/ 
#cd nagios nagios2.9 
#cp nagios nagios2.9 
#tar -zvxf nagios-3.0.3.tar.gz 
#cd nagios-3.0.3 
# ./configure --with-command-group=nagios 
#make all 
#make install 
#/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg 
可能會報comments downtime警告資訊一個錯誤critical 
vi /usr/local/nagios/etc/nagios.cfg 
#comment_file=/usr/local/nagios/var/comments.dat 加上# 
#downtime_file=/usr/local/nagios/var/downtime.dat 加上#

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg 在執行就不會報了 
然後在執行下面 
cd /usr/local/nagios/var/ 
cat comments.dat >>retention.dat 
cat downtime.dat >>retention.dat 
critical錯誤解決 
check_result_buffer_slots=4096 加上# 
service nagios restart 
2、ndoutils-1.4b7安裝此版塊、其他版本可能會出程式問題、安裝方法如下 
tar zxvf ndoutils-1.4b7.tar.gz 
cd ndoutils-1.4b7 
./configure --with-mysql-lib=/usr/lib/mysql/ --with-mysql-inc=/usr/include/mysql/ 
cp ndomod-3x.o /usr/local/nagios/bin/ndomod-3x.o 
cp ndo2db-3x /usr/local/nagios/bin/ndo2db 
cp ndo2db.cfg /usr/local/nagios/etc/ 
cp ndomod.cfg /usr/local/nagios/etc/ 
進入拷貝的目錄給檔案加入到nagios使用者組 
chown nagios:nagios ndo2db.cfg ndomod.cfg 
chown nagios:nagios ndomod-3x.o ndo2db

然後修改ndo2db.cfg ndomod.cfg設定檔 
cat /usr/local/nagios/etc/ndo2db.cfg |grep -v ‘^#‘|sed /^$/d 
ndo2db_user=nagios 
ndo2db_group=nagios 
socket_type=tcp 
socket_name=/usr/local/nagios/var/ndo.sock 
tcp_port=5668 
db_servertype=mysql 
db_host=127.0.0.1 
db_port=3306 
db_name=cacti 
db_prefix=npc_ 
db_user=cactiuer 
db_pass=cactiuser 
max_timedevents_age=1440 
max_systemcommands_age=10080 
max_servicechecks_age=10080 
max_hostchecks_age=10080 
max_eventhandlers_age=44640 
debug_level=1 
debug_verbosity=1 
debug_file=/usr/local/nagios/var/ndo2db.debug 
max_debug_file_size=1000000

cat /usr/local/nagios/etc/ndomod.cfg |grep -v ‘^#‘|sed /^$/d 
instance_name=default 
output_type=tcpsocket 
output=127.0.0.1 
tcp_port=5668 
output_buffer_items=5000 
buffer_file=/usr/local/nagios/var/ndomod.tmp 
file_rotation_interval=14400 
file_rotation_timeout=60 
reconnect_interval=15 
reconnect_warning_interval=15 
data_processing_options=-1 
config_output_options=2

最後看nagios.cfg最後一行設定檔是否正確 
broker_module=/usr/local/nagios/bin/ndomod-3x.o config_file=/usr/local/nagios/etc/ndomod.cfg 
這行要和檔案和路徑對應好(===我屬於這種情況===)

修改完成後重啟ndo2db 
kill ndo2db啟動並執行進程 
/usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg 然後執行重啟 
ps aux 
nagios 16825 0.0 0.1 6784 396 ? Ss 19:05 0:00 /usr/local/nagios/bin/ndo2db -c 
nagios 17032 0.0 0.3 6784 1268 ? S 19:09 0:00 /usr/local/nagios/bin/ndo2db -c 

 參考:http://blog.sina.com.cn/s/blog_645e2f0b010135tf.html

caci 與 nagios 一些總結 【一】

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.