ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Zabbix Agent Install Script

    IT Discussion
    zabbix installation script
    7
    22
    6.2k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • dafyreD
      dafyre
      last edited by dafyre

      Hi All...
      This update is a major rewrite of the original post... The individual files can be found at

      https://gitlab.wellston.biz/dafyre/zabbix-utils

      The script is still located https://gitlab.wellston.biz/dafyre/zabbix-utils/raw/master/zabbix-agent-installer

      zabbix-agent-installer

      This assumes that you have the basic development tools installed on your system, as we will be building the Zabbix agent from source.

      Ubuntu:

      sudo apt-get install build-essential

      RHEL / RPM based Distros:
      sudo yum groupinstall Development

      SuSE / openSuSE / Tumbleweed
      sudo zypper install -t pattern devel_C_C++

      Should dake care of the necessary dependencies.

      There are several variables in this script that should be set for your environment.

      Any of the HTTP based URLs can be left as is to pull the most recent versions, or they can be changed to be hosted on your own servers.

      AGENT_URL is the URL of the Zabbix source code that is running the same version of Zabbix that is running on your server. This can be left as is to pull Zabbix 3.0.3 sources.

      AGENT_CONFIG is the zabbix_agentd configuration template that will be used (the default pulls form the git repo).

      AGENT_SERVICE is the web url to the systemd service file for the zabbix_agentd.

      ZABBIX_SERVER is the IP address or hostname of your Zabbix server.

      Windows Agents

      The windows agents come pre-compiled, and I have included both 32 bit and 64 bit agents as .zip files.

      32 Bit Agent: https://gitlab.wellston.biz/dafyre/zabbix-utils/raw/master/zabbix_win_agent32.zip
      64 Bit Agent: https://gitlab.wellston.biz/dafyre/zabbix-utils/raw/master/zabbix_win_agent64.zip

      1. Extract the files into C:\zabbix_agent

      2. Edit the zabbix_agentd.conf file and make sure to set Server= and ServerActive= to be the IP address of your Zabbix server. (this file is best edited with Notepad++)

      3. The win-service-setup.bat file needs to be run as administrator.

      original post follows
      Hi All...

      NOTE This only installs the Zabbix AGENT. It does not install the Zabbix Server. A separate script for that will be coming soon.

      I've got a Zabbix Agent install script that will install the agent from source (I tend to install the Zabbix server bits from source as well, to keep with the most recent versions).

      It assumes that you have all of the necessary dependencies to build the Zabbix Agent on the target system.

      https://gitlab.wellston.biz/dafyre/zabbix-utils/blob/master/zabbix-agent-installer

      I have more comments in the code. If you have any questions or recommendations on it, please let me know!

      I have tested this with Ubuntu 16.04. Plannting to test with others later.

      Edit: The installer works on Ubuntu 16.04 and CentOS assuming you have done apt-get install build-essential on Ubuntu or yum groupinstall Development on CentOS

      Edit 2: Direct download is here: https://gitlab.wellston.biz/dafyre/zabbix-utils/raw/master/zabbix-agent-installer

      Edit 3: This script is meant to be run as root or via sudo!

      1 Reply Last reply Reply Quote 2
      • DustinB3403D
        DustinB3403
        last edited by

        Why aren't you installing to a folder under /opt ?

        such as /opt/zabbix

        1 Reply Last reply Reply Quote 0
        • dafyreD
          dafyre
          last edited by

          Because /usr/local has always served that purpose for me?

          I don't have to worry about modding other files (say in /etc) to get the commands be in the path variable.. (On most distros, /usr/local/bin and /usr/local/sbin are already in $PATH).

          1 Reply Last reply Reply Quote 0
          • DustinB3403D
            DustinB3403
            last edited by

            Ok but it's weird, applications get installed under /opt/<some folder>

            dafyreD 1 Reply Last reply Reply Quote 0
            • dafyreD
              dafyre @DustinB3403
              last edited by

              @DustinB3403 said in Zabbix Agent Install Script:

              Ok but it's weird, applications get installed under /opt/<some folder>

              Only if you pass the right flags to configure.

              That may be something I could try for my next re-write, lol.

              1 Reply Last reply Reply Quote 0
              • DustinB3403D
                DustinB3403
                last edited by

                You almost have it, you just need to change your target directories and it should work just fine.

                dafyreD 1 Reply Last reply Reply Quote 0
                • DustinB3403D
                  DustinB3403
                  last edited by

                  Which dependencies are required prior to starting this script?

                  1 Reply Last reply Reply Quote 0
                  • dafyreD
                    dafyre @DustinB3403
                    last edited by dafyre

                    @DustinB3403 said in Zabbix Agent Install Script:

                    You almost have it, you just need to change your target directories and it should work just fine.

                    It already works just fine on Ubuntu and CentOS after a
                    apt-get install build-essential or

                    yum groupinstall Development.

                    🙂

                    DustinB3403D 1 Reply Last reply Reply Quote 0
                    • DustinB3403D
                      DustinB3403 @dafyre
                      last edited by

                      @dafyre said in Zabbix Agent Install Script:

                      @DustinB3403 said in Zabbix Agent Install Script:

                      You almost have it, you just need to change your target directories and it should work just fine.

                      It already works just fine on Ubuntu and CentOS after a
                      apt-get install build-essential or

                      yum groupinstall Development.

                      🙂

                      So why not just put that into the installer script at the top?

                      sudo apt-get install build-essential --yes
                      
                      dafyreD 1 Reply Last reply Reply Quote 0
                      • dafyreD
                        dafyre @DustinB3403
                        last edited by dafyre

                        @DustinB3403 said in Zabbix Agent Install Script:

                        @dafyre said in Zabbix Agent Install Script:

                        @DustinB3403 said in Zabbix Agent Install Script:

                        You almost have it, you just need to change your target directories and it should work just fine.

                        It already works just fine on Ubuntu and CentOS after a
                        apt-get install build-essential or

                        yum groupinstall Development.

                        🙂

                        So why not just put that into the installer script at the top?

                        sudo apt-get install build-essential --yes
                        

                        Because if I do that, the script barfs errors all over the place if it is run on a Non-Debian distro. 🙂

                        Edit: This is one of the things I plan to fix.

                        1 Reply Last reply Reply Quote 0
                        • DustinB3403D
                          DustinB3403
                          last edited by

                          Also sloppy to use a static IP in the script.

                          dafyreD A 2 Replies Last reply Reply Quote 0
                          • dafyreD
                            dafyre @DustinB3403
                            last edited by

                            @DustinB3403 said in Zabbix Agent Install Script:

                            Also sloppy to use a static IP in the script.

                            I don't have internal DNS for this, and you will see that it is a variable you can change.

                            During our chat, I realized that I made no mention of adjusting the variables for your environment. I'll add some documentation to it for clarification.

                            1 Reply Last reply Reply Quote 1
                            • A
                              Alex Sage @DustinB3403
                              last edited by

                              @DustinB3403 said in Zabbix Agent Install Script:

                              Also sloppy to use a static IP in the script.

                              Is it, or is it smart? If DNS is down, don't all your server show as down?

                              DustinB3403D dafyreD 2 Replies Last reply Reply Quote 1
                              • DustinB3403D
                                DustinB3403 @Alex Sage
                                last edited by

                                @aaronstuder said in Zabbix Agent Install Script:

                                @DustinB3403 said in Zabbix Agent Install Script:

                                Also sloppy to use a static IP in the script.

                                Is it, or is it smart? If DNS is down, don't all your server show as down?

                                For a public script it's sloppy, even @dafyre agreed. Its fine to be there, but it can't resolve to an internal DNS for the installation of the system. Because it's not internal for you, but internal for @dafyre

                                dafyreD 1 Reply Last reply Reply Quote 0
                                • dafyreD
                                  dafyre @DustinB3403
                                  last edited by

                                  @DustinB3403 said in Zabbix Agent Install Script:

                                  @aaronstuder said in Zabbix Agent Install Script:

                                  @DustinB3403 said in Zabbix Agent Install Script:

                                  Also sloppy to use a static IP in the script.

                                  Is it, or is it smart? If DNS is down, don't all your server show as down?

                                  For a public script it's sloppy, even @dafyre agreed. Its fine to be there, but it can't resolve to an internal DNS for the installation of the system. Because it's not internal for you, but internal for @dafyre

                                  It's been fixed anyhow. 🙂 Now defaults to 127.0.0.1, I think.

                                  1 Reply Last reply Reply Quote 1
                                  • dafyreD
                                    dafyre @Alex Sage
                                    last edited by

                                    @aaronstuder said in Zabbix Agent Install Script:

                                    @DustinB3403 said in Zabbix Agent Install Script:

                                    Also sloppy to use a static IP in the script.

                                    Is it, or is it smart? If DNS is down, don't all your server show as down?

                                    Aaron does have a point in this. The good news is that the zabbix server contacts machines back via IP address when they are auto registered in the system.

                                    1 Reply Last reply Reply Quote 0
                                    • C
                                      cronsloth
                                      last edited by

                                      Topic has been unattended for some time, but all your github links are giving me 404 errors...

                                      I'm sure you are aware of this, but just in-case.. I wanted to check out your agent installer for windows scripts.

                                      cheers.

                                      dbeatoD 1 Reply Last reply Reply Quote 0
                                      • dbeatoD
                                        dbeato @cronsloth
                                        last edited by

                                        @cronsloth If you are looking for WIndows Zabbix agents, I have some scripts here;
                                        https://community.spiceworks.com/scripts/show/3985-zabbix-32-bits-client-installation

                                        https://community.spiceworks.com/scripts/show/3984-zabbix-64-bits-client-installation

                                        Just make sure to have the latest agent files.

                                        1 Reply Last reply Reply Quote 0
                                        • coliverC
                                          coliver
                                          last edited by

                                          There is also a msi out there that you can compile yourself. Makes it a lot easier.

                                          scottalanmillerS 1 Reply Last reply Reply Quote 0
                                          • scottalanmillerS
                                            scottalanmiller @coliver
                                            last edited by

                                            @coliver said in Zabbix Agent Install Script:

                                            There is also a msi out there that you can compile yourself. Makes it a lot easier.

                                            Compile yourself?

                                            coliverC 1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • First post
                                              Last post