[ZBX-10079] Document that system.run[] with "nowait" will always return 1 and immediately Created: 2015 Nov 13  Updated: 2017 May 30  Resolved: 2015 Dec 01

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Documentation (D), Frontend (F)
Affects Version/s: 2.4.7rc1
Fix Version/s: 3.0.0alpha5

Type: Incident report Priority: Trivial
Reporter: Oleksii Zagorskyi Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: system.run
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

(1)
Appeared to be not documented at all what is not very good.
Suggest page https://www.zabbix.com/documentation/2.4/manual/config/items/itemtypes/zabbix_agent

Suggested text:
In case of <mode> defined as "nowait" the key immediately returns just "1", disregarding of command execution results.

Zabbix agent 2.4.7rc1:

  7597:20151113:150504.035 listener #1 [processing request]
  7597:20151113:150504.035 Requested [system.run[sleep 3, nowait]]
  7597:20151113:150504.035 Executing command 'sleep 3'
  7597:20151113:150504.040 Sending back [1]
  7597:20151113:150504.040 listener #1 [waiting for connection]

(2)
Also, another thing. Looking at https://www.zabbix.com/documentation/2.4/manual/appendix/command_execution and reading first sentence I feel that something is wrong.
Is that correct that "remote commands" are included to the list ?

As I know they are executed used "nowait" flag, so it's wrong to include them to the list, IMO.
https://www.zabbix.com/documentation/2.4/manual/config/notifications/action/operation/remote_command



 Comments   
Comment by richlv [ 2015 Nov 14 ]

regarding remote command execution (2), agent does return 1 for nowait requests, but the actual invoking of the command still follows the same general principles as documented in that page

zalex_ua You are correct as for steps 1-4 in the list, but for following steps 5-7 it's not true because with "nowait" the command is not limited by time execution and is not terminated, I've just checked this point.
So to fix this details in documentation now I suggest to add a step 4.1. as "following steps are not actual for remote commands, as they are executed “nowait” flag"

<richlv> ah, indeed - overlooked a bit of detail. thanks for spotting that

Comment by Martins Valkovskis [ 2015 Nov 16 ]

(1) Updated documentation:

Please review.

zalex_ua Pretty short and clear, thanks. May be closed, but see please discussion (2) above.

martins-v CLOSED

Comment by Martins Valkovskis [ 2015 Nov 17 ]

(2) See the new version of https://www.zabbix.com/documentation/2.4/manual/appendix/command_execution.

zalex_ua Perfect, can be replicated to other doc versions and closed.

martins-v Replicated.

CLOSED

Comment by Andrey Zaslavskiy [ 2015 Nov 27 ]

What about backporting this to older versions?

Comment by richlv [ 2015 Nov 28 ]

andyzasl, what exactly would you like to see backported ?

Comment by richlv [ 2015 Nov 28 ]

(3) let's unify the clarified item description with the frontend item key helper, too

<richlv> resolved for trunk in svn://svn.zabbix.com/branches/dev/ZBX-10079
proposing not to do that for other branches as it changes a translatable string

asaveljevs Looks good. CLOSED.

Comment by Andrey Zaslavskiy [ 2015 Nov 28 ]

I've find that nowait option doesn't work in last 2.4 release, but i can't find any patch info about it was made working in 2.4.8rc1

Comment by Andrey Zaslavskiy [ 2015 Nov 28 ]

Ah, sorry, didn't see that this bug in frontend related

Comment by richlv [ 2015 Nov 28 ]

nowait should work properly & as documented - maybe you have a syntax error or a similar problem, but i'd suggest discussing that in one of the channels listed in https://zabbix.org/wiki/Getting_help (irc usually works well )

Comment by richlv [ 2015 Nov 29 ]

(4) translation string changes :

removed string :

  • Run specified command on the host. Returns text result of the command

added string :

  • Run specified command on the host. Returns text result of the command; 1 - with mode as nowait (regardless of command result)

asaveljevs CLOSED

Generated at Fri Apr 19 01:14:07 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.