Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-11452

confused with the ssh_run function implementation

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Won't fix
    • Icon: Minor Minor
    • None
    • 3.2.1
    • Proxy (P), Server (S)
    • None

      I have downloaded zabbix-3.2.1.tar.gz from official link, and had a test with zabbix_appliance(3.2.1) that ssh agent item worked fine.
      I looked through the checks_ssh.c, and found that:

      libssh2_session_set_blocking(session, 1); //line 109
      ...
      /* exec non-blocking on the remove host */ //line 230
      	while (NULL == (channel = libssh2_channel_open_session(session)))
      	{
      		switch (libssh2_session_last_error(session, NULL, NULL, 0))
      		{
      			/* marked for non-blocking I/O but the call would block. */
      			case LIBSSH2_ERROR_EAGAIN:
      				waitsocket(s.socket, session);
      				continue;
      			default:
      				SET_MSG_RESULT(result, zbx_strdup(NULL, "Cannot establish generic session channel"));
      				goto session_close;
      		}
      	}
      

      I'm confused to the above codes, which mode do we use, non-blocking or blocking? In blocking mode, we need waitsocket()?

            Unassigned Unassigned
            karlh karlhan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: