GNU/Linux >> Tutoriales Linux >  >> Cent OS

El cambio de nombre de host no se refleja en el informe sar para CentOS/RHEL

El problema

Después de cambiar el nombre de host de geeklab_old a geeklab_new , el informe sar aún muestra el antiguo nombre de host.

# sar -f /var/log/sa/sa09
Linux 5.4.17-2102.200.13.el8uek.x86_64 (geeklab_old) 04/09/2021 _x86_64_ (4 CPU)
...

El cambio de nombre de host se refleja en /var/log/messages:

Apr 9 14:32:33 geeklab_old systemd[1]: Starting Hostname Service...
Apr 9 14:32:33 geeklab_old dbus-daemon[1117]: [system] Successfully activated service 'org.freedesktop.geeklab_old'
Apr 9 14:32:33 geeklab_old systemd[1]: Started Hostname Service.
Apr 9 14:32:33 geeklab_old systemd-hostnamed[6551]: Changed host name to 'geeklab_old'
Apr 9 14:32:44 geeklab_old systemd[1]: NetworkManager-dispatcher.service: Succeeded.
Apr 9 14:33:03 geeklab_old systemd[1]: systemd-hostnamed.service: Succeeded.
Apr 9 14:35:00 geeklab_old systemd[1]: Starting system activity accounting tool...
Apr 9 14:35:00 geeklab_old systemd[1]: sysstat-collect.service: Succeeded.
Apr 9 14:35:00 geeklab_old systemd[1]: Started system activity accounting tool.
Apr 9 14:40:00 geeklab_old systemd[1]: Starting system activity accounting tool...
Apr 9 14:40:00 geeklab_old systemd[1]: sysstat-collect.service: Succeeded.
Apr 9 14:40:00 geeklab_old systemd[1]: Started system activity accounting tool.
Apr 9 14:41:43 geeklab_old kernel: Command line: BOOT_IMAGE=(hd0,msdos1)/vmlinuz-5.4.17-2102.200.13.el8uek.x86_64 root=/dev/mapper/ol-root ro crashkernel=auto n
et.ifnames=0 biosdevname=0 resume=/dev/mapper/ol-swap rd.lvm.lv=ol/root rd.lvm.lv=ol/swap rd.lvm.lv=ol/usr rhgb quiet numa=off transparent_hugepage=never
Apr 9 14:41:43 geeklab_old kernel: Disabled fast string operations
Apr 9 14:41:43 geeklab_old kernel: x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'

La solución

Cuando cambie el nombre de host, estos cambios se reflejarán solo en los registros /var/log/sa/saXX recién creados. El nuevo nombre de host se actualizará a partir del archivo /var/log/sa/saXX del día siguiente.

Si es necesario actualizar el registro del día actual con el nuevo nombre de host, siga los pasos a continuación:

1. Detenga el servicio sysstat:

# systemctl stop sysstat

2. Elimine o realice una copia de seguridad del archivo /var/log/sa/saXX actual:

# mv /var/log/sa/sa09 /backup/

3. Inicie el servicio sysstat:

# systemctl start sysstat

4. Confirme el cambio de nombre de host:

# sar -f /var/log/sa/sa09
Linux 5.4.17-2102.200.13.el8uek.x86_64 (geeklab_new) 04/09/2021 _x86_64_ (4 CPU)
...


Cent OS
  1. Cómo configurar/cambiar un nombre de host en CentOS 7 Linux

  2. Cómo configurar o cambiar el nombre de host en CentOS 7 / RHEL 7

  3. Cómo cambiar el nombre de host en CentOS

  4. CentOS / RHEL 7:Cómo cambiar la zona horaria

  5. Cómo cambiar el nombre de host en CentOS Linux

4 métodos para cambiar el nombre de host en RHEL/CentOS 7/8

Cómo configurar/cambiar el nombre de host en CentOS 8 / RHEL 8

Cómo cambiar la zona horaria en CentOS 8 / RHEL 8

Cómo cambiar el nombre de host en CentOS 8

Cómo cambiar el nombre de host en CentOS/RHEL 8

Cómo cambiar el nombre de host en CentOS/RHEL 7