Ad Widget

Collapse

Zabbix Agent Configuration on Linux VM Image

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • eryunl
    Junior Member
    • Jun 2022
    • 5

    #1

    Zabbix Agent Configuration on Linux VM Image

    Hello all,

    We have vm images to be used in instance groups in cloud environment. When new vm created from image we expect that it has added as a new host on zabbix thanks to autodiscovery rule. However it added as a another interface on image host. When ve create another vm it added third interface attached on same host. If agent servise restarted in these new vm' s problem is solved. They can be seen as a new and indepented host on zabbix. How can I solve this problem.,

    I used active checks with zabbix-agent2


    Thanks in advance
  • eryunl
    Junior Member
    • Jun 2022
    • 5

    #2
    Any thoughts??? I give an example to clearify the issue.

    I have an vm image that zabbix agent installed and works fine. Lets image name is vmimg01. When i create two vm from this image with hostname; testvm01 and testvm02. They are added as a agent interface on vmimg01. Whenaver agent services restarted on these vm' s, they added as new host correctly.

    I used autoregister rule for adding hosts to zabbix. Also used active checks and agent.conf below;
    HostMetadataItem=system.uname
    ServerActive=xxx;xxx
    other' s default

    Comment

    • Markku
      Senior Member
      Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
      • Sep 2018
      • 1781

      #3
      Originally posted by eryunl
      Any thoughts??? I give an example to clearify the issue.

      I have an vm image that zabbix agent installed and works fine. Lets image name is vmimg01. When i create two vm from this image with hostname; testvm01 and testvm02. They are added as a agent interface on vmimg01. Whenaver agent services restarted on these vm' s, they added as new host correctly.

      I used autoregister rule for adding hosts to zabbix. Also used active checks and agent.conf below;
      HostMetadataItem=system.uname
      ServerActive=xxx;xxx
      other' s default
      So your problem actually is: how to fix the unnamed cloud service that first starts the new VMs with incorrect hostnames (= using the hostname of the original image), right?

      Because you say that the new VMs first look like vmimg01 (in system.uname, as reported by Zabbix agent when first started) and only later the VMs get their final hostnames (= Zabbix agent sees the new system.uname when restarted).

      Let us know if you already got a resolution earlier.

      Markku

      Comment


      • eryunl
        eryunl commented
        Editing a comment
        Hi Markkui,

        Yes my problem was; vm starts with base image hostname in zabbix, I have to the restart the agent manually to get the correct hostname. ;

        I have found a solution in OS level. I created zabbix-agent-startup service at Linux systemd. Because problem occured when zabbix agent started with image OS informations. With systemd I have set timeout for startup of zabbix-agent, vm started firstly and then zabbix agent started, so agent get the OS information correctly.
    Working...