[Nagiosplug-devel] standard in must be a tty

Thomas Guyot-Sionnest dermoth at aei.ca
Tue Nov 11 00:25:13 CET 2008

Hash: SHA1

On 10/11/08 04:19 PM, Richard Edward Horner wrote:
> Sorry it took me so long to get back to you. I've been super busy.
> I can't actually run this because I don't have whatever this service
> is but it appears to be exactly what I suspected and that is that you
> have a su -c call in the init script. Actually, there are several but
> only one in the "status" section.
> I agree with Hans, you should rewrite the check status functionality
> of the init script into your plugin. It looks like it might need root
> privileges in which case I suggest you setup the call (or your script)
> to run via sudo with NOPASSWD set on the single command in
> /etc/sudoers.

Not sure it it will actually work, but if the only thing needed is a
tty, you could try compiling a custom check_by_ssh like this:

1. Prepare a nagios-plugins source tree (configure only, don't run make
yet, although it it's already compiled it doesn't matter)

2. Edit config.h, find the following line:

/* path to ssh binary */
#define SSH_COMMAND "/usr/bin/ssh"

Add " -tt" to it (-t is to allocate a tty, and specified twice it force
it even if there's no local tty) so if you have the same path as above,
that would be:

/* path to ssh binary */
#define SSH_COMMAND "/usr/bin/ssh -tt"

3. Run "make", and copy check_by_ssh to your plugins directory (you can
rename it too, like check_by_ssh_tty)

4. Try it (you'll need a key pair set-up for log-in, man ssh for more info).

Hope this helps

- --
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


More information about the Devel mailing list