Wget : No such file or directory

Hi everyone,

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.

A User problem maybe?

Any help is appreciated!
Thank you.

Did you still checked the user permissions of the icinga user? SELinux? Firewall?

it’s weird… I listed all my users and I don’t have an icinga one.

I also don’t have a icinga2-selinux package (ubuntu).

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. :slight_smile:

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 got Permission denied with user nagios. I guess that’s it.

Is there some doc about giving it more permission?

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.

Do you need that file afterwards? If not why don’t you store it in /dev/null?

@mcktr Thank you that’s what I did instead. Looks good.

@rsx Actually no we don’t need it. I tried to specify a folder, with no luck. Thank you for your suggestion!