I am having issues with the commands.cfg file and JAVA_ABS_PATH. I tried creating /etc/sysconfig/Nagios file and restarting Nagios to set the following environment variables.
export JAVA_HOME=/opt/ds/java/jdk1.8.0_162
export JRE_HOME=/opt/ds/java/jdk1.8.0_162/jre
export JAVA_ABS_PATH=/opt/ds/java/jdk1.8.0_162/bin/java
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:$CLASSPATH
I don't want to put commands.cfg in static as i want to be able to update it thru the web interface.
The following command fails when JAVA_ABS_PATH is not set. (No output on stdout) stderr: execvp(JAVA_ABS_PATH, ...) failed. errno is 2: No such file or directory)
define command {
command_name check_xi_java_as
command_line JAVA_ABS_PATH -Djava.class.path=$ARG2$:$USER1$/check_jvm.jar GenericASCheck $ARG1$
}
If I change the command like the following it works fine in the Web Interface.
define command {
command_name check_xi_java_as
command_line /opt/ds/java/jdk1.8.0_162/bin/java -Djava.class.path=$ARG2$:$USER1$/check_jvm.jar GenericASCheck $ARG1$
}
Is there any method to get commands.cfg to pick up variables so this is not overwritten every time when you apply configuration in the web interface? /etc/sysconfig/Nagios doesn't seem to work.
Thanks for any response.
Nagios XI 5.6.6 /etc/sysconfig/nagios not working
-
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Nagios XI 5.6.6 /etc/sysconfig/nagios not working
Hello @rwbata,
You can set your own variables using macros, and use those in you check commands. See the guide below.
Understanding User Macros
Let us know if you have any questions.
You can set your own variables using macros, and use those in you check commands. See the guide below.
Understanding User Macros
Let us know if you have any questions.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Nagios XI 5.6.6 /etc/sysconfig/nagios not working
Thanks for the response.
-
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Nagios XI 5.6.6 /etc/sysconfig/nagios not working
Your welcome.Thanks for the response.
Let us know if you have any questions.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!