I did a new test with different waiting times (0, 1, 2, 5, 10, 0 and 1s) only the last try was successful and the call has returned the value 5.
I've attached the captured ssh communication which was done localy only (from agent on the same RPi) therefore the network cannot be the source of the problem.
I've attached the source of my test program, but it is very simple.
Here is the filtered agent log (the full log is attached):
2020.04.15 09:03:24.435 *D* [comm.cs.1 ] Requesting list "SSH.Command(192.168.18.134,"pi","raspberry","/opt/disp_ctrl/mon_c 0 5")"
2020.04.15 09:03:24.736 *D* [ ] SSH: created new session
[email protected]:22/1
2020.04.15 09:03:24.841 *D* [comm.cs.1 ] GetListValue(): result is 500 (INTERNAL_ERROR)
--
2020.04.15 09:03:34.496 *D* [comm.cs.1 ] Requesting list "SSH.Command(192.168.18.134,"pi","raspberry","/opt/disp_ctrl/mon_c 1 5")"
2020.04.15 09:03:34.496 *D* [ ] SSH: acquired existing session
[email protected]:22/1
2020.04.15 09:03:35.517 *D* [comm.cs.1 ] GetListValue(): result is 500 (INTERNAL_ERROR)
--
2020.04.15 09:03:42.637 *D* [comm.cs.1 ] Requesting list "SSH.Command(192.168.18.134,"pi","raspberry","/opt/disp_ctrl/mon_c 2 5")"
2020.04.15 09:03:42.637 *D* [ ] SSH: acquired existing session
[email protected]:22/1
2020.04.15 09:03:44.657 *D* [comm.cs.1 ] GetListValue(): result is 500 (INTERNAL_ERROR)
--
2020.04.15 09:03:52.416 *D* [comm.cs.1 ] Requesting list "SSH.Command(192.168.18.134,"pi","raspberry","/opt/disp_ctrl/mon_c 5 5")"
2020.04.15 09:03:52.416 *D* [ ] SSH: acquired existing session
[email protected]:22/1
2020.04.15 09:03:57.436 *D* [comm.cs.1 ] GetListValue(): result is 500 (INTERNAL_ERROR)
--
2020.04.15 09:04:03.635 *D* [comm.cs.1 ] Requesting list "SSH.Command(192.168.18.134,"pi","raspberry","/opt/disp_ctrl/mon_c 10 5")"
2020.04.15 09:04:03.635 *D* [ ] SSH: acquired existing session
[email protected]:22/1
2020.04.15 09:04:03.917 *D* [comm.cs.1 ] Received message CMD_KEEPALIVE (146)
2020.04.15 09:04:13.656 *D* [comm.cs.1 ] GetListValue(): result is 500 (INTERNAL_ERROR)
--
2020.04.15 09:04:20.165 *D* [comm.cs.1 ] Requesting list "SSH.Command(192.168.18.134,"pi","raspberry","/opt/disp_ctrl/mon_c 0 5")"
2020.04.15 09:04:20.165 *D* [ ] SSH: acquired existing session
[email protected]:22/1
2020.04.15 09:04:20.185 *D* [comm.cs.1 ] GetListValue(): result is 500 (INTERNAL_ERROR)
--
2020.04.15 09:04:29.965 *D* [comm.cs.1 ] Requesting list "SSH.Command(192.168.18.134,"pi","raspberry","/opt/disp_ctrl/mon_c 1 5")"
2020.04.15 09:04:29.966 *D* [ ] SSH: acquired existing session
[email protected]:22/1
2020.04.15 09:04:30.986 *D* [comm.cs.1 ] GetListValue(): result is 0 (SUCCESS)
ssh.pcap
mon_c.c
nxagentd