I would like to create a check in order to verify that a certain file can be downloaded. It’s working great when I run it manually but when I put it in Icinga … it’s giving me a “No such file or directory”
Here the explicit command I wrote in Icinga :
command = ["/usr/bin/wget http://servername/robots.txt -O /etc/icinga2/conf.d/tmp"]
I even tried creating a specific folder as I thought this could be the problem…no luck.
On Debian/Ubuntu the Icinga 2 daemon runs under the nagios user for historical reasons.
May I ask why you use wget instead of the check_http plugin provided by the monitoring plugins package, the check_http plugin is also included int he ITL.
What are you trying to check, respectively what should be the check result? Maybe there is another way to check this with check plugins that are already there.
I did see the Nagios user… that’s what I thought. I’ll try that.
The reason we want to use wget is simply to make sure users are able to download files from the server. I actually want to put the “–delete-after” option in order to avoid clutter.
I would do this with the check_http plugin. If the check plugin can fetch the robots.txt a wget should do it as well, there shouldn’t be a difference in terms of connection capability.
The permissions denied error maybe comes from the directory you are using /etc/icinga2/conf.d/tmp. Try a different directory where the nagios user has permissions to write.