<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 http-equiv=Content-Type content="text/html; charset=windows-1252"><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;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.E-MailFormatvorlage17
        {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:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:878978358;
        mso-list-type:hybrid;
        mso-list-template-ids:-107950542 -18159346 67567641 67567643 67567631 67567641 67567643 67567631 67567641 67567643;}
@list l0:level1
        {mso-level-text:"%1\)";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ascii-font-family:Calibri;
        mso-fareast-font-family:Calibri;
        mso-hansi-font-family:Calibri;
        mso-bidi-font-family:"Times New Roman";}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></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=DE link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>since the plugin is executed as user nagios, check if the command (including all params) works as user nagios (or whatever user id it is running as)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Problem could be:<o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><span style='mso-list:Ignore'>1)<span style='font:7.0pt "Times New Roman"'>      </span></span></span><![endif]><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Nagios user  can’t read the ssh key file as it resides in root directory<o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><span style='mso-list:Ignore'>2)<span style='font:7.0pt "Times New Roman"'>      </span></span></span><![endif]><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Or it can’t write the ~nagios/.ssh/known_hosts file<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>PS: In general it is not a good practice to use root ssh key for nagios commands<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>       I would suggest to create a ssh key for nagios user and place it in nagios home or a place where nagios user has access to<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Regards,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>bp<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><a name="_MailEndCompose"><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></a></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Von:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Eduardo Montes de Oca S. [mailto:edrendar@gmail.com] <br><b>Gesendet:</b> Mittwoch, 15. August 2012 17:36<br><b>An:</b> nagios-users@lists.sourceforge.net<br><b>Betreff:</b> [Nagios-users] Issues with check_by_ssh<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><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"><span style='font-size:9.0pt;font-family:"Helvetica","sans-serif";background:white;text-decoration:none'>root@nagioserver#</span></a></b><b><span style='font-size:9.0pt;font-family:"Helvetica","sans-serif";background:white'> /usr/lib/nagios/plugins/check_by_ssh -l root -H "ipxenserver" -C /usr/lib/nagios/plugins/check_Xencpu</span></b><b><span style='font-size:9.0pt;font-family:"Helvetica","sans-serif"'><br><span style='background:white'>“OK:CPU%= 3”</span></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 width=1139 height=95 id="_x0000_i1025" src="cid:image001.png@01CD7B1C.E84C7D00" 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><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><b><span style='font-size:10.0pt;font-family:"Franklin Gothic Medium","sans-serif"'>IC.</span></b><b><span style='font-size:10.0pt;font-family:"Franklin Gothic Medium","sans-serif"'> Eduardo Montes de Oca Sánchez<br></span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>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><o:p></o:p></p></div><p class=MsoNormal><a href="https://linuxcounter.net/cert/549074.png" target="_blank">https://linuxcounter.net/cert/549074.png</a><o:p></o:p></p></div></div></body></html>