On 09/14/2012 08:09 PM, Mike Lindsey wrote: > I'm typically used to seeing this kind of error code for a missing > plugin, but I've got a device that is accepting tcp connections and then > due to a local misconfiguration, immediately closing them. > > But rather than a normal critical I'm getting: > """ > (Return code of 141 is out of bounds) > """ >
SIGPIPE has sig id 13. When a program catches a signal, it returns the sigid as a negative number, but the field for the exit status is unsigned, so it gets translated to 128 + sigid instead. As I read it back, I realize that doesn't exactly make supersense to anyone not familiar with integer math as computers do it, but I can assure you that's the reason. When you get exit code 127 or 126 (below 128, but high), it's because execve() has thrown an error and the shell is trying to signal it the only way you can. It does that by returning 0x80 and subtracting the error number. 128 is 0x80 and would be a negative number (which are reserved for signal-triggered exits), so 127 is 0x80 - EPERM, which means the Nagios user lacks execute permissions for the file. 126 is 0x80 - ENOENT, which means the plugin doesn't exist in the path specified, or one of the elements in the path leading to the plugin is missing. There are others too. Check out "man 2 execve" for all the details. > When run by hand I have: > """ > root@ops-mon-nagios3 /usr/local/nagios/libexec $ ./check_http -H > device.domain.com -w "10" -c "20" -S -p "83" -f follow > CRITICAL - Cannot make SSL connection > root@ops-mon-nagios3 /usr/local/nagios/libexec $ echo $? > 141 > """ > > write(1, "CRITICAL - Cannot make SSL conne"..., 39) = 39 > write(3, "\200w\1\3\1\0N\0\0\0 > \0\0009\0\0008\0\0005\0\0\26\0\0\23\0\0\n\7\0\300"..., 121) = -1 EPIPE > (Broken pipe) > --- SIGPIPE (Broken pipe) @ 0 (0) --- > +++ killed by SIGPIPE +++ > And there's the SIGPIPE. Case closed. -- Andreas Ericsson andreas.erics...@op5.se OP5 AB www.op5.se Tel: +46 8-230225 Fax: +46 8-230231 Considering the successes of the wars on alcohol, poverty, drugs and terror, I think we should give some serious thought to declaring war on peace. ------------------------------------------------------------------------------ Got visibility? Most devs has no idea what their production app looks like. Find out how fast your code is with AppDynamics Lite. http://ad.doubleclick.net/clk;262219671;13503038;y? http://info.appdynamics.com/FreeJavaPerformanceDownload.html _______________________________________________ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null