<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 12 November 2013 00:56, Kris Springer <span dir="ltr"><<a href="mailto:kspringer@innovateteam.com" target="_blank">kspringer@innovateteam.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;color:rgb(153,0,0)">
When I run that command as user xymon, it attempts then hangs.</div>


<div class="gmail_default"><font color="#990000" face="arial, helvetica, sans-serif">root@ip:~# su xymon</font></div></div></blockquote><div><br></div><div>Good.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="gmail_extra"><div class="gmail_default"><font color="#990000" face="arial, helvetica, sans-serif">xymon@ip:/home/ubuntu$ su xymon -c xymoncmd echo "mail test" | $MAIL "Xyon [12345] VM-Firesall:proc CRITICAL (RED)" <a href="mailto:support@innovateteam.com" target="_blank">support@innovateteam.com</a></font></div>

</div></blockquote><div><br></div><div>No, this won't do the same thing as I said.  The "$MAIL" variable will be expanded by the shell of the xymon user, which won't have run xymoncmd yet, and so $MAIL probably will be defined as /var/mail/xymon - the path to the xymon user's mailbox file, /var/mail/xymon (which doesn't exist because the xymon user has never received mail).</div>

<div><br></div><div>(Also, you have already run "su xymon" so no need to do it a second time.)</div><div><br></div><div>Instead, you should run xymoncmd, and then at a command prompt (once $MAIL is defined) run the subsequent command.  You could even do "echo $MAIL" in the middle, to be sure, like so:</div>

<div><br></div><div>$ su xymon</div><div>$ echo $MAIL</div><div>/var/mail/xymon</div><div>$ xymoncmd</div><div>$ echo $MAIL</div><div>/usr/bin/mail</div><div>$ echo "mail test" | $MAIL "what ever you want here" <a href="mailto:support@innovateteam.com">support@innovateteam.com</a></div>

<div><br></div><div>Cheers<br></div><div>Jeremy</div><div><br></div></div></div></div>