Hi All, I solved my problem including enabling the user nagios to execute the command /sbin/hpasmcli as root user.
Thank all of you. Regards, ________________________________ Antonio Evangelista Especialista de Sistemas - Infraestrutura - TI DASA - www.dasa.com.br e-mail: antonio.evangeli...@dasa.com.br Tel.: (11) 4197-5450 Nextel: (11) 7719-4643 - 55*6013*626 -----Mensagem original----- De: Sean McAfee [mailto:smca...@collaborativefusion.com] Enviada em: terça-feira, 11 de maio de 2010 13:52 Para: Nagios Users List Assunto: Re: [Nagios-users] Nagios plugin problem using check_nrpe Antonio Fernando Evangelista wrote: > [r...@lnxaphmoa04 libexec]# /usr/local/nagios/libexec/check_teste.pl -s4 > -w80 -c85 > > OK: TEMPERATURA ATUAL: 30 C - THRESHOLD: 127 C > > *If I execute the script calling through the check_nrpe command:* > > [r...@lnxaphmoa04 libexec]# /usr/local/nagios/libexec/check_nrpe -H > localhost -c check_teste > > CRITICAL: TEMPERATURA ATUAL: C - THRESHOLD: C You're running the check as root, but NRPE executes checks as the nagios user. You'll probably be able to replicate the empty variables f you run: [r...@lnxaphmoa04 libexec]# sudo -H -u nagios /usr/local/nagios/libexec/check_teste.pl -s4 -w80 -c85 The solution is: 1. Add permissions in sudoers for the nagios user to exec that script as root without a password. The following line would allow the nagios user to do passwordless sudo on any plugins: nagios ALL=(root) NOPASSWD:/usr/lcoal/nagios/libexec/ 2. Change your nrpe.cfg to be: command[check_teste]=/path/to/sudobinary /usr/local/nagios/libexec/check_teste.pl -s 4 -w 80 -c 85 3. Restart npre -- Sean McAfee Senior Systems Engineer ------------------------------------------------------------------------------ _______________________________________________ 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 Esta mensagem, incluindo seus anexos, pode conter informações privilegiadas e/ou de caráter confidencial, não podendo ser retransmitida sem autorização do remetente. Se você não é o destinatário ou pessoa autorizada a recebê-la, informamos que o seu uso, divulgação, cópia ou arquivamento são proibidos. Portanto, se você recebeu esta mensagem por engano, por favor, nos informe respondendo imediatamente a este e-mail e em seguida apague-a. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. ------------------------------------------------------------------------------ _______________________________________________ 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