Xymon Mailing List Archive search

Where is the linux client name set?

11 messages in this thread

list John Thurston · Fri, 15 Sep 2017 15:35:13 -0800 ·
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 · Fri, 15 Sep 2017 19:44:18 -0400 ·
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
quoted from John Thurston

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 · Fri, 15 Sep 2017 20:38:13 -0400 ·
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>
quoted from Josh Luthman
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>
quoted from Josh Luthman
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 · Fri, 15 Sep 2017 16:57:11 -0800 ·
quoted from Ralph Mitchell
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  client
That's a good idea, but mine is already
   ip   fqdn  hostname
quoted from Ralph Mitchell


-- 
    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 · Sat, 16 Sep 2017 23:22:18 -0400 ·
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>
quoted from 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  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 Galen Johnson · Sat, 16 Sep 2017 23:25:56 -0400 ·
John,

Which version and flavor of linux?
quoted from Galen Johnson

=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 · Mon, 18 Sep 2017 08:12:59 -0800 ·
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
quoted from Galen Johnson

-- 
    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 · Mon, 18 Sep 2017 17:30:56 +0100 ·
I'm on RHEL 6 which is probably the same.

In /etc/sysconfig/xymon-client there is a CLIENTHOSTNAME= line.

HTH

Jeremy
quoted from John Thurston

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 -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 John Thurston · Mon, 18 Sep 2017 09:30:53 -0800 ·
quoted from Jeremy Ruffer
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.
quoted from Jeremy Ruffer


-- 
    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 · Mon, 18 Sep 2017 13:46:29 -0400 ·
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>
quoted from John Thurston
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 $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 Stephen Carville · Tue, 19 Sep 2017 15:44:16 -0700 ·
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
quoted from 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 -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

-- 

Stephen Carville
Serf Without Portfolio
XXX.XXX.XXXX x1326
user-45c5e542adfd@xymon.invalid
There is no "I" in Team but there is in Integrity.