[Xymon] xymon client host name not including domain name in systemd scripts
Phil Crooker
Phil.Crooker at orix.com.au
Fri Feb 2 08:01:20 CET 2018
I've this issue with SUSE linux - SUSE just returns the plain hostname without the domain when it uses uname -n -- the xymon client then doesn't match the FQDN in the xymon hosts.cfg file, the entry goes purple and the client ends up in the ghost report. I'm compiling my own client and inserting the xymonlaunch.service file in /etc/systemd/system, etc -- somehow it doesn't send the correct hostname. I tried adding CLIENTNAME=blah.domain.com in xymonlaunch to no effect (also put it in the xymonclient config file, still no good). If I manually run /bin/hostname with the FQDN, that works, but is lost on the next reboot. And yes I ensured the FQDN is in /etc/hostname, etc... I do not want to have to put in a "CLIENT:whatever" statement in hosts.cfg for every host with a client, which works but is inelegant to me.
Looking at the old runclient.sh script that comes with the client (and is not used with systemd), the MACHINEDOTS variable is set before launch. In the good ol SYS5 init.d days, I used to insert MACHINEDOTS=`hostname -f` in the runclient.sh script, which worked. So, I found if you run: systemctl edit xymonlaunch.service and add the following, it works:
[Service]
Environment="MACHINEDOTS=whatever.domain.com"
This creates a /etc/systemd/system/xymonlaunch.service.d/override.conf file and all is well. Unfortunately it doesn't work with `hostname -f`. There is a warning that if there is no override.conf in whatever.service.d/ the service won't run. That isn't true with SUSE SLES 12, it works fine w/o it (less the correct name, of course), but YMMV...
HTH Someone, Phil
Disclaimer
The information contained in this communication from the sender is confidential. It is intended solely for use by the recipient and others authorized to receive it. If you are not the recipient, you are hereby notified that any disclosure, copying, distribution or taking action in relation of the contents of this information is strictly prohibited and may be unlawful.
This email has been scanned for viruses and malware, and may have been automatically archived by Mimecast Ltd, an innovator in Software as a Service (SaaS) for business. Providing a safer and more useful place for your human generated data. Specializing in; Security, archiving and compliance. To find out more visit the Mimecast website.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20180202/689cdd4d/attachment.html>
More information about the Xymon
mailing list