Could not open command file '/usr/local/nagios/var/rw/nagios.cmd' for update!
Could not open command file '/usr/local/nagios/var/rw/nagios.cmd' for update!
透過web介面修改某個服務時報錯
例如對某個服務進行臨時安排其執行時間,或者不讓它發警告,web頁面上都有這樣的設定.但是常常會有錯誤資訊如下:
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.
關於這部分在nagios.cfg中有下面的內容
# 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的執行使用者要有對檔案寫的許可權.許可權應該設定在目錄上,因為每次檔案的內容被處理後檔案就會被刪掉
command_file=/usr/local/nagios/var/rw/nagios.cmd
本來將apache2執行的使用者apache加到nagios組就應該可以了的
但是這個卻不行,就將rw這個目錄及其子檔案的許可權改了777,這樣就可以了.
後來發現nagios.cmd的許可權還是自動變回了rw-rw----,但是發命令沒有受到影響,不報錯了.(難道是用重啟nagios,讓其生效)
比如有使用者:lyon,現想要將lyon加入到dba組中。
如果是剛開始建立使用者,可以透過指定-g來指定使用者的組(-G引數限制使用者唯一的組)
但是現在使用者已經建好,只是要將lyon使用者加到dba組中。
一個很簡單的問題,卻不知道怎麼做。google了下,直接編輯/etc/group檔案
找到指定的要增加到的組的名稱,如dba組,然後在最後的使用者列表裡面新增即可。
如原來是dba:x:504:oracle,則新增後如下:dba:x:504:oracle,lyon。
/etc/group的各列含義:
它總共分四個部分:
[組名]:[密碼域]:[GID]:[組員列表]
透過web介面修改某個服務時報錯
例如對某個服務進行臨時安排其執行時間,或者不讓它發警告,web頁面上都有這樣的設定.但是常常會有錯誤資訊如下:
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.
關於這部分在nagios.cfg中有下面的內容
# 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的執行使用者要有對檔案寫的許可權.許可權應該設定在目錄上,因為每次檔案的內容被處理後檔案就會被刪掉
command_file=/usr/local/nagios/var/rw/nagios.cmd
本來將apache2執行的使用者apache加到nagios組就應該可以了的
但是這個卻不行,就將rw這個目錄及其子檔案的許可權改了777,這樣就可以了.
後來發現nagios.cmd的許可權還是自動變回了rw-rw----,但是發命令沒有受到影響,不報錯了.(難道是用重啟nagios,讓其生效)
比如有使用者:lyon,現想要將lyon加入到dba組中。
如果是剛開始建立使用者,可以透過指定-g來指定使用者的組(-G引數限制使用者唯一的組)
但是現在使用者已經建好,只是要將lyon使用者加到dba組中。
一個很簡單的問題,卻不知道怎麼做。google了下,直接編輯/etc/group檔案
找到指定的要增加到的組的名稱,如dba組,然後在最後的使用者列表裡面新增即可。
如原來是dba:x:504:oracle,則新增後如下:dba:x:504:oracle,lyon。
/etc/group的各列含義:
它總共分四個部分:
[組名]:[密碼域]:[GID]:[組員列表]
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29500582/viewspace-1685003/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Error: Could not load module '/usr/local/nagios/bin/ndo2ErroriOS
- brew update /usr/local is not writable
- Check mod for temporary file : /usr/local/centreon/var/lib/centplugins/Plugin
- mac下/usr/local/bin No such file or directory問題解決Mac
- macOSmkdir:/usr/var:OperationnotpermittedMacMIT
- Linux下的一些重要目錄/proc, /sys, /SElinux, /bin, /usr/lib, /usr/local, /var, /tmp/etcLinux
- Ubuntu Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)UbuntuAPTAI
- nginx: [error] open() “/var/run/nginx/nginx.pid“ failed (2: No such file or directory)NginxErrorAI
- /bin、/sbin、/usr/bin、/usr/sbin、/usr/local/sbin放置可執行檔案的區別
- su - root could not open sessionSession
- chown: /usr/local: Operation not permitted問題解決MIT
- 無法使用make prefix=/usr/local/git allGit
- [ERROR] mysqld: Can‘t open shared library ‘/usr/local/mysql/lib/plugin/validate_password.so‘ (errno:ErrorMySqlPlugin
- LRM-00109: could not open parameter file '/u01/.../dbs/initshdb.ora'
- Warning:The /usr/local/mysql/data directory is not owned by the 'mysql' or '_mysql'MySql
- configure:error:Cannotfindlibmysqlclientunder/usr/local/mysql.ErrorIBMMySqlclient
- 【jenkins】/usr/bin/env: php: No such file or directoryJenkinsPHP
- 將/usr/local/lib加入到預設庫
- [Nagios] Error: Template timman specified in contact definition could not beiOSError
- Nagios監控mysql從庫報錯:libmysqlclient.so.18: cannot open shared object fileiOSMySqlIBMclientObject
- -bash: /usr/local/bin/pod: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby: b...Framework
- su的時候報:could not open sessionSession
- mysql起動報錯TheserverquitwithoutupdatingPIDfile/usr/local/mysql/data/MySqlServerUI
- Could not find first log file name in binary log index fileIndex
- MySQL server PID file could not be found!MySqlServer
- WPF open image and print as pdf file
- code EACCESnpm ERR! syscall renamenpm ERR! path /usr/local/bin/webpack errno -13NPMWeb
- /usr/bin/xauth: error in locking authority file錯誤Error
- Linux中/usr和/var目錄詳解 -- 轉自網路Linux
- git pull報“unable to update local ref”解決方案Git
- vue3 Could not find a declaration file for moduleVue
- Last_SQL_Error: Could not execute Update_rows eventASTSQLError
- Php cli模式下執行報錯/usr/bin/php: /usr/local/lib/libxml2.so.2: no version information available (required by /usr/bin/php)PHP模式XMLORMAIUI
- open_basedir() restrictijon in effect. FIle()REST
- ftp 報錯 550 Failed to open fileFTPAI
- “no source“: Error: #5: cannot open source input file “C:\Users\xxx\AppData\Local\Temp\p4228: PermiErrorAPP
- PRVF-0002Could not retrieve local nodename的解決方法
- psql: error: could not connect to server: No such file or directorySQLErrorServer