nagios插件輸出

做爲Nagios插件的腳本或執行程序必須(至少)要作兩件事: 退出時給出幾種可能的返回值中的一個; 至少要給出一條輸出內容到標準輸出設備(STDOUT)。 Nagios用插件的返回值來生成主機或服務的狀態。下表裏列出了合法的返回值以及對應的服務或主機狀態。 插件返回值        服務狀態                     主機狀態 0                     正常(OK)                     運行(UP) 1                     警告(WARNING)           運行(UP)或宕機(DOWN)/不可達(UNREACHABLE)* 2                     緊急(CRITICAL)            宕機(DOWN)/不可達(UNREACHABLE) 3                     未知(UNKNOWN)          宕機(DOWN)/不可達(UNREACHABLE) 特定插件輸出: 最小狀況下,插件要返回一行文本輸出。自Nagios 3版本起,插件能夠返回多行輸出文本。 插件能夠返回性能數據以讓外部應用來作後序處理。 文本輸出和性能數據中間要以"|"來分隔 例如 DISK OK - free space: / 4466MB (70%); | /=2648MB;6022;6022;0;6022" "|"以前保存在$SERVICEOUTPUT$宏裏 "|"以後的是性能數據,保存在$SERVICEPERFDATA$宏裏 The Nagios daemon doesn't directly process performance data, so it doesn't really care what the performance data looks like.  There aren't really any inherent limitations on the format or content of the performance data. However, if you are using an external addon to process the performance data (i.e. PerfParse), the addon may be expecting that the plugin returns performance data in a specific format. C check the documentation that comes with the addon for more information. 簡單的說就是:對於性能數據nagios並不關心它是什麼,格式具體是什麼;性能數據的格式由須要處理這些數據的插件來決定。 nagios3之後,插件能夠返回多行文本: TEXT OUTPUT | OPTIONAL PERFDATA LONG TEXT LINE 1 LONG TEXT LINE 2 ... LONG TEXT LINE 部分保存在$LONGSERVICEOUTPUT$宏裏。
相關文章
相關標籤/搜索