check_by_ssh -C & different user

Assaf Flatto assaf.flatto at ssp-intl.com
Thu Sep 17 17:59:32 CEST 2009



On Thursday 17 September 2009 12:42:33 Alex Huth wrote:
> Hi!
>
> Even when it is not directly a nagios topic, i hope someone can help me. I
> have to execute with a eventhandler a command remote with another user as
> the user for nagios.
>
> Let's say the nagios user is aaa, the user to login remote by ssh is user
> bbb and the user who can execute the init script is also user bbb. The
> check_by_ssh command i have so far is the following:
>
> /adm/libexec/nagios/check_by_ssh -H xxx -l bbb -i
> /adm/etc/nagios/id_nagios -C '/etc/init.d/saprouter.sh restart'
>
> The process on the remote machine is running as nobody and must be killed
> to stop the service.
> So finally the user to execute a command has to be the same user as the ssh
> login user. How can i do that?
>

have you looked at the options of sudo ?
sudo allows a permitted user to execute a command as the superuser or another user, as specified in 
the sudoers file .




-- 
Assaf Flatto
SSP Ops Team
Linux System Administrator
169 Euston Road, London, NW1 2AE





IMPORTANT . this email and the information in it may be confidential, legally
privileged and/or protected by law. It is intended solely for the use of the
person to whom it is addressed. If you are not the intended recipient, please
notify the sender immediately and do not disclose the contents to any other
person, use it for any purpose, or store or copy the information in any medium.
Please also delete all copies of this email and any attachments from your
system.

We cannot guarantee the security or confidentiality of email communications. We
do not accept any liability for losses or damages that you may suffer as a
result of your receipt of this email including but not limited to computer
service or system failure, access delays or interruption, data non-delivery or
mis-delivery, computer viruses or other harmful components.

Copyright in this email and any attachments belong to Select Service Partner UK
Limited. Should you communicate with anyone at Select Service Partner UK Limited by
email, you consent to us monitoring and reading any such correspondence.

Nothing in this email shall be taken or read as suggesting, proposing or
relating to any agreement concerted practice or other practice that could
infringe UK or EC competition legislation.

Select Service Partner UK Limited is a company registered in England and Wales
(company number 05687183) whose registered office is at 1 The Heights, Brooklands, Weybridge. Surrey. KT13 0NY
 
 

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Nagios-users mailing list
Nagios-users at 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





More information about the Users mailing list