ndoutils數(shù)據(jù)不同步

最近倒騰了一下ndoutils這個工具,想把nagios的數(shù)據(jù)都倒進(jìn)MySQL里,方便以后多個nagios主機(jī)的數(shù)據(jù)集中存儲到一個數(shù)據(jù)庫里,再取出來做數(shù)據(jù)對比和分析就很方便了。

創(chuàng)新互聯(lián)公司專注為客戶提供全方位的互聯(lián)網(wǎng)綜合服務(wù),包含不限于成都網(wǎng)站設(shè)計(jì)、成都網(wǎng)站建設(shè)、薩迦網(wǎng)絡(luò)推廣、小程序開發(fā)、薩迦網(wǎng)絡(luò)營銷、薩迦企業(yè)策劃、薩迦品牌公關(guān)、搜索引擎seo、人物專訪、企業(yè)宣傳片、企業(yè)代運(yùn)營等,從售前售中售后,我們都將竭誠為您服務(wù),您的肯定,是我們最大的嘉獎;創(chuàng)新互聯(lián)公司為所有大學(xué)生創(chuàng)業(yè)者提供薩迦建站搭建服務(wù),24小時(shí)服務(wù)熱線:18980820575,官方網(wǎng)址:muchs.cn

安裝過程很順利,采用源碼安裝,make完之后直接拷貝配置文件和bin文件到對應(yīng)目錄就可以了,網(wǎng)上能找到很多類似的教程。

最后運(yùn)行的時(shí)候發(fā)現(xiàn)nagios的數(shù)據(jù)只有部分導(dǎo)入了數(shù)據(jù)庫,很多表都是空的,包括配置文件的數(shù)據(jù),實(shí)時(shí)的主機(jī)狀態(tài)和服務(wù)狀態(tài)的table也是數(shù)據(jù)不全。在配置上折騰了很長時(shí)間,反復(fù)對比過跟別人和官方的配置也找不出問題,debug文件也沒多少內(nèi)容可看,都是一些mysql的執(zhí)行語句。

最后發(fā)現(xiàn)/var/log/messages文件里有這么一句,然后順著這提示來找解決方案,最終解決了問題。

這里分析一下:

ndo2db: Warning: Retrying message send. This can occur because you have too few messages allowed or too few total bytes allowed in message queues. You are currently using 64 of 16 messages and 65536 of 65536 bytes in the queue. See README for kernel tuning options.

上面這警告出現(xiàn)在系統(tǒng)日志里,然后網(wǎng)上也能搜出匹配的解決方案出來。

比如:http://bbs.ixdba.net/viewthread.php?tid=633

其實(shí)在源代碼文件夾里的README文件里最下面的內(nèi)容就有提及了,我在安裝的時(shí)候配置完后直接就急著啟動,而沒有注意需要調(diào)系統(tǒng)參數(shù)

README文件里提到如下:

************************
TUNING KERNEL PARAMETERS
************************

NDOUTILS uses a single message queue to communicate between the broker
module and the NDO2DB daemon. Depending on the operating system, there
may be parameters that need to be tuned in order for this communication
to work correctly. The discussion below applies specifically to Linux,
but may apply generally to other Unices as well.

There are three Linux kernel parameters that determine the resources
provided to the messaging subsystem:
    * kernel.msgmax is the maximum size of a single message in a
        message queue
    * kernel.msgmni is the maximum number of messages allowed in any
        one message queue
    * kernel.msgmnb is the total number of bytes allow in all messages
        in any one message queue

To see the current values for any of these parameters, cat
/proc/sys/kernel/msg{max|mni|mnb}.

In order for NDOUTILS to work at all, kernel.msgmax must be greater than
the size of the queue_msg struct (currently 1026 bytes). Most Linux
distributions set kernel.msgmax to a default of 65536.

If there are insufficient resources for sending messages between the
broker and the daemon, you will see an entry similar to the following
in your logs. (This is logged via the syslog facility, using the level
LOG_ERR and the default facility.)

    ndo2db: Warning: Retrying message send. This can occur because
    you have too few messages allowed or too few total bytes
    allowed in message queues. You are currently using 16 of 16
    mesages and 65536 of 65536 bytes in the queue.  See README for
    kernel tuning options.

If you see this entry, the message will likely eventually be sent,
but retrying uses system resources, and there is the possibility that
more messages will queued than can be handled, causing the broker
module to stall.

If you are close to or have exceeded the number of messages, you may
need to increase kernel.msgmni. If you are close to or have exceeded
the number of bytes in the queue, you may need to increase
kernel.msgmnb. In some cases you may need to increase both.

A conservative approach would be to double the necessary value, stop
and restart both the NDO2DB daemon and Nagios Core, and watch for any
further messages. Note that if NDO2DB is started after Nagios Core,
you may see the warning above as the broker module first attempts to
flush its backlog of messages.

To increase a value, echo the value to /proc/sys/kernel/msgmni or
/proc/sys/kernel/msgmnb as appropriate.

For example, to increase the number of messages allowed in the queue
to 32, use the command 'echo 32 > /proc/sys/kernel/msgmni' (without
the quotes).

Once you have determine the correct parameters, you can make them
permanent by editing /etc/sysctl.conf. Add or update the line of
the form 'kernel.msg{mni|mnb} = <value>' with the value(s) determined
above. The next time the system is booted, the values of the
parameters in /etc/sysctl.conf will be loaded.

解決方法:

在/etc/sysctl.conf里加上

# Controls the default maxmimum size of a mesage queue
kernel.msgmnb = 131072000

# Controls the maximum size of a message, in bytes
kernel.msgmax = 131072000

#kernel.msgmni is the maximum number of messages allowed in any one message queue
kernel.msgmni = 65536000

標(biāo)題名稱:ndoutils數(shù)據(jù)不同步
文章鏈接:http://muchs.cn/article0/ishjoo.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供域名注冊面包屑導(dǎo)航、標(biāo)簽優(yōu)化定制網(wǎng)站服務(wù)器托管、靜態(tài)網(wǎng)站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

外貿(mào)網(wǎng)站制作