Ad Widget

Collapse

zabbix_get shows no return values? (windows)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BlackCrow
    Junior Member
    • Jul 2008
    • 4

    #1

    zabbix_get shows no return values? (windows)

    Hello!

    i´m trying to geht some information from an zabbix agent using the cmd tool "zabbix_get" - but no return value is shown?

    i used the following command:

    C:\Programme\zabbix>zabbix_get -s 172.16.183.22 -k system.uptime

    the return value is just an blank line?

    has anyone an idea?


    regards,
    BlackCrow

    ps: i know my english is not so good but i hope you understand my problem
  • trikke
    Senior Member
    • Aug 2007
    • 140

    #2
    Hi BC,

    this happens if either the Server u want to connect is not know to Zabbix ( try the zabbix hostname) or maybe an other port ?? or whatever!
    Anyway you could check the RC from the zabbix_get command ( echo $? ) if this is not 0, u know there is something wrong!

    Greets
    Patrick

    Comment

    • BlackCrow
      Junior Member
      • Jul 2008
      • 4

      #3
      hm i had a quick look at the source code :

      the red code line did not return "SUCCEED" (e.g. "0")

      Code:
      if (SUCCEED == (ret = zbx_tcp_connect(&s, host, port, SENDER_TIMEOUT))) {
      		zbx_snprintf(request, sizeof(request),"%s\n",key);
      		if( SUCCEED == (ret = zbx_tcp_send(&s, request)) )
      		{
      [COLOR="Red"]			if( SUCCEED == (ret = zbx_tcp_recv_ext(&s, &buf, ZBX_TCP_READ_UNTIL_CLOSE)) )[/COLOR]
      			{
      				zbx_rtrim(buf,"\r\n\0");
      				*value = strdup(buf);
      			}
      		}
      	}
      	zbx_tcp_close(&s);
      i think the problem in zbx_tcp_recv_ext function is that
      Code:
      nbytes = ZBX_TCP_READ(s->socket, s->buf_stat, left);
      returns also "0" - the application can´t read from the tcp socket?

      edit: i also tryed the hostname (of the machine where the zabbix agent runs) as an parameter!
      also with port number? i think it is an other problem but without any err codes from the "ZBX_TCP_READ" function...
      Last edited by BlackCrow; 28-07-2008, 14:27.

      Comment

      • trikke
        Senior Member
        • Aug 2007
        • 140

        #4
        just to be shure, the system u execute the zabbix_get command is also your Zabbix Server?
        I think the zabbix_get works only from the Server.

        Greets
        Patrick

        Comment

        • BlackCrow
          Junior Member
          • Jul 2008
          • 4

          #5
          no the machine on which i use the zabbix_get command is not the zabbix server - it´s a random winXP machine with the zabbix_get.exe (win32)

          i want to get the return value from an zabbix item WITHOUT the zabbix server!

          like this:

          (any pc) -- [zabbix_get to get one return value] --> (win2k3 with zabbix agent)

          Comment

          • trikke
            Senior Member
            • Aug 2007
            • 140

            #6
            Hi BC,

            as far as i remember it's got something to do with "security" resp. known server.
            You have to include the server name of the server where u use the zabbix_get in the Agent config ("Server=" parm). The agent will only satisfy to requests comming from the "known" Servers,

            Greets
            Patrick

            Comment

            • BlackCrow
              Junior Member
              • Jul 2008
              • 4

              #7
              Originally posted by trikke
              Hi BC,

              as far as i remember it's got something to do with "security" resp. known server.
              You have to include the server name of the server where u use the zabbix_get in the Agent config ("Server=" parm). The agent will only satisfy to requests comming from the "known" Servers,

              Greets
              Patrick
              Hi trikke !

              That was the Problem! I have added the IP from the machine where i want to use the zabbix_get.exe and it works great!

              You made my day

              Comment

              Working...