Ad Widget

Collapse

zabbix_get / no return value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kai
    Junior Member
    • Aug 2009
    • 10

    #1

    zabbix_get / no return value

    hi colleagues,

    last week I installed zabbix (version 1.6.5) on OpenSuse 11.1 and now there is one server (runnin server and agentd daemons) and one client with an agentd to learn more about zabbix.

    When I read in the forum I saw some hints about zabbix_get.

    And therefore I tried it :
    ---------------
    /usr/local/zabbix/sbin/zabbix_get -s 127.0.0.1 -p 10050 -k"vfs.fs.size[/,free]"
    ----------------

    But I got no return value from the command "zabbix_get"

    After RETURN I got only an empty line (zabbix account) and the command prompt (root account) respectively

    In the WEB interface I can see the values.

    Is there some who knows of the problem.

    regards, Kai
  • Kai
    Junior Member
    • Aug 2009
    • 10

    #2
    ok, more information and experiences

    /usr/local/zabbix/sbin/zabbix_get -s XXX.XXX.XXX.XXX -p 10050 -k"vfs.fs.size[/,free]"

    works on the zabbix server but not on the zabbix client .....

    regards, Kai

    Comment

    • Calimero
      Senior Member
      • Nov 2006
      • 481

      #3
      In zabbix_agentd.conf Server= must contain the IP of the server or else agent will drop incoming connections (from unknown hosts).

      Comment

      • Kai
        Junior Member
        • Aug 2009
        • 10

        #4
        in the two /etc/zabbix/zabbix_agentd.conf files (server and client) the Server parameter ist set to the IP Adress of the zabbix Server.

        On the server I get a value by the zabbix_get command but only an empty line
        on the client

        regards, Kai

        Comment

        • nelsonab
          Senior Member
          Zabbix Certified SpecialistZabbix Certified Professional
          • Sep 2006
          • 1233

          #5
          The Zabbix agent will reject any connections from an IP address other than the Zabbix server. That's what Calimero was referring to. If you want to be able to use Zabbix_get from the client you'd need to add the client IP as a server.
          RHCE, author of zbxapi
          Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
          Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

          Comment

          • Calimero
            Senior Member
            • Nov 2006
            • 481

            #6
            Originally posted by Kai
            On the server I get a value by the zabbix_get command but only an empty line
            on the client
            If your hosts are multi-homed (many eth interfaces with different IPs), you have to make sure that zabbix_agentd accepts incoming connections from the right IP / right subnet.

            You can set multiple source IP/servers that zabbix_agentd will accept to respond to:
            Server=IP1,IP2,IP3,...

            Comment

            • nelsonab
              Senior Member
              Zabbix Certified SpecialistZabbix Certified Professional
              • Sep 2006
              • 1233

              #7
              There is also a -I option for source address.
              RHCE, author of zbxapi
              Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
              Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

              Comment

              • Kai
                Junior Member
                • Aug 2009
                • 10

                #8
                that's it

                I changed the "Server=" line in the zabbix_agentd.conf file to

                Server=IP-Client,IP-Server

                and it works

                Thanks for the help
                Kai
                P.S. I think it will be not the last question from me ;-)

                Comment

                • NOB
                  Senior Member
                  Zabbix Certified Specialist
                  • Mar 2007
                  • 469

                  #9
                  Originally posted by Kai
                  that's it

                  I changed the "Server=" line in the zabbix_agentd.conf file to

                  Server=IP-Client,IP-Server

                  and it works

                  Thanks for the help
                  Kai
                  P.S. I think it will be not the last question from me ;-)
                  Sure, there will be another question from you:

                  Simply because the IP-addresses on the
                  Code:
                  Server=
                  line are in the wrong order for active checks. So active checks
                  won't work
                  .

                  You should put the IP-address of the ZABBIX-Server always first
                  in the line. This is the IP-address where all active checks are send to
                  and the list of active checks are retrieved from.
                  As you might have noticed, the zabbix_get is almost useless on
                  the agent. Why would you want to put a client IP address on the
                  Server= line in the configuration ?
                  Why this application is only created if you run ./configure --enable-agent is beyond my imagination
                  and just confuses newbies ;-)

                  Regards

                  Norbert.

                  Comment

                  • Kai
                    Junior Member
                    • Aug 2009
                    • 10

                    #10
                    I noticed the wrong order of the ip adresses
                    After changing active checks works

                    When I left only the IP adress of the Zabbix Server in the SERVER= line
                    some other error messages in the zabbix_server.log disappeared.

                    thanks for help
                    Kai

                    Comment

                    • par
                      Junior Member
                      Zabbix Certified Specialist
                      • Nov 2006
                      • 21

                      #11
                      zabbix_get is the only way to test UserParameter - which i have found the hard way.

                      I guess that's why it's included in --enable-agent

                      However, you must not forget to add 127.0.0.1 as second ip address in servers list, AND, make sure you have passive checks enabled and listening on 127.0.0.1.

                      Comment

                      Working...