如果我们在命令行中运行以下命令,它工作正常。但是,当我们从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