[ZBX-14328] More information about failed command execution in server log Created: 2018 May 07  Updated: 2024 Apr 10  Resolved: 2018 May 14

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 3.4.8, 4.0.0alpha6
Fix Version/s: 4.0.0alpha7, 4.0 (plan)

Type: Problem report Priority: Trivial
Reporter: Dmitrijs Lamberts Assignee: Vjaceslavs Bogdanovs
Resolution: Fixed Votes: 0
Labels: exitcodes
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File image-2020-03-29-21-34-07-617.png     PNG File image-2020-03-29-21-35-04-212.png     PNG File image-2020-03-29-21-36-41-555.png    
Issue Links:
Causes
caused by ZBXNEXT-1380 Zabbix server should check the return... Closed
Duplicate
Team: Team C
Team: Team C
Sprint: Sprint 33, Sprint 34
Story Points: 0.1

 Description   

https://www.zabbix.com/documentation/3.4/manual/appendix/command_execution

Any exit code that is different from 0 is considered as execution failure.

Possible frontend messages and log entries for failed commands/scripts:

Contents of standard error and standard output for failed executions (if any).
"Process exited with code: N." (for empty output, and exit code not equal to 0).
"Process killed by signal: N." (for process terminated by a signal, on Linux only).
"Process terminated unexpectedly." (for process terminated for unknown reasons).

If there is nothing in stderr, the corresponding line in Server log looks like:

Process exited with code: 1.

Which makes it impossible to understand what/where exactly failed without raising DebugLevel=4, and even then it is not possible to predict how much time will it take to catch actual issue.

Logline should contain information about what/where failed in DebugLevel=3



 Comments   
Comment by richlv [ 2018 Jun 18 ]

(1) This has been closed as fixed, but the exact changes are unclear - probably should be documented in the what's new page.

Comment by Oleksii Zagorskyi [ 2018 Jun 18 ]

According to svn diff, there was one line change:

-               zabbix_log(LOG_LEVEL_WARNING, "%s", error); 
+               zabbix_log(LOG_LEVEL_WARNING, "Failed to execute command \"%s\": %s", command, error);

So, the line now is more readable and contains the command itself.

Comment by pron [ 2019 Aug 08 ]

I belive this doesnt actualy work, when script timeouts without DebugLevel=4 it doesnt get logged at all.

Comment by Multazim Deshmukh [ 2020 Mar 29 ]

1) I have observed this issue twice in last one month. There were plenty of alerts generated and in few of those alerts, media script failed with following error. 

Process exited with code: 1.

There were no details on why exactly it failed. I wonder if change made in this ticket is actually working?

2) I am not sure if media was retried even though it is set to attempt 3 times.

 

3) I have configured my script to log each attempt and in log file i do see there were few failures. Looks like script was not able to take parameters due to plenty of simultaneous script calls. How do i solve this ?

 I would appreciate responses to my queries. Please reopen this ticket.  

Generated at Sat Apr 20 09:30:33 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.