<div dir="ltr">Dave<div><br></div><div>Good to hear it worked. Thanks for reporting back.</div><div><br></div><div>Cheers</div><div>Jeremy</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 6 Aug 2020 at 08:17, David Boyer <<a href="mailto:davieb@gmail.com">davieb@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Jeremy,</div><div>            I forgot to get back to you on this.   SUCCESS !!!   Changed the LC_ALL and it is working as expected now...</div><div>Thanks very very much... I owe ya!</div><div><br></div><div>Dave<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Aug 3, 2020 at 11:25 PM Jeremy Laidman <<a href="mailto:jeremy@laidman.org" target="_blank">jeremy@laidman.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">David<div><br></div><div>I think the problem is that xymonclient.sh sets LC_ALL=C, which essentially overrides the value of LANG. For example:</div><div><br></div><div>$ <b>LANG=en_US.UTF-8 rpm -q dhcp-common --qf "%{INSTALLTIME:date}\n"</b><br>Tue 21 Apr 2020 01:14:57 PM AEST</div><div><br>$ <b>LANG=en_US.UTF-8 LC_ALL=C rpm -q dhcp-common --qf "%{INSTALLTIME:date}\n"</b><br>Tue Apr 21 13:14:57 2020<br></div><div><br></div><div>$ <b>LC_ALL=en_US.UTF-8 LANG=C rpm -q dhcp-common --qf "%{INSTALLTIME:date}\n"</b><br>Tue 21 Apr 2020 01:14:57 PM AEST<br></div><div><br></div><div>So, your script should only need to set LC_ALL=en_US.UTF-8, and it should work.</div><div><br></div><div>But it seems like the world is trying to conspire against you changing LANG/LC_ALL/LC_MESSAGES to anything but C, and I'd be inclined to go with the flow, and assume that format; but also, set LC_ALL to C just in case.</div><div><br></div><div>J</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 4 Aug 2020 at 12:44, David Boyer <<a href="mailto:davieb@gmail.com" target="_blank">davieb@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Jeremy,</div><div>            So I thought about changing the output..  I compressed the spaces and then I put a _ in lieu of the spaces.</div><div><br></div><div>As you can see below, they both get mangled... <br></div><div><br></div><div>[davieb@xymonsvr ~]$ ~xymon/client/local/dateinfo<br>dhcp-common,4.3.6,<span style="color:rgb(255,0,0)">18_Jul_2020</span>,en_US.UTF-8<br>[davieb@xymonsvr ~]$ ~xymon/server/bin/xymon localhost "clientlog xymonsvr section=local:dateinfo"<br>[local:dateinfo]<br>dhcp-common,4.3.6,<span style="color:rgb(255,0,0)">Jul_18_17:44:26</span>,en_US.UTF-8</div><div><br></div><div>[davieb@xymonsvr ~]$ ~xymon/client/local/dateinfo<br>dhcp-common,4.3.6,<span style="color:rgb(255,0,0)">18Jul2020</span>,en_US.UTF-8<br>[davieb@xymonsvr ~]$ ~xymon/server/bin/xymon localhost "clientlog xymonsvr section=local:dateinfo"<br>[local:dateinfo]<br>dhcp-common,4.3.6,<span style="color:rgb(255,0,0)">Jul1817:44:26</span>,en_US.UTF-8</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Aug 3, 2020 at 10:25 PM David Boyer <<a href="mailto:davieb@gmail.com" target="_blank">davieb@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Jeremy,</div><div>           You read my mind!  But, it didn't seem to help... :(</div><div><br></div><div>[davieb@xymonsvr ~]$ ~xymon/client/local/dateinfo<br>dhcp-common,4.3.6,18 Jul 2020,<span style="color:rgb(255,0,0)">en_US.UTF-8</span></div><div><br></div><div>[davieb@xymonsvr ~]$ ~xymon/server/bin/xymon localhost "clientlog xymonsvr section=local:dateinfo"<br>[local:dateinfo]<br>dhcp-common,4.3.6,Jul 18 17:44:26,<span style="color:rgb(255,0,0)">en_US.UTF-8</span></div><div><br></div><div>[davieb@xymonsvr ~]$ cat ~xymon/client/local/dateinfo<br>#!/bin/sh<br><br>OS=`uname -s`<br>RPM=dhcp-common<br><span style="color:rgb(255,0,0)">LANG=en_US.UTF-8;export LANG<br></span><br>if [ ${OS} = "Linux" ]; then<br>   VERSION=`rpm -q ${RPM} --qf "%{VERSION}\n"`<br>   INSTALLED=`rpm -q ${RPM} --qf "%{INSTALLTIME:date}\n"|awk {'print $2" "$3" "$4'}`<br>fi<br><br>echo "${RPM},${VERSION},${INSTALLED},${LANG}"</div><div><br></div><div>Good thing I'm grey already... This is the kinda stuff that would turn me grey!</div><div><br></div><div>Dave<br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Aug 3, 2020 at 9:21 PM Jeremy Laidman <<a href="mailto:jeremy@laidman.org" target="_blank">jeremy@laidman.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Great to see that the problem has been identified.<div><br></div><div>I would recommend forcing LANG in your script to a known value, because that's the code that makes an assumption about the output of rpm.</div><div><br></div><div>J</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 4 Aug 2020 at 10:56, David Boyer <<a href="mailto:davieb@gmail.com" target="_blank">davieb@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Jeremy,</div><div>       If you notice, both iterations are being run from the xymonsvr.  I've added the LANG to see if the</div><div>two report it differently.</div><div><br></div><div>So, by hand it looks:</div><div><br></div><div>[davieb@<span style="color:rgb(255,0,0)">xymonsvr</span> ~]$ ~xymon/client/local/dateinfo<br>dhcp-common,4.3.6,18 Jul 2020,en_US.UTF-8<br></div><div><br></div><div>Pulling the info out of xymon looks:</div><div><br></div><div>[davieb@<span style="color:rgb(255,0,0)">xymonsvr</span> ~]$ ~xymon/server/bin/xymon localhost "clientlog xymonsvr section=local:dateinfo"<br>[local:dateinfo]<br>dhcp-common,4.3.6,Jul 18 17:44:26,<b><span style="color:rgb(255,0,0)">C</span></b></div><div><br><b><span style="color:rgb(255,0,0)"></span></b>Humm, there does appear to be a difference!  Checking the xymon user itself, it UTF-8.</div><div>[xymon@xymonsvr ~]$ echo $LANG<br>en_US.UTF-8</div><div><br></div><div><br></div><div>
<div>That appears to be the issue though, I set the LANG=C and ran the script by hand and get the same results when I pull it from xymon!</div><div>[davieb@xymonsvr ~]$ LANG=C;export LANG<br>[davieb@xymonsvr ~]$ ~xymon/client/local/dateinfo<br>dhcp-common,4.3.6,<span style="color:rgb(255,0,0)">Jul 18 17:44:26,C</span><br></div>

</div><div><br></div><div>Looking at the xymon.sh start script, it does not appear to set it anywhere!  Guess I'll need to run that <br></div><div>to ground in the morning.</div><div><br></div><div>Thanks for pointing me in the right direction!</div><div><br></div><div>Dave<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Aug 3, 2020 at 8:11 PM Jeremy Laidman <<a href="mailto:jeremy@laidman.org" target="_blank">jeremy@laidman.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">David<div><br></div><div>Update your script to, display the value of the LANG variable in addition to the RPM details (perhaps on a separate line), and see if the value differs between the script output (run from your shell) and the clientlog.</div><div><br></div><div>I suspect LANG is set in your shell differently from how it's set in the xymon user's shell. RPM (or probably glibc) uses LANG to format the date according to the environment's locale. I'm guessing your shell has LANG set to something like en_US, whereas the xymon user's LANG is set to something like C, or is not set at all.</div><div><br></div><div>Cheers</div><div>Jeremy</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 4 Aug 2020 at 08:32, David Boyer <<a href="mailto:davieb@gmail.com" target="_blank">davieb@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi,<br>    I've got a strange date issue.  I've written some local scripts to pad information onto the combo message. Here is the background:<br><br>1. When you run the script by hand locally (take note of the date):<br><br>[davieb@xymonsvr ~]$ ~xymon/client/local/dateinfo<br>dhcp-common,4.3.6,<span style="color:rgb(255,0,0)">18 Jul 2020</span><br><br>2. When I pull the information from xymon server:<br><br>[davieb@xymonsvr ~]$ ~xymon/server/bin/xymon localhost "clientlog xymonsvr section=local:dateinfo"<br>[local:dateinfo]<br>dhcp-common,4.3.6,<span style="color:rgb(255,0,0)">Jul 18 17:44:26</span><br><br><br>Notice how the date field gets modified?  I can't figure out why. The only thing I can think of is something within the xymon code, but I don't know why it would?<br><br>Here's the simple script:<br><br>[davieb@xymonsvr ~]$ cat ~xymon/client/local/dateinfo<br>#!/bin/sh<br><br>OS=`uname -s`<br>RPM=dhcp-common<br><br>if [ ${OS} = "Linux" ]; then<br>   VERSION=`rpm -q ${RPM} --qf "%{VERSION}\n"`<br>   INSTALLED=`rpm -q ${RPM} --qf "%{INSTALLTIME:date}\n"|awk {'print $2" "$3" "$4'}`<br>fi<br><br><div>echo "${RPM},${VERSION},${INSTALLED}"</div><div><br></div><div>Does anybody have any idea what is going on?</div><div><br></div><div>Thanks,</div><div>Dave<br></div>


</div>
_______________________________________________<br>
Xymon mailing list<br>
<a href="mailto:Xymon@xymon.com" target="_blank">Xymon@xymon.com</a><br>
<a href="http://lists.xymon.com/mailman/listinfo/xymon" rel="noreferrer" target="_blank">http://lists.xymon.com/mailman/listinfo/xymon</a><br>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>