Where is the linux client name set?
list John Thurston
It's been a couple of years since I've needed to configure a linux client (my Solaris systems are still running their old BB clients). And I'm confused with what I'm seeing. This is on a _very_ minimal server installation with client; compiled from source.
I have files in ~/client/tmp/ of the form msg.xymonx.state.ak.us.txt (so fully-qualified host.domain name). Yet the first line of that file is:
client xymonx.linux linux
So the message body being sent to the xymon server contains the short host name. But the client is writing the file onto the disk with the fully-qualified name.
The xymon server reports my client messages as 'ghosts', and correctly picks them up if I put a client alias in hosts.cfg
client:xymonx
I'd like to do away with that alias.
Where is my linux client picking up this short name?
--
Do things because you should, not just because you can.
John Thurston XXX-XXX-XXXX
user-ce4d79d99bab@xymon.invalid
Department of Administration
State of Alaska
list Josh Luthman
Either uname on the client or hosts config on the server. Josh Luthman Office: XXX-XXX-XXXX Direct: XXX-XXX-XXXX XXXX Wayne St Suite XXXX Troy, OH XXXXX
▸
On Sep 15, 2017 7:35 PM, "John Thurston" <user-ce4d79d99bab@xymon.invalid> wrote:
It's been a couple of years since I've needed to configure a linux client (my Solaris systems are still running their old BB clients). And I'm confused with what I'm seeing. This is on a _very_ minimal server installation with client; compiled from source. I have files in ~/client/tmp/ of the form msg.xymonx.state.ak.us.txt (so fully-qualified host.domain name). Yet the first line of that file is: client xymonx.linux linux So the message body being sent to the xymon server contains the short host name. But the client is writing the file onto the disk with the fully-qualified name. The xymon server reports my client messages as 'ghosts', and correctly picks them up if I put a client alias in hosts.cfg client:xymonx I'd like to do away with that alias. Where is my linux client picking up this short name? -- Do things because you should, not just because you can. John Thurston XXX-XXX-XXXX user-ce4d79d99bab@xymon.invalid Department of Administration State of Alaska
list Ralph Mitchell
I've had clients check in with the short-form name when it's listed first
in the /etc/hosts file, like this:
10.10.10.10 client client.domain.com
Just swapping the names over fixed it and made it check in with the
long-form name:
10.10.10.10 client.domain.com client
Not sure why.
Ralph Mitchell
On Fri, Sep 15, 2017 at 7:44 PM, Josh Luthman <user-4c45a83f15cb@xymon.invalid>
▸
wrote:
Either uname on the client or hosts config on the server. Josh Luthman
Office: XXX-XXX-XXXX <(937)%20552-2340>
Direct: XXX-XXX-XXXX <(937)%20552-2343>
▸
XXXX Wayne St Suite XXXX Troy, OH XXXXX On Sep 15, 2017 7:35 PM, "John Thurston" <user-ce4d79d99bab@xymon.invalid> wrote:It's been a couple of years since I've needed to configure a linux client (my Solaris systems are still running their old BB clients). And I'm confused with what I'm seeing. This is on a _very_ minimal server installation with client; compiled from source. I have files in ~/client/tmp/ of the form msg.xymonx.state.ak.us.txt (so fully-qualified host.domain name). Yet the first line of that file is: client xymonx.linux linux So the message body being sent to the xymon server contains the short host name. But the client is writing the file onto the disk with the fully-qualified name. The xymon server reports my client messages as 'ghosts', and correctly picks them up if I put a client alias in hosts.cfg client:xymonx I'd like to do away with that alias. Where is my linux client picking up this short name? -- Do things because you should, not just because you can. John Thurston XXX-XXX-XXXX user-ce4d79d99bab@xymon.invalid Department of Administration State of Alaska
list John Thurston
▸
On 9/15/2017 4:38 PM, Ralph Mitchell wrote:
I've had clients check in with the short-form name when it's listed
first in the /etc/hosts file, like this:
10.10.10.10 client client.domain.com
Just swapping the names over fixed it and made it check in with the
long-form name:
10.10.10.10 client.domain.com clientThat's a good idea, but mine is already ip fqdn hostname
▸
--
Do things because you should, not just because you can.
John Thurston XXX-XXX-XXXX
user-ce4d79d99bab@xymon.invalid
Department of Administration
State of Alaska
list Galen Johnson
Hey Ralph, I'm fairly certain (not 100%) that 'gethostbyname' (apparently being deprecated in favor of getnameinfo) will only return the first entry from the hosts file. I've been bitten by this for some other apps. =G= On Fri, Sep 15, 2017 at 8:38 PM, Ralph Mitchell <user-00a5e44c48c0@xymon.invalid>
▸
wrote:
I've had clients check in with the short-form name when it's listed first in the /etc/hosts file, like this: 10.10.10.10 client client.domain.com Just swapping the names over fixed it and made it check in with the long-form name: 10.10.10.10 client.domain.com client Not sure why. Ralph Mitchell On Fri, Sep 15, 2017 at 7:44 PM, Josh Luthman <user-4c45a83f15cb@xymon.invalidwrote:Either uname on the client or hosts config on the server. Josh Luthman Office: XXX-XXX-XXXX <(937)%20552-2340> Direct: XXX-XXX-XXXX <(937)%20552-2343> XXXX Wayne St Suite XXXX Troy, OH XXXXX On Sep 15, 2017 7:35 PM, "John Thurston" <user-ce4d79d99bab@xymon.invalid> wrote:It's been a couple of years since I've needed to configure a linux client (my Solaris systems are still running their old BB clients). And I'm confused with what I'm seeing. This is on a _very_ minimal server installation with client; compiled from source. I have files in ~/client/tmp/ of the form msg.xymonx.state.ak.us.txt (so fully-qualified host.domain name). Yet the first line of that file is: client xymonx.linux linux So the message body being sent to the xymon server contains the short host name. But the client is writing the file onto the disk with the fully-qualified name. The xymon server reports my client messages as 'ghosts', and correctly picks them up if I put a client alias in hosts.cfg client:xymonx I'd like to do away with that alias. Where is my linux client picking up this short name? -- Do things because you should, not just because you can. John Thurston XXX-XXX-XXXX user-ce4d79d99bab@xymon.invalid Department of Administration State of Alaska
list Galen Johnson
John, Which version and flavor of linux?
▸
=G=
On Fri, Sep 15, 2017 at 7:35 PM, John Thurston <user-ce4d79d99bab@xymon.invalid>
wrote:
It's been a couple of years since I've needed to configure a linux client (my Solaris systems are still running their old BB clients). And I'm confused with what I'm seeing. This is on a _very_ minimal server installation with client; compiled from source. I have files in ~/client/tmp/ of the form msg.xymonx.state.ak.us.txt (so fully-qualified host.domain name). Yet the first line of that file is: client xymonx.linux linux So the message body being sent to the xymon server contains the short host name. But the client is writing the file onto the disk with the fully-qualified name. The xymon server reports my client messages as 'ghosts', and correctly picks them up if I put a client alias in hosts.cfg client:xymonx I'd like to do away with that alias. Where is my linux client picking up this short name? -- Do things because you should, not just because you can. John Thurston XXX-XXX-XXXX user-ce4d79d99bab@xymon.invalid Department of Administration State of Alaska
list John Thurston
On 9/16/2017 7:25 PM, Galen Johnson wrote:
John, Which version and flavor of linux?
CentOS 7
# uname -a Linux xymonx 2.6.32-042stab120.3 #1 SMP Thu Oct 20 18:18:21 MSK 2016 x86_64 x86_64 x86_64 GNU/Linux
▸
--
Do things because you should, not just because you can.
John Thurston XXX-XXX-XXXX
user-ce4d79d99bab@xymon.invalid
Department of Administration
State of Alaska
list Jeremy Ruffer
I'm on RHEL 6 which is probably the same. In /etc/sysconfig/xymon-client there is a CLIENTHOSTNAME= line. HTH Jeremy
▸
On 18 Sep 2017 17:13, "John Thurston" <user-ce4d79d99bab@xymon.invalid> wrote:
On 9/16/2017 7:25 PM, Galen Johnson wrote:John, Which version and flavor of linux?CentOS 7 # uname -aLinux xymonx 2.6.32-042stab120.3 #1 SMP Thu Oct 20 18:18:21 MSK 2016 x86_64 x86_64 x86_64 GNU/Linux-- Do things because you should, not just because you can. John Thurston XXX-XXX-XXXX user-ce4d79d99bab@xymon.invalid Department of Administration State of Alaska
list John Thurston
▸
On 9/18/2017 8:30 AM, Jeremy Ruffer wrote:
I'm on RHEL 6 which is probably the same. In /etc/sysconfig/xymon-client there is a CLIENTHOSTNAME= line.
Are you, perhaps, running the terabitha package of Xymon? I have no such file here. As mentioned earlier, I've compiled from source. For my machine, I have borrowed the terabithia systemd service-file. It fires off xymonlaunch with:
ExecStart=/opt/xymon/server/bin/xymoncmd /opt/xymon/server/bin/xymonlaunch --no-daemon $XYMONLAUNCHOPTS
My tasks.cfg has the client to be run with:
ENVFILE /opt/xymon/client/etc/xymonclient.cfg CMD /opt/xymon/client/bin/xymonclient.sh LOGFILE $XYMONSERVERLOGS/xymonclient.log INTERVAL 5m
The xymonclient.sh contains the pertinent line:
echo "client $MACHINE.$SERVEROSTYPE $CONFIGCLASS" >> $MSGTMPFILE
When I change $MACHINE to $MACHINEDOTS, the client behaves as expected, and sends messages under its fully qualified domain name. It looks to me like the behavior of uname on my host isn't relevant. The xymonclient.sh is specifically writing the short name rather than the long. Now what isn't clear to me, is where $MACHINE is picking up the short name. I had expected it to hold the old-school "comma name". The only place I can fine $MACHINE being assigned a value is in runclient.sh. As far as I can tell, my chain of commands does not invoke that script but goes straight for xymonclient.sh. Right now, it looks like I have two options: A) Modify xymonclient.sh to use MACHINEDOTS B) Use a CLIENT tag in my hosts.cfg to accept the short name I dislike the use of CLIENT tags, but in this case prefer it to remembering to patch the client script if I ever rebuild my software.
▸
--
Do things because you should, not just because you can.
John Thurston XXX-XXX-XXXX
user-ce4d79d99bab@xymon.invalid
Department of Administration
State of Alaska
list Galen Johnson
I run all my systems on Centos 7 (now) and, IIRC, I had to run hostnamectl set-hostname <fqdn> Something to try. =G= On Mon, Sep 18, 2017 at 1:30 PM, John Thurston <user-ce4d79d99bab@xymon.invalid>
▸
wrote:
On 9/18/2017 8:30 AM, Jeremy Ruffer wrote:I'm on RHEL 6 which is probably the same. In /etc/sysconfig/xymon-client there is a CLIENTHOSTNAME= line.Are you, perhaps, running the terabitha package of Xymon? I have no such file here. As mentioned earlier, I've compiled from source. For my machine, I have borrowed the terabithia systemd service-file. It fires off xymonlaunch with: ExecStart=/opt/xymon/server/bin/xymoncmd /opt/xymon/server/bin/xymonlaunch--no-daemon $XYMONLAUNCHOPTSMy tasks.cfg has the client to be run with:ENVFILE /opt/xymon/client/etc/xymonclient.cfg CMD /opt/xymon/client/bin/xymonclient.sh LOGFILE $XYMONSERVERLOGS/xymonclient.log INTERVAL 5mThe xymonclient.sh contains the pertinent line:echo "client $MACHINE.$SERVEROSTYPE $CONFIGCLASS" >> $MSGTMPFILEWhen I change $MACHINE to $MACHINEDOTS, the client behaves as expected, and sends messages under its fully qualified domain name. It looks to me like the behavior of uname on my host isn't relevant. The xymonclient.sh is specifically writing the short name rather than the long. Now what isn't clear to me, is where $MACHINE is picking up the short name. I had expected it to hold the old-school "comma name". The only place I can fine $MACHINE being assigned a value is in runclient.sh. As far as I can tell, my chain of commands does not invoke that script but goes straight for xymonclient.sh. Right now, it looks like I have two options: A) Modify xymonclient.sh to use MACHINEDOTS B) Use a CLIENT tag in my hosts.cfg to accept the short name I dislike the use of CLIENT tags, but in this case prefer it to remembering to patch the client script if I ever rebuild my software. -- Do things because you should, not just because you can. John Thurston XXX-XXX-XXXX user-ce4d79d99bab@xymon.invalid Department of Administration State of Alaska
list Stephen Carville
On 09/18/2017 09:30 AM, Jeremy Ruffer wrote: If you are asking for where the system stores the hostname then it is in /etc/hostname
▸
I'm on RHEL 6 which is probably the same. In /etc/sysconfig/xymon-client there is a CLIENTHOSTNAME= line. HTH Jeremy On 18 Sep 2017 17:13, "John Thurston" <user-ce4d79d99bab@xymon.invalid> wrote:On 9/16/2017 7:25 PM, Galen Johnson wrote:John, Which version and flavor of linux?CentOS 7 # uname -aLinux xymonx 2.6.32-042stab120.3 #1 SMP Thu Oct 20 18:18:21 MSK 2016 x86_64 x86_64 x86_64 GNU/Linux-- Do things because you should, not just because you can. John Thurston XXX-XXX-XXXX user-ce4d79d99bab@xymon.invalid Department of Administration State of Alaska
--
Stephen Carville
Serf Without Portfolio
XXX.XXX.XXXX x1326
user-45c5e542adfd@xymon.invalid
There is no "I" in Team but there is in Integrity.