[ZBX-4889] gui scripts for disabled hosts do not work Created: 2012 Apr 18  Updated: 2017 May 30  Resolved: 2012 Apr 20

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 2.0.0rc1
Fix Version/s: 2.0.0rc4

Type: Incident report Priority: Major
Reporter: Oleksii Zagorskyi Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Caused by implementing ZBX-4296

As we know disabled hosts missing in the server configuration cache.
So, when gui tries to ask server to execute a script for a host which is disabled in gui, the server immediately responds with "red" ERROR:
Unknown Host ID [10054]

Debuglog shows (the hostid=10054 is disabled):
16049:20120418:203158.324 Trapper got [

{"request":"command","nodeid":0,"scriptid":"5","hostid":"10054"}

] len 64
16049:20120418:203158.324 In node_process_command()
16049:20120418:203158.324 In execute_script() scriptid:5 hostid:10054
16049:20120418:203158.324 End of execute_script():FAIL

For an enabled hostid=10017 Debuglog shows:
16049:20120418:203232.804 Trapper got [

{"request":"command","nodeid":0,"scriptid":"5","hostid":"10017"}

] len 64
16049:20120418:203232.804 In node_process_command()
16049:20120418:203232.804 In execute_script() scriptid:5 hostid:10017
16049:20120418:203232.804 In zbx_execute_script()
16049:20120418:203232.804 In DBget_script_by_scriptid()
16049:20120418:203232.804 query [txnlev:0] [select type,execute_on,command,groupid from scripts where scriptid=5]
16049:20120418:203232.804 End of DBget_script_by_scriptid():SUCCEED
16049:20120418:203232.804 In check_script_permissions() groupid:0 hostid:10017
16049:20120418:203232.804 End of check_script_permissions():SUCCEED
16049:20120418:203232.804 In substitute_simple_macros() data:'/usr/bin/fping -c2 -p20

{HOST.CONN}

2>&1'
16049:20120418:203232.804 End substitute_simple_macros() data:'/usr/bin/fping -c2 -p20 127.0.0.1 2>&1'
16049:20120418:203232.804 In zbx_execute_script()
16049:20120418:203232.804 In zbx_popen() command:'/usr/bin/fping -c2 -p20 127.0.0.1 2>&1'
16049:20120418:203232.804 End of zbx_popen():9
16049:20120418:203232.847 In zbx_waitpid()
16049:20120418:203232.847 zbx_waitpid() exited, status:0
16049:20120418:203232.847 End of zbx_waitpid():16100
16049:20120418:203232.847 End of zbx_execute_script():SUCCEED
16049:20120418:203232.847 End of zbx_execute_script():SUCCEED
16049:20120418:203232.847 End of execute_script():SUCCEED

I see two possible solutions:
1. discard changes in ZBX-4296 (bad)
2. allow server to not use configuration cache when executing gui scripts (good one)

But main question - how the ZBX-4296 has been tested before closing?



 Comments   
Comment by Alexander Vladishev [ 2012 Apr 20 ]

Fixed in the development branch svn://svn.zabbix.com/branches/dev/ZBX-4889

<zalex> Successfully tested.

Comment by dimir [ 2012 May 03 ]

Code reviewed.

Comment by Alexander Vladishev [ 2012 May 03 ]

Fixed in version pre-2.0.0rc4 r27273.

Generated at Fri Apr 19 11:53:31 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.