Nagios WEB修改服務(wù)
nagios web修改服務(wù)
通過(guò)web界面修改某個(gè)服務(wù)時(shí)報(bào)錯(cuò)。
例如對(duì)某個(gè)服務(wù)進(jìn)行臨時(shí)安排其執(zhí)行時(shí)間,或者不讓它發(fā)警告,web頁(yè)面上都有這樣的設(shè)置.但是常常會(huì)有錯(cuò)誤信息如下:
- Could not open command file ‘/usr/local/nagios/var/rw/nagios.cmd’ for update!
- The permissions on the external command file and/or directory may be incorrect. Read the FAQs on how to setup proper permissions.
- An error occurred while attempting to commit your command for processing.
關(guān)于這部分在nagios.cfg中有下面的內(nèi)容
- # EXTERNAL COMMAND FILE
- # This is the file that Nagios checks for external command requests.
- # It is also where the command CGI will write commands that are submitted
- # by users, so it must be writeable by the user that the web server
- # is running as (usually ‘nobody’). Permissions should be set at the
- # directory level instead of on the file, as the file is deleted every
- # time its contents are processed.
這段話的核心意思是apache的運(yùn)行用戶要有對(duì)文件寫(xiě)的權(quán)限.權(quán)限應(yīng)該設(shè)置在目錄上,因?yàn)槊看挝募膬?nèi)容被處理后文件就會(huì)被刪掉
- command_file=/usr/local/nagios/var/rw/nagios.cmd
將apache2運(yùn)行的用戶apache加到nagios組就應(yīng)該可以了的。這樣Nagios WEB修改服務(wù)就成功了。
【編輯推薦】