Ad Widget

Collapse

Install Zabbix agent using puppet

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • natalia
    Senior Member
    • Apr 2013
    • 159

    #1

    Install Zabbix agent using puppet

    Hi,

    I need help with puppet package to install/upgrade Zabbix agents.

    I find the following installation commands:

    rpm --import http://repo.zabbixzone.com/centos/RP...KEY-zabbixzone
    rpm -Uv http://repo.zabbixzone.com/centos/za...0-1.noarch.rpm
    yum install zabbix-agent -y
    chkconfig zabbix-agent on
    mv /etc/zabbix/zabbix_agentd.conf /etc/zabbix/zabbix_agentd.default
    sed 's/Server=127.0.0.1/Server=<my Zabbix server's ip>/' /etc/zabbix/zabbix_agentd.default > /etc/zabbix/zabbix_agentd.conf
    service zabbix-agent start

    First of all, are these steps correct ?
    I am using Zabbix 2.0.5

    How to create puppet package ? Can somebody share it ?

    Thanks for the help.
    Natalia
  • neogan
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2011
    • 118

    #2
    Seems steps is correct.

    But:
    - I would reccomend use official repo zabbix.

    also i notised you cannot change ServerActive option, If your agents will be active, you should change it too.


    hope it help

    Comment

    • natalia
      Senior Member
      • Apr 2013
      • 159

      #3
      Install Zabbix agent using puppet

      Hi,

      Thanks !

      I changed it to :

      rpm -ivh http://repo.zabbix.com/zabbix/2.0/rh...el6.noarch.rpm
      yum install zabbix-agent -y
      mv /etc/zabbix/zabbix_agentd.conf /etc/zabbix/zabbix_agentd.default
      sed 's/Server=127.0.0.1/Server=<my Zabbix server's ip>/' /etc/zabbix/zabbix_agentd.default > /etc/zabbix/zabbix_agentd.conf
      service zabbix-agent start

      is it ok now ?

      I don't change "ServerActive=127.0.0.1" in /etc/zabbix/zabbix_agentd.conf
      on agents, should it be changed ? I jusr define "Server=<my Zabbix server's ip> , is it not enough ?

      Thanks !!!!

      Comment

      • neogan
        Senior Member
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Sep 2011
        • 118

        #4
        Originally posted by natalia
        Hi,

        Thanks !

        I changed it to :

        rpm -ivh http://repo.zabbix.com/zabbix/2.0/rh...el6.noarch.rpm
        yum install zabbix-agent -y
        mv /etc/zabbix/zabbix_agentd.conf /etc/zabbix/zabbix_agentd.default
        sed 's/Server=127.0.0.1/Server=<my Zabbix server's ip>/' /etc/zabbix/zabbix_agentd.default > /etc/zabbix/zabbix_agentd.conf
        service zabbix-agent start

        is it ok now ?

        I don't change "ServerActive=127.0.0.1" in /etc/zabbix/zabbix_agentd.conf
        on agents, should it be changed ? I jusr define "Server=<my Zabbix server's ip> , is it not enough ?

        Thanks !!!!
        It enough for passive agents.
        Try to change sed to follow command:
        sed -e 's/Server=127.0.0.1/Server=<Your Server IP>/' -e 's/ServerActive=127.0.0.1/ServerActive=<Your Server IP>/' ./zabbix_agentd.conf.defaul > ./zabbix_agentd.conf.new

        Comment

        • natalia
          Senior Member
          • Apr 2013
          • 159

          #5
          Originally posted by neogan
          It enough for passive agents.
          Try to change sed to follow command:
          sed -e 's/Server=127.0.0.1/Server=<Your Server IP>/' -e 's/ServerActive=127.0.0.1/ServerActive=<Your Server IP>/' ./zabbix_agentd.conf.defaul > ./zabbix_agentd.conf.new
          Thanks a lot !
          Will change it

          Any other options that you suggest to define in zabbix_agentd.conf ?
          like "EnableRemoteCommands=1"

          Thanks !

          Comment

          • neogan
            Senior Member
            Zabbix Certified Trainer
            Zabbix Certified SpecialistZabbix Certified Professional
            • Sep 2011
            • 118

            #6
            If it necessary for you, you can ebable it.

            Comment

            • natalia
              Senior Member
              • Apr 2013
              • 159

              #7
              Originally posted by neogan
              If it necessary for you, you can ebable it.
              Ok, Thanks !

              Comment

              • PieterB
                Junior Member
                Zabbix Certified Specialist
                • Jul 2010
                • 25

                #8
                Puppet package?? You just create a recipe, this example for EL6:

                Code:
                class zabbix::agent {
                
                        file { [ "/etc/zabbix/", "/var/log/zabbix" ]:
                                ensure          => directory,
                                owner           => zabbix,
                                group           => zabbix,
                
                                mode            => 0755;
                
                                "/etc/zabbix/zabbix_agentd.conf":
                                owner           => zabbix,
                                group           => zabbix,
                                mode            => 0644,
                                notify          => Service["zabbix-agent"],
                                content         => template("zabbix/zabbix_agent.erb");
                
                                "/etc/zabbix/zabbix_agentd.userparams.conf":
                                owner           => zabbix,
                                group           => zabbix,
                                mode            => 0644,
                                notify          => Service["zabbix-agent"],
                                content         => template("zabbix/zabbix_agentd.userparams.erb");
                        }
                
                        file {  "/var/run/zabbix":
                                ensure          => directory,
                                owner           => zabbix,
                                group           => zabbix,
                                mode            => 0775;
                        }
                
                        sudo::file { 'zbx': }
                
                        service { 'zabbix-agent':
                                enable          => 'true',
                                hasstatus       => 'true',
                                hasrestart      => 'true',
                                pattern         => "/usr/sbin/zabbix_agentd",
                                ensure          => 'running',
                                require         => [File["/etc/zabbix/zabbix_agentd.conf"], Package["zabbix-agent"]],
                        }
                
                        package { "zabbix-agent":
                                ensure          => present,
                        }

                Comment

                • natalia
                  Senior Member
                  • Apr 2013
                  • 159

                  #9
                  Originally posted by PieterB
                  Puppet package?? You just create a recipe, this example for EL6:

                  Code:
                  class zabbix::agent {
                  
                          file { [ "/etc/zabbix/", "/var/log/zabbix" ]:
                                  ensure          => directory,
                                  owner           => zabbix,
                                  group           => zabbix,
                  
                                  mode            => 0755;
                  
                                  "/etc/zabbix/zabbix_agentd.conf":
                                  owner           => zabbix,
                                  group           => zabbix,
                                  mode            => 0644,
                                  notify          => Service["zabbix-agent"],
                                  content         => template("zabbix/zabbix_agent.erb");
                  
                                  "/etc/zabbix/zabbix_agentd.userparams.conf":
                                  owner           => zabbix,
                                  group           => zabbix,
                                  mode            => 0644,
                                  notify          => Service["zabbix-agent"],
                                  content         => template("zabbix/zabbix_agentd.userparams.erb");
                          }
                  
                          file {  "/var/run/zabbix":
                                  ensure          => directory,
                                  owner           => zabbix,
                                  group           => zabbix,
                                  mode            => 0775;
                          }
                  
                          sudo::file { 'zbx': }
                  
                          service { 'zabbix-agent':
                                  enable          => 'true',
                                  hasstatus       => 'true',
                                  hasrestart      => 'true',
                                  pattern         => "/usr/sbin/zabbix_agentd",
                                  ensure          => 'running',
                                  require         => [File["/etc/zabbix/zabbix_agentd.conf"], Package["zabbix-agent"]],
                          }
                  
                          package { "zabbix-agent":
                                  ensure          => present,
                          }

                  Great !
                  Thanks !

                  Comment

                  Working...