Hello!
Just getting started on the Nagios journey and have made a check that executes a jar file and then displays the output. The jar also writes a file with the same output which will be used by an event handler.
The check fails when it tries to write the file on the nagios server (I'm assuming this is because the nagios user doesn't have write permission). If I run the same jar on the nagios server as a privileged user everything works as expected.
Has anyone tried something like this. A suggestion on how to fix this or a different way to approach this is greatly appreciated!
Thank you,
Darran
Writing output to disk during a check
Re: Writing output to disk during a check
Where do you have it writing to? Can you change the permissions on that directory, or use one with the proper permissions?
Former Nagios Employee.
me.
me.
Re: Writing output to disk during a check
I have it writing to a specific directory that is chmod 777, but it still seems that the file is unable to be written. I'm wondering if it is a JVM issue. Here is the command that is being executed via a service definition:
java -jar /etc/nagios3/objects/services/gaphound/GapHound.jar '$ARG1$' '$ARG2$'
Thank you!
java -jar /etc/nagios3/objects/services/gaphound/GapHound.jar '$ARG1$' '$ARG2$'
Thank you!
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Writing output to disk during a check
Can you do:
This needs to be the location where the output is written to.
Code: Select all
ls -la /location/of/tmp/filesAs of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.