如果我們在命令行中運行以下命令,它工作正常。但是,當我們從Nagios的運行這個命令基礎的工具,它與下面的錯誤failes: -REST API不起作用
java -jar /opt/monitor/nagios/notify/REST/RestInterface.jar
/opt/monitor/nagios/notify/REST/settings.xml "2015-10-20 12:57:11" L
結果代碼:1個
錯誤輸出:
java.io.IOException: Couldn't get lock for RestInterface.log
at java.util.logging.FileHandler.openFiles(FileHandler.java:389)
at java.util.logging.FileHandler.(FileHandler.java:363)
at com.google.nagios.notify.RestInterface.loggerInit(Unknown Source)
at com.google.nagios.notify.RestInterface.main(Unknown Source)
Oct 20, 2015 12:57:11 PM com.google.nagios.notify.RestInterface logToOS
SEVERE: null
java.io.IOException: Cannot run program "EVENTCREATE": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
at java.lang.Runtime.exec(Runtime.java:617)
at java.lang.Runtime.exec(Runtime.java:450)
at java.lang.Runtime.exec(Runtime.java:347)
at com.google.nagios.notify.RestInterface.logToOS(Unknown Source)
at com.google.nagios.notify.RestInterface.loggerInit(Unknown Source)
at com.google.nagios.notify.RestInterface.main(Unknown Source)
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.(UNIXProcess.java:186)
at java.lang.ProcessImpl.start(ProcessImpl.java:130)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
... 6 more
Exception in thread "main" java.lang.NullPointerException
at com.google.nagios.notify.RestInterface.loggerInit(Unknown Source)
at com.google.nagios.notify.RestInterface.main(Unknown Source)
你正在使用哪個操作系統? –
Redhat Linux 6.5 – ErAB
REST API正在使用命令行,但是當此命令從GUI運行時,它不起作用。 – ErAB