NagiosXI docker container: return code of 13 is out of bounds

257 Views Asked by At

I continually receive error in title. (see picture) nagios image

However, I have given my sh script all permissions (chmod 777 with nagios as owner). My script also works fine on a nagios core container but with a nagios xi docker container, it messes up.

Here is the permissions on my script in the picture for proof: permissions

The command also works on the the UI if I manually call it in the service management section of nagios.

Command also works using nagios user to run script nagios user running script

Docker container I am using: https://hub.docker.com/r/mavenquist/nagios-xi

I've tried using this post's solutions: Nagios: return code of 13 is out of bounds

1

There are 1 best solutions below

8
pzkpfw On

It's not entirely possible to answer your question completely with the information provided, but here are some pointers:

  • Never set 777 permissions. In your case the owner of the script is already "nagios:nagios" so a more reasonable permission would be 550 -- i.e. allow the nagios user and group to read and execute the file, but not modify it (why would it).

  • The error you're getting (return code 13) means that 1.sh for some reason is returning 13. Why is impossible to know without inspecting the script, but you can try to run the plugin as nagios and inspect the output, hopefully the script is well written enough to inform you of what the error is:

# su -c "/your/plugin -exactly -as -configured" nagios

A general rule for troubleshooting Nagios is that whatever you see in the GUI will be the exact same thing as what happens when you run the script manually as the nagios user, so it's a good way to figure out what is happening.