<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta name=Generator content="Microsoft Word 14 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"Franklin Gothic Medium";
        panose-1:2 11 6 3 2 1 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-GB link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I see that you are talking to a XenServer host.  I am performing something similar.  What I have had to do to achieve results is to create a local Nagios user on the XenServer host which has SSH keys to allow the server Nagios user to connect and avoid using any root SSH keys which the Nagios user is unlikely to be able to read.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Once you have connected to the XenServer host check that the Nagios user can execute the commands you are running.  If you are simply looking at the dom0 as if it was a host and checking items such as cpu, memory or disk usage then you should not have a problem.  If you are executing XenServer xe commands then you will need to pass a username and password that has access to the XenServer to run these commands.  This will be root or another account that has been granted access.  You can store these values in the resources.cfg file and pass them in your command definition.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I have also noticed that your service definition is passing 4 arguments, where your command definition is only using 3 arguments and the hostaddress.  It would be worth checking to make sure that you are passing the correct arguments from your service and command definitions to your remote host.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>James<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Eduardo Montes de Oca S. [mailto:edrendar@gmail.com] <br><b>Sent:</b> 15 August 2012 18:52<br><b>To:</b> nagios-users@lists.sourceforge.net<br><b>Subject:</b> [Nagios-users] Issues with check_by_ssh<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>Hi list,<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>I have some issues with the plugin "check_by_ssh". In particular, there is one error:<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>When I run a shell script located in another server, from the Nagios server using the check_by_ssh plugin, I don't have any errors and I can see the result of the script, like this:<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><b><a href="mailto:root@TSM-SRV-V-114" target="_blank"><span style='font-size:9.0pt;font-family:"Helvetica","sans-serif";text-decoration:none'>root@nagioserver#</span></a></b><b><span style='font-size:9.0pt;font-family:"Helvetica","sans-serif"'> /usr/lib/nagios/plugins/check_by_ssh -l root -H "ipxenserver" -C /usr/lib/nagios/plugins/check_Xencpu<br>“OK:CPU%= 3”</span></b><o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Helvetica","sans-serif";color:#5E6066'>But, by any strange reason, when I configure the check for Nagios presents the results in its interface, I have the error:</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Helvetica","sans-serif";color:#5E6066'><img border=0 id="_x0000_i1025" src="cid:image001.png@01CD7B8F.4994F110" alt="Imágenes integradas 1"></span><o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Helvetica","sans-serif";color:#5E6066'>I have made the ssh authorization keys in both servers (Nagios and Xen), I configured the users, permissions,etc. And I can't to do this work it.</span><o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Helvetica","sans-serif";color:#5E6066'>Could someone help me solve this problem????</span><o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Helvetica","sans-serif";color:#5E6066'>This is a part of my definition files:</span><o:p></o:p></p></div><div><div><p class=MsoNormal style='line-height:15.0pt'><b><span style='font-size:9.0pt;font-family:"Helvetica","sans-serif"'>#XENServer<o:p></o:p></span></b></p></div></div><div><div><p class=MsoNormal style='line-height:15.0pt'><b><span style='font-size:9.0pt;font-family:"Helvetica","sans-serif"'>define command {<o:p></o:p></span></b></p></div><div><p class=MsoNormal style='line-height:15.0pt'><b><span style='font-size:9.0pt;font-family:"Helvetica","sans-serif"'>               command_name check_by_ssh_xentop<o:p></o:p></span></b></p></div><div><p class=MsoNormal style='line-height:15.0pt'><b><span style='font-size:9.0pt;font-family:"Helvetica","sans-serif"'>               command_line /usr/lib/nagios/plugins/check_by_ssh -l '$ARG1$' -H '$HOSTADDRESS$' -C '$ARG2$' -i '$ARG3$'<o:p></o:p></span></b></p></div><div><p class=MsoNormal style='line-height:15.0pt'><b><span style='font-size:9.0pt;font-family:"Helvetica","sans-serif"'>               }<o:p></o:p></span></b></p></div><div><div><p class=MsoNormal><b>#Hypervisor check</b><o:p></o:p></p></div><div><p class=MsoNormal><b>        define service{</b><o:p></o:p></p></div><div><p class=MsoNormal><b>                use                              generic-service</b><o:p></o:p></p></div><div><p class=MsoNormal><b>                host_name                  ORLANDO </b><o:p></o:p></p></div><div><p class=MsoNormal><b>                service_description     Hypervisor CPU</b><o:p></o:p></p></div><div><p class=MsoNormal><b>                check_command         check_by_ssh_xentop!root!ipxenserver!/usr/lib/nagios/plugins/check_Xencpu.sh!/root/.ssh/id_rsa!</b><o:p></o:p></p></div><div><p class=MsoNormal><b>                }</b><o:p></o:p></p></div></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Regards!<o:p></o:p></p></div><div><p class=MsoNormal><span style='color:#888888'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='color:#888888'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='color:#888888'>-- <o:p></o:p></span></p></div><div><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Franklin Gothic Medium","sans-serif";color:#888888'>IC.</span></b><b><span style='font-size:10.0pt;font-family:"Franklin Gothic Medium","sans-serif";color:#888888'> Eduardo Montes de Oca Sánchez<br></span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:#888888'>Skype: edrendar<br>Gmail: <a href="mailto:edrendar@gmail.com" target="_blank">edrendar@gmail.com</a><br>MSN: <a href="mailto:ed_montesdeoca@hotmail.com" target="_blank">ed_montesdeoca@hotmail.com</a><br>Movil: 5523419886</span><span style='color:#888888'><o:p></o:p></span></p></div><p class=MsoNormal><span style='color:#888888'><a href="https://linuxcounter.net/cert/549074.png" target="_blank">https://linuxcounter.net/cert/549074.png</a></span><o:p></o:p></p></div></div></div></div></body></html>