[Nagiosplug-devel] Anyone have experience with writing plugins in "expect"

martinus.nel at scarceskills.com martinus.nel at scarceskills.com
Fri Oct 15 07:43:52 CEST 2004


I would like to use the 'command="xxx"' prefix in my ssh keys, but how do I
get more than 1 command in there ?

At the moment I just used the 'from "xxxxx"' prefix for limiting from where
connections can come from.


sean finney <seanius at seanius.net> wrote: 
>On Wed, Oct 13, 2004 at 05:44:32PM +0800, Hsiu-Fen Hung wrote:
>> #!/usr/bin/expect
>> spawn ssh -l xxxx xx.xx.xx.xx "/opt/ecs/bin/almsummary"
>> expect -re "Password: "
>> send "xxxxxxxx\rr"
>just for the record, there's a much more secure way of doing this.
>create an ssh public/private keypair, let's say nagios_cmd_1 and
>nagios_cmd_1.pub.  create these keys without a passphrase, and then in
>nagios_cmd_1.pub, prefix the key with the text:
>now you have an ssh keypair which can be used in a script without
>any password, and it can only be used to execute the command you've
>specified in the public key.  put it in the .ssh/authorized_keys file
>on your destination machines.  i do something like this to check
>disk, load, and swap on all my machines.
>        sean
This e-mail message and any attachments are confidential and may also be a
privileged communication. It is intended solely for the person(s) to whom
it is addressed. If you are not the intended addressee of the message you
must take no action based on it. Please reply to this message to let us
know you received it in error and also delete the message from your system.
Internet e-mails are not necessarily secure and you should be mindful of
this when e-mailing us.

The contents of an attachment to this e-mail may contain software viruses
which could damage your own computer system. Whilst we have taken every
reasonable precaution to minimise this risk, we cannot accept liability for
any damage which you sustain as a result of software viruses. You should
carry out your own virus checks before opening the attachment.

More information about the Devel mailing list