ZABBIX SUPPORT https://support.zabbix.com/issues/?jql=labels+%3D+externalchecks An XML representation of a search request en-us 9.12.4 9120004 12-02-2024 RE: [ZBXNEXT-6406] Do not require Host Interface for External / Simple Checks https://support.zabbix.com/browse/ZBXNEXT-6406?focusedId=694484#comment-694484 Tue, 7 Mar 2023 11:41:23 +0200 Konstantins Prutkovs <p><b>Documentation changed</b>:</p> <ul class="alternate" type="square"> <li>What's new: <a href="https://www.zabbix.com/documentation/6.4/en/manual/introduction/whatsnew640#interface-not-required-for-some-checks" class="external-link" target="_blank" rel="nofollow noopener">6.4.0</a></li> <li><a href="https://www.zabbix.com/documentation/6.4/en/manual/config/items/itemtypes/ssh_checks#item-configuration" class="external-link" target="_blank" rel="nofollow noopener">SSH checks</a> (updated screenshot)</li> <li>API: <ul class="alternate" type="square"> <li><a href="https://www.zabbix.com/documentation/6.4/en/manual/api/changes#discoveryrule" class="external-link" target="_blank" rel="nofollow noopener">Appendix 2. Changes from 6.2 to 6.4</a></li> <li><a href="https://www.zabbix.com/documentation/6.4/en/manual/api/reference/item/object#item-object" class="external-link" target="_blank" rel="nofollow noopener">Item object</a></li> <li><a href="https://www.zabbix.com/documentation/6.4/en/manual/api/reference/itemprototype/object#item-prototype-object" class="external-link" target="_blank" rel="nofollow noopener">Item prototype object</a></li> <li><a href="https://www.zabbix.com/documentation/6.4/en/manual/api/reference/discoveryrule/object#lld-rule-object" class="external-link" target="_blank" rel="nofollow noopener">LLD rule object</a></li> </ul> </li> </ul> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=JIRAUSER59656">Konstantins Prutkovs</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-6406">ZBXNEXT-6406</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=JIRAUSER60969">Arturs Dancis</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-6406?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=694484\#worklog-694484 RE: [ZBXNEXT-6406] Do not require Host Interface for External / Simple Checks https://support.zabbix.com/browse/ZBXNEXT-6406?focusedId=717449#comment-717449 Tue, 4 Oct 2022 16:19:01 +0300 Rostislav Palivoda <p>Disabled interface fixed in <a href="https://support.zabbix.com/browse/ZBX-21000" title="Can&#39;t update Host Interface on Items from Templates since update from 6.02 to 6.04" class="issue-link" data-issue-key="ZBX-21000"><del>ZBX-21000</del></a>. 6.4beta2 not released yet. </p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=palivoda">Rostislav Palivoda</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-6406">ZBXNEXT-6406</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-6406?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=717449\#worklog-717449 RE: [ZBXNEXT-6406] Do not require Host Interface for External / Simple Checks https://support.zabbix.com/browse/ZBXNEXT-6406?focusedId=716594#comment-716594 Sun, 2 Oct 2022 05:50:12 +0300 Alekz <p>Yes, I have the same problem on both 6.4alpha1 and 6.4.0beta1.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=JIRAUSER61712">Alekz</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-6406">ZBXNEXT-6406</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-6406?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=716594\#worklog-716594 RE: [ZBXNEXT-6406] Do not require Host Interface for External / Simple Checks https://support.zabbix.com/browse/ZBXNEXT-6406?focusedId=711645#comment-711645 Tue, 20 Sep 2022 18:53:03 +0300 Dave Mommers <p>I had an issue today, probably caused by this function.</p> <p>When I detached and then re-attached the "Template Module ICMP Ping" template the 3 items come back as "not supported" stating "Ping item must have target or host interface specified". When looking at the item at host level there is indeed no interface present </p> <p><span class="image-wrap" style=""><img src="https://support.zabbix.com/secure/attachment/181190/181190_item-level.png" style="border: 0px solid black" /></span></p> <p><span class="image-wrap" style=""><img src="https://support.zabbix.com/secure/attachment/181194/181194_host-item-level.png" style="border: 0px solid black" /></span></p> <p>I can't change the value of "host interface".</p> <p>But, when I look at the host, an interface is present!</p> <p><span class="image-wrap" style=""><img src="https://support.zabbix.com/secure/attachment/181188/181188_host-info.png" style="border: 0px solid black" /></span></p> <p>So it seems it ignores the already present interfaces on host level.</p> <p> </p> <p>*Edit</p> <p>Running on Zabbix version 6.4 alpha 1</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=incama">Dave Mommers</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-6406">ZBXNEXT-6406</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=incama">Dave Mommers</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-6406?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=711645\#worklog-711645 RE: [ZBXNEXT-6406] Do not require Host Interface for External / Simple Checks https://support.zabbix.com/browse/ZBXNEXT-6406?focusedId=694483#comment-694483 Mon, 8 Aug 2022 10:57:32 +0300 Konstantins Prutkovs <p>Released <a href="https://support.zabbix.com/browse/ZBXNEXT-6406" title="Do not require Host Interface for External / Simple Checks" class="issue-link" data-issue-key="ZBXNEXT-6406"><del>ZBXNEXT-6406</del></a> in:</p> <ul class="alternate" type="square"> <li><b>pre-6.4.0alpha1 (master)</b> <a href="https://git.zabbix.com/projects/ZBX/repos/zabbix/commits/9c77be38172296bceb6e159bcc21ce7952cec8a3" class="external-link" target="_blank" rel="nofollow noopener">9c77be38172</a></li> </ul> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=JIRAUSER59656">Konstantins Prutkovs</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-6406">ZBXNEXT-6406</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=JIRAUSER59656">Konstantins Prutkovs</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-6406?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=694483\#worklog-694483 RE: [ZBXNEXT-6406] Do not require Host Interface for External / Simple Checks https://support.zabbix.com/browse/ZBXNEXT-6406?focusedId=688768#comment-688768 Mon, 1 Aug 2022 16:22:20 +0300 Konstantins Prutkovs <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=kprutkovs" class="user-hover" rel="kprutkovs">kprutkovs</a> implemented in <a href="https://git.zabbix.com/projects/ZBX/repos/zabbix/pull-requests/4117" class="external-link" target="_blank" rel="nofollow noopener">feature/ZBXNEXT-6406-6.1</a></p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=JIRAUSER59656">Konstantins Prutkovs</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-6406">ZBXNEXT-6406</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=JIRAUSER59656">Konstantins Prutkovs</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-6406?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=688768\#worklog-688768 RE: [ZBXNEXT-6406] Do not require Host Interface for External / Simple Checks https://support.zabbix.com/browse/ZBXNEXT-6406?focusedId=676176#comment-676176 Sat, 18 Jun 2022 11:58:00 +0300 Pimmetje <p>Maybe it's also good to think about having a item were the data is gathered by another host.</p> <p> </p> <p>For example. If u have a UPS with USB and IP. It would be nice to display the items gathered by a host where the USB is connected on the UPS host. This makes it more transparent for the user to find the needed data.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=pimmetje">Pimmetje</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-6406">ZBXNEXT-6406</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-6406?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=676176\#worklog-676176 RE: [ZBX-20844] External check times out when Zabbix server is stopped. https://support.zabbix.com/browse/ZBX-20844?focusedId=655464#comment-655464 Thu, 21 Apr 2022 09:37:49 +0300 Vladislavs Sokurenko <p>Fixed in:</p> <ul> <li><b>pre-4.0.40rc1</b> <a href="https://git.zabbix.com/projects/ZBX/repos/zabbix/commits/f6c93ddc5b8a9a210d3c6b9594864e5826b19302" class="external-link" target="_blank" rel="nofollow noopener">f6c93ddc5b8</a></li> <li><b>pre-5.0.23rc1</b> <a href="https://git.zabbix.com/projects/ZBX/repos/zabbix/commits/e8798f321266b45a3fafa7c2ac2e77d365b53d7a" class="external-link" target="_blank" rel="nofollow noopener">e8798f32126</a></li> <li><b>pre-6.0.4rc1</b> <a href="https://git.zabbix.com/projects/ZBX/repos/zabbix/commits/21804cd5d791ba486df6af22f8bd47edad3d3d06" class="external-link" target="_blank" rel="nofollow noopener">21804cd5d79</a></li> <li><b>pre-6.2.0alpha1 (master)</b> <a href="https://git.zabbix.com/projects/ZBX/repos/zabbix/commits/26b118e2bc524838876f6031bbbb34703b90037c" class="external-link" target="_blank" rel="nofollow noopener">26b118e2bc5</a></li> </ul> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso">Vladislavs Sokurenko</a> (<a href="https://support.zabbix.com/browse/ZBX-20844">ZBX-20844</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-20844?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=655464\#worklog-655464 RE: [ZBXNEXT-6406] Do not require Host Interface for External / Simple Checks https://support.zabbix.com/browse/ZBXNEXT-6406?focusedId=595684#comment-595684 Wed, 3 Nov 2021 11:33:40 +0200 Yurii Polenok <p>We are also forced to create dummy interfaces for hosts with only one "External check" item.<br/> Please remove this unnecessary requirement.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=JIRAUSER53277">Yurii Polenok</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-6406">ZBXNEXT-6406</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-6406?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=595684\#worklog-595684 RE: [ZBXNEXT-2904] Option to securely pass sensitive arguments to External check and User parameter https://support.zabbix.com/browse/ZBXNEXT-2904?focusedId=526193#comment-526193 Thu, 8 Apr 2021 04:53:34 +0300 Justin Addams <p>If I understand correctly, this is still an issue experienced even when using the new secure macros?</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=justinaddams">Justin Addams</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-2904">ZBXNEXT-2904</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-2904?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=526193\#worklog-526193 RE: [ZBX-12963] Unable to pass $ sign to external check https://support.zabbix.com/browse/ZBX-12963?focusedId=261531#comment-261531 Fri, 2 Nov 2018 21:32:13 +0200 richlv <p><b>(1)</b> the what's new entry at <a href="https://zabbix.com/documentation/4.0/manual/introduction/whatsnew400" class="external-link" target="_blank" rel="nofollow noopener">https://zabbix.com/documentation/4.0/manual/introduction/whatsnew400</a> says :</p> <blockquote><p>Upon completion of an external check script, arguments are wrapped to single quotes ' instead of double quotes ". This change allows Zabbix to accept more signs in an external check parameter's name. For example, the $ sign is no longer ignored.</p></blockquote> <p>three potential issues here :</p> <ul> <li>"completion" seems wrong - shouldn't this be "running", "invocation" or similar ?</li> <li>"an external check parameter's name" - shouldn't this be "external check parameters" ?</li> <li>"$" was not ignored before, but interpreted by the shell</li> </ul> <p>it might be worth also changing "wrapped to" to "wrapped in", and maybe changing "sign" to more common "character" or "symbol".</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=martins-v" class="user-hover" rel="martins-v">martins-v</a> Thanks, <a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=richlv" class="user-hover" rel="richlv">richlv</a> for the useful suggestions. The <a href="https://zabbix.com/documentation/4.0/manual/introduction/whatsnew400#external_script_argument_wrapping" class="external-link" target="_blank" rel="nofollow noopener">wording</a> has been updated. RESOLVED</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=sasha" class="user-hover" rel="sasha">sasha</a> CLOSED</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=richlv">richlv</a> (<a href="https://support.zabbix.com/browse/ZBX-12963">ZBX-12963</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=sasha">Alexander Vladishev</a></td> </tr> </table> https://support.zabbix.com/browse/ZBX-12963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=261531\#worklog-261531 RE: [ZBXNEXT-4761] Zabbix Item Type External Check wraps each argument in quotation marks, which breaks PowerShell Core https://support.zabbix.com/browse/ZBXNEXT-4761?focusedId=295146#comment-295146 Thu, 27 Sep 2018 10:58:58 +0300 Marco Hofmann <p>Thank you very much, for moving my Request into the right Tracker!</p> <p>&#8211;</p> <p>"You can process arguments with quotes using the capabilities of a powershell script."</p> <p>I'm a PowerShell beginner, as far as I found out, arguments in quotes won't get parsed into the script, but if I'm wrong I would gladly correct myself.</p> <p>The Bash Wrapper script to strip the quotation marks down is overhead, but works very well!</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=starko">Marco Hofmann</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-4761">ZBXNEXT-4761</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-4761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=295146\#worklog-295146 RE: [ZBXNEXT-4761] Zabbix Item Type External Check wraps each argument in quotation marks, which breaks PowerShell Core https://support.zabbix.com/browse/ZBXNEXT-4761?focusedId=287788#comment-287788 Fri, 10 Aug 2018 16:51:27 +0300 Edgar Akhmetshin <p>Hello, Marco</p> <p>Thank you for contacting Zabbix. Beginning with version <a href="https://www.zabbix.com/documentation/2.0/manual/introduction/whatsnew200#improved_items" class="external-link" target="_blank" rel="nofollow noopener">2.0.0</a>, quotation marks are used for all arguments of the external checks. You can process arguments with quotes using the capabilities of a powershell script. Looks like a ZBXNEXT request.</p> <p>Please note that ZBX is a Bug Tracker, no indication of a bug here. </p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=edgar.akhmetshin">Edgar Akhmetshin</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-4761">ZBXNEXT-4761</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-4761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=287788\#worklog-287788 RE: [ZBX-12963] Unable to pass $ sign to external check https://support.zabbix.com/browse/ZBX-12963?focusedId=256766#comment-256766 Wed, 3 Jan 2018 14:39:09 +0200 Sergejs Paskevics <p>Implemented in <b>4.0.0alpha2</b> (trunk) in r76522.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=s.paskevics">Sergejs Paskevics</a> (<a href="https://support.zabbix.com/browse/ZBX-12963">ZBX-12963</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-12963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=256766\#worklog-256766 RE: [ZBX-12963] Unable to pass $ sign to external check https://support.zabbix.com/browse/ZBX-12963?focusedId=253891#comment-253891 Wed, 13 Dec 2017 09:40:26 +0200 Sergejs Paskevics <p>Resolved in svn://svn.zabbix.com/branches/dev/ZBX-12963<br/> Wrapping argument was changes from <tt>"</tt> to <tt>'</tt>.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=s.paskevics">Sergejs Paskevics</a> (<a href="https://support.zabbix.com/browse/ZBX-12963">ZBX-12963</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-12963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=253891\#worklog-253891 RE: [ZBXNEXT-2656] Allow the use of {host:key.func(param)} macros in item key parameters https://support.zabbix.com/browse/ZBXNEXT-2656?focusedId=251423#comment-251423 Mon, 27 Nov 2017 17:12:38 +0200 Javier Barroso <p>A common case at our environment, at least for zabbix agent and zabbix trapper items would be:</p> <p>hostname=srv0x<br/> item key = myitemx1<br/> item key = myitemx2<br/> ..</p> <p>Would be useful to have the possibility of extract "x" number for use in keys</p> <p>Thanks !</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=i5513">Javier Barroso</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-2656">ZBXNEXT-2656</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-2656?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=251423\#worklog-251423 RE: [ZBXNEXT-540] ZBX_NOTSUPPORTED from external scripts https://support.zabbix.com/browse/ZBXNEXT-540?focusedId=248573#comment-248573 Thu, 9 Nov 2017 08:47:38 +0200 Glebs Ivanovskis <p>Exit code check was implemented in <a href="https://support.zabbix.com/browse/ZBXNEXT-1380" title="Zabbix server should check the return code of media scripts" class="issue-link" data-issue-key="ZBXNEXT-1380"><del>ZBXNEXT-1380</del></a>, but was then reverted in <a href="https://support.zabbix.com/browse/ZBX-12594" title="Not possible to ignore exit codes of scripts which may result in unsupported state" class="issue-link" data-issue-key="ZBX-12594"><del>ZBX-12594</del></a>.</p> <p><a href="https://support.zabbix.com/browse/ZBXNEXT-4190?focusedCommentId=245779&amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-245779" class="external-link" rel="nofollow">This piece of information</a> may be of some interest for watchers.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=glebs.ivanovskis">Glebs Ivanovskis</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-540">ZBXNEXT-540</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=glebs.ivanovskis">Glebs Ivanovskis</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-540?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=248573\#worklog-248573 RE: [ZBX-12963] Unable to pass $ sign to external check https://support.zabbix.com/browse/ZBX-12963?focusedId=247365#comment-247365 Wed, 1 Nov 2017 11:42:30 +0200 Glebs Ivanovskis <p>This problem partially stems from the fact that we have very permissive item key parameter syntax and poorly thought-through quoting/escaping rules. This does not allow us to introduce "parameter preprocessing options" for escaping shell special characters, ignoring macros, etc. If item key parameters required all strings to be quoted and allowed only numeric values to be unquoted solution for this problem could look like:</p> <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> <pre>script.sh[escape_shell_spec_chars("login"), escape_shell_spec_chars("passwor$d")] </pre> </div></div> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=glebs.ivanovskis">Glebs Ivanovskis</a> (<a href="https://support.zabbix.com/browse/ZBX-12963">ZBX-12963</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-12963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=247365\#worklog-247365 RE: [ZBX-12963] Unable to pass $ sign to external check https://support.zabbix.com/browse/ZBX-12963?focusedId=246787#comment-246787 Mon, 30 Oct 2017 10:26:18 +0200 Glebs Ivanovskis <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper" class="user-hover" rel="wiper">wiper</a> isn't guilty, this logic is since <a href="https://support.zabbix.com/browse/ZBX-3647" title="keys of external checks do not conform to the item key syntax" class="issue-link" data-issue-key="ZBX-3647"><del>ZBX-3647</del></a>.</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=palivoda" class="user-hover" rel="palivoda">palivoda</a> Do you agree with suggested solution? - <a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=glebs.ivanovskis" class="user-hover" rel="glebs.ivanovskis">glebs.ivanovskis</a><br/> If not is there any other options?</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=glebs.ivanovskis" class="user-hover" rel="glebs.ivanovskis">glebs.ivanovskis</a> I have no idea how to fix this without breaking backwards compatibility.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=glebs.ivanovskis">Glebs Ivanovskis</a> (<a href="https://support.zabbix.com/browse/ZBX-12963">ZBX-12963</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=glebs.ivanovskis">Glebs Ivanovskis</a></td> </tr> </table> https://support.zabbix.com/browse/ZBX-12963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=246787\#worklog-246787 RE: [ZBXNEXT-2098] Creation of loadable modules using script languages/subagent mechanism https://support.zabbix.com/browse/ZBXNEXT-2098?focusedId=246650#comment-246650 Fri, 27 Oct 2017 12:50:51 +0300 Marc Schoechlin <p>Its nice to have the mruby module - python might be my fist choice <img class="emoticon" src="https://support.zabbix.com/images/icons/emoticons/smile.png" height="16" width="16" align="absmiddle" alt="" border="0"/></p> <p>I still think that the invocation of a subprocess would be a really good thing (i described the reasons above) and would boost the capabilities of zabbix dramatically.<br/> I you need someone to discuss implementation ideas or the reasons this feature, please do not hesitate to contact me directly by mail.<br/> (you get my mail address at <a href="https://github.com/scoopex" class="external-link" target="_blank" rel="nofollow noopener">https://github.com/scoopex</a>)</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=scoopex">Marc Schoechlin</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-2098">ZBXNEXT-2098</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-2098?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=246650\#worklog-246650 RE: [ZBX-9701] Special character $ doesn't pass in external check parameter https://support.zabbix.com/browse/ZBX-9701?focusedId=245892#comment-245892 Tue, 24 Oct 2017 09:59:09 +0300 Glebs Ivanovskis <p>Closing as Duplicate of <a href="https://support.zabbix.com/browse/ZBX-2450" title="no security measures are taken for external checks" class="issue-link" data-issue-key="ZBX-2450"><del>ZBX-2450</del></a>.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=glebs.ivanovskis">Glebs Ivanovskis</a> (<a href="https://support.zabbix.com/browse/ZBX-9701">ZBX-9701</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-9701?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=245892\#worklog-245892 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=244431#comment-244431 Fri, 13 Oct 2017 19:08:25 +0300 Glebs Ivanovskis <p>Looks like it caused <a href="https://support.zabbix.com/browse/ZBX-12874" title="Autoregistration script fails to execute after upgrade to 3.4" class="issue-link" data-issue-key="ZBX-12874"><del>ZBX-12874</del></a>.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=glebs.ivanovskis">Glebs Ivanovskis</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=244431\#worklog-244431 RE: [ZBX-2450] no security measures are taken for external checks https://support.zabbix.com/browse/ZBX-2450?focusedId=237223#comment-237223 Fri, 25 Aug 2017 15:00:30 +0300 Aleksandrs Saveljevs <p>Note that even though external checks use a different key format after <a href="https://support.zabbix.com/browse/ZBX-3647" title="keys of external checks do not conform to the item key syntax" class="issue-link" data-issue-key="ZBX-3647"><del>ZBX-3647</del></a>, it is still possible to do things like <tt>echo.sh[$HOME]</tt>, <tt>echo.sh[$(seq 1 5)]</tt>, and <tt>echo.sh[`seq 1 5`]</tt>. This is because the arguments are passed to the shell in double quotes in <tt>get_value_external()</tt> in <tt>src/zabbix_server/poller/checks_external.c</tt>, unlike in alerts in <tt>execute_action()</tt> in <tt>src/zabbix_server/alerter/alerter.c</tt> (as of current 3.2 branch).</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=asaveljevs">Aleksandrs Saveljevs</a> (<a href="https://support.zabbix.com/browse/ZBX-2450">ZBX-2450</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-2450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=237223\#worklog-237223 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=233974#comment-233974 Thu, 10 Aug 2017 10:54:04 +0300 Andris Zeila <p><b>(24)</b> [S] At some point in the trunk we added step number to the preprocessing step failure message, something like Item preprocessing step #1 failed: &lt;message&gt;.<br/> With preprocessing relocation to preprocessing manager and multiple merges this message seems to be lost. Now it simply says 'cannot apply multiplier "2" to value "x" of type "string": cannot convert value to numeric type'. </p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a> RESOLVED in r71044</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper" class="user-hover" rel="wiper">wiper</a> CLOSED</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper">Andris Zeila</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper">Andris Zeila</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=233974\#worklog-233974 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=233993#comment-233993 Wed, 9 Aug 2017 11:28:00 +0300 Vladislavs Sokurenko <p><b>(27)</b> <span class="error">&#91;I&#93;</span> Proxy does not compile<br/> ./configure --enable-proxy --with-mysql</p> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> <pre class="code-java"> make[3]: *** No rule to make target <span class="code-quote">'../../src/zabbix_server/preprocessor/libpreprocessor.a'</span>, needed by <span class="code-quote">'zabbix_proxy'</span>. Stop. make[2]: *** [Makefile:673: install-recursive] Error 1 make[1]: *** [Makefile:471: install-recursive] Error 1 make: *** [Makefile:477: install-recursive] Error 1 </pre> </div></div> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper" class="user-hover" rel="wiper">wiper</a> RESOLVED in r70796<br/> <a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso" class="user-hover" rel="vso">vso</a> CLOSED</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso">Vladislavs Sokurenko</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs">Vjaceslavs Bogdanovs</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=233993\#worklog-233993 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=233439#comment-233439 Wed, 9 Aug 2017 11:27:10 +0300 Andris Zeila <p><b>(23)</b> [S] As preprocessing is done before values are stored into history cache the ZBX_FLAG_ITEM_FIELDS_PREPROC flag can be removed when getting items from configuration cache in dbcache.c:DCmass_update_items() function.</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a> Changed to ZBX_FLAG_ITEM_FIELDS_DEFAULT. RESOLVED in r70675</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper" class="user-hover" rel="wiper">wiper</a> CLOSED</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper">Andris Zeila</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs">Vjaceslavs Bogdanovs</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=233439\#worklog-233439 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=234977#comment-234977 Tue, 8 Aug 2017 10:45:27 +0300 Andris Zeila <p>Released in:</p> <ul> <li><b>3.4.0beta3</b> r70992</li> </ul> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper">Andris Zeila</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=234977\#worklog-234977 RE: [ZBX-12476] PHP UserParameter hangs under PHP-5.3.3 but not PHP >= 5.4 https://support.zabbix.com/browse/ZBX-12476?focusedId=234755#comment-234755 Mon, 7 Aug 2017 13:51:22 +0300 Glebs Ivanovskis <p>I'm not sure there is a suitable place in official Zabbix documentation (and the use case seems a bit too specific, we try to keep docs short and focused) but you are welcome to share your findings on zabbix.org <img class="emoticon" src="https://support.zabbix.com/images/icons/emoticons/wink.png" height="16" width="16" align="absmiddle" alt="" border="0"/></p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=glebs.ivanovskis">Glebs Ivanovskis</a> (<a href="https://support.zabbix.com/browse/ZBX-12476">ZBX-12476</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-12476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=234755\#worklog-234755 RE: [ZBX-12476] PHP UserParameter hangs under PHP-5.3.3 but not PHP >= 5.4 https://support.zabbix.com/browse/ZBX-12476?focusedId=234687#comment-234687 Mon, 7 Aug 2017 06:34:27 +0300 Jim Dutton <p>I have already established two resolutions: a) upgrade php to &gt;= v5.4, b) run php UserParameter scripts under Apache (HTTPD), via "curl", using its php module to execute the PHP UserParameter script(s).</p> <p>What would really be helpful for all is to update Zabbix Manual UserParameter sections to indicate the possibility of problems/issues if the PHP invoked by zabbix_agentd is version 5.3.3 and recommending installing PHP &gt;= v5.4. This would allow other Zabbix implementers to make an informative decision about using PHP for Zabbix UserParameter scripts. It would also expand the scope of "external programs" possibly used with/by Zabbix.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=alesistrigger">Jim Dutton</a> (<a href="https://support.zabbix.com/browse/ZBX-12476">ZBX-12476</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-12476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=234687\#worklog-234687 RE: [ZBX-12476] PHP UserParameter hangs under PHP-5.3.3 but not PHP >= 5.4 https://support.zabbix.com/browse/ZBX-12476?focusedId=234668#comment-234668 Sun, 6 Aug 2017 20:07:17 +0300 Glebs Ivanovskis <p>Hm, if Zabbix times out, then everything on Zabbix side works as expected, doesn't it?</p> <p>I would recommend to look for solution of PHP problem on our forum or IRC channel. Maybe it's even more PHP-related, then Zabbix-related. Or a weird selinux issue...</p> <p>Closing as Won't Fix.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=glebs.ivanovskis">Glebs Ivanovskis</a> (<a href="https://support.zabbix.com/browse/ZBX-12476">ZBX-12476</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-12476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=234668\#worklog-234668 RE: [ZBX-12476] PHP UserParameter hangs under PHP-5.3.3 but not PHP >= 5.4 https://support.zabbix.com/browse/ZBX-12476?focusedId=234660#comment-234660 Sun, 6 Aug 2017 02:15:33 +0300 Jim Dutton <p>Running the same script with the same version of Zabbix on the same client machine BUT<br/> with a newer PHP (v5.6.32) - everything works just fine.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=alesistrigger">Jim Dutton</a> (<a href="https://support.zabbix.com/browse/ZBX-12476">ZBX-12476</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-12476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=234660\#worklog-234660 RE: [ZBX-12476] PHP UserParameter hangs under PHP-5.3.3 but not PHP >= 5.4 https://support.zabbix.com/browse/ZBX-12476?focusedId=234659#comment-234659 Sun, 6 Aug 2017 02:08:52 +0300 Jim Dutton <p>Hung agentd task finally times out<br/> ==================================</p> <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> <pre>zabbix_agentd -t local.php.test local.php.test [m|ZBX_NOTSUPPORTED] [Timeout while executing a shell script.] </pre> </div></div> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=alesistrigger">Jim Dutton</a> (<a href="https://support.zabbix.com/browse/ZBX-12476">ZBX-12476</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-12476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=234659\#worklog-234659 RE: [ZBX-12476] PHP UserParameter hangs under PHP-5.3.3 but not PHP >= 5.4 https://support.zabbix.com/browse/ZBX-12476?focusedId=234658#comment-234658 Sun, 6 Aug 2017 02:04:47 +0300 Jim Dutton <p>No zombie processes found.</p> <p>List of running agentd tasks:<br/> =====================================</p> <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> <pre>zabbix 2490 1 0 15:46 ? 00:00:00 /usr/local/sbin/zabbix_agentd zabbix 2491 2490 0 15:46 ? 00:00:01 /usr/local/sbin/zabbix_agentd: collecto r [idle 1 sec] zabbix 2492 2490 0 15:46 ? 00:00:00 /usr/local/sbin/zabbix_agentd: listener #1 [waiting for connection] zabbix 2493 2490 0 15:46 ? 00:00:00 /usr/local/sbin/zabbix_agentd: listener #2 [waiting for connection] zabbix 2494 2490 0 15:46 ? 00:00:00 /usr/local/sbin/zabbix_agentd: listener #3 [waiting for connection] zabbix 2495 2490 0 15:46 ? 00:00:01 /usr/local/sbin/zabbix_agentd: active c hecks #1 [idle 1 sec] postfix 3460 1964 0 17:21 ? 00:00:00 pickup -l -t fifo -u root 3512 2405 0 17:29 pts/1 00:00:00 vi zabbix_agentd.conf root 3523 2403 0 17:30 pts/0 00:00:00 zabbix_agentd -t local.php.test root 3524 3523 0 17:30 pts/0 00:00:00 /usr/bin/php -f /var/tmp/stdout.tester. php </pre> </div></div> <p>=====================================</p> <p>top (partial) output<br/> =====================================</p> <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> <pre>top - 17:49:58 up 2:09, 4 users, load average: 0.08, 0.07, 0.02 Tasks: 163 total, 1 running, 161 sleeping, 1 stopped, 0 zombie Cpu(s): 0.7%us, 0.4%sy, 0.0%ni, 98.5%id, 0.4%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 1020052k total, 895756k used, 124296k free, 50088k buffers Swap: 2064380k total, 8k used, 2064372k free, 237096k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 7 root 20 0 0 0 0 S 1.8 0.0 0:02.79 events/0 2366 root 20 0 292m 13m 9912 S 1.8 1.3 0:00.97 gnome-terminal 2491 zabbix 20 0 78620 1096 592 S 1.8 0.1 0:01.93 zabbix_agentd 3997 root 20 0 17072 1140 828 R 1.8 0.1 0:00.04 top 1 root 20 0 21388 1556 1236 S 0.0 0.2 0:00.75 init 2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd 3 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/0 4 root 20 0 0 0 0 S 0.0 0.0 0:00.33 ksoftirqd/0 5 root RT 0 0 0 0 S 0.0 0.0 0:00.00 stopper/0 6 root RT 0 0 0 0 S 0.0 0.0 0:00.04 watchdog/0 </pre> </div></div> <p>=====================================</p> <p>Terminal output from "stalled" agent task<br/> =====================================</p> <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> <pre>[root@centos62b ~]# zabbix_agentd -t local.php.test local.php.test [cursor] </pre> </div></div> <p>Other agentd tasks are periodically running</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=alesistrigger">Jim Dutton</a> (<a href="https://support.zabbix.com/browse/ZBX-12476">ZBX-12476</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-12476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=234658\#worklog-234658 RE: [ZBX-12476] PHP UserParameter hangs under PHP-5.3.3 but not PHP >= 5.4 https://support.zabbix.com/browse/ZBX-12476?focusedId=234657#comment-234657 Sat, 5 Aug 2017 23:38:36 +0300 Glebs Ivanovskis <p>When Zabbix hangs with PHP-5.3.3 is there any hanging or zombie processes related to your script?</p> <p>Zabbix receives <tt>SIGCHLD</tt> while doing <tt>read()</tt> meaning that script terminated, but <tt>read()</tt> does not unblock meaning that file descriptor Zabbix is reading from wasn't closed by all processes having it open. Then finally <tt>read()</tt> is interrupted by <tt>SIGALRM</tt>, Zabbix tries to <tt>kill()</tt> child and blocks in <tt>waitpid()</tt>. Maybe it's a sort of misbehaviour on PHP side, but Zabbix should definitely be robust enough to handle it. <tt>waitpid()</tt> must be executed within timeout.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=glebs.ivanovskis">Glebs Ivanovskis</a> (<a href="https://support.zabbix.com/browse/ZBX-12476">ZBX-12476</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-12476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=234657\#worklog-234657 RE: [ZBX-12476] PHP UserParameter hangs under PHP-5.3.3 but not PHP >= 5.4 https://support.zabbix.com/browse/ZBX-12476?focusedId=234642#comment-234642 Sat, 5 Aug 2017 19:00:52 +0300 Jim Dutton <p>Yes - execution of the PHP UserParameter script works just fine from the command line as a PHP invocation. The following document fragment for one of my SourceForge projects notes this issue: </p> <p>=========================<br/> It appears that Zabbix, of any release, using PHP for UserParameter scripts may encounter a breaking point if the version of PHP is 5.3.3 (or &lt; 5.4). Using such a script will cause the zabbix_agentd process to hang. For implementors of Zabbix-HDD, there are three alternatives:</p> <p>1. install PHP &gt;= 5.4</p> <p>2. don't use PHP based UserParameter scripts (eg; stick to (Unix) shell scripts)</p> <p>3. use a “sneaky proxy” by putting the PHP UserParameter script under Apache (HTTPD) with built-in PHP support and using curl to invoke the PHP UserParameter script and successfully process it, such as</p> <p>1. UserParameter=hw.disk.discovery,/usr/bin/curl --raw --silent <a href="http://localhost/zabbix-php/" class="external-link" target="_blank" rel="nofollow noopener">http://localhost/zabbix-php/</a>&lt;script filename&gt;</p> <p>= = = = = = = = = = = = = = = = =</p> <p>Apache configuration used:</p> <hr /> <p>Alias /zabbix-php "/var/www/html/zabbix-php"<br/> &lt;Directory "/var/www/html/zabbix-php/"&gt;<br/> Allow from all<br/> &lt;/Directory&gt;<br/> AddType application/x-httpd-php .php<br/> &lt;FilesMatch \.php$&gt;<br/> SetHandler application/x-httpd-php<br/> &lt;/FilesMatch&gt;</p> <hr /> <p>Two simple PHP scripts to use for testing (“stdout.tester.php”, ”stdout.tester2.php”)</p> <hr /> <p>&lt;?php <br/> echo "strftime: " . strftime("%c");<br/> exit;<br/> ?&gt;</p> <hr /> <hr /> <p>&lt;?php <br/> $lastline=exec("cat /proc/partitions",$ProcPartARRAY,$RC);<br/> $count=fwrite(STDOUT,print_r($ProcPartARRAY));<br/> exit;<br/> ?&gt;</p> <hr /> <p>Sample result (“local.php.test” =&gt; “stdout.tester.php”):</p> <p>zabbix_get -s 127.0.0.1 -k local.php.test<br/> strftime: Sat Aug 5 01:49:38 2017</p> <p>=========================</p> <p>NOTE: this issue with PHP-5.3.3 does not appear to affect the Zabbix "front-end" (web pages). Only the "child process" environment that is created/used for UserParameter scripts.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=alesistrigger">Jim Dutton</a> (<a href="https://support.zabbix.com/browse/ZBX-12476">ZBX-12476</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-12476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=234642\#worklog-234642 RE: [ZBX-12476] PHP UserParameter hangs under PHP-5.3.3 but not PHP >= 5.4 https://support.zabbix.com/browse/ZBX-12476?focusedId=234639#comment-234639 Sat, 5 Aug 2017 17:49:43 +0300 Glebs Ivanovskis <p>If you simply run your script from command line, does it work as it should on all PHP versions?</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=glebs.ivanovskis">Glebs Ivanovskis</a> (<a href="https://support.zabbix.com/browse/ZBX-12476">ZBX-12476</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-12476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=234639\#worklog-234639 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=234375#comment-234375 Thu, 3 Aug 2017 11:39:20 +0300 Dimitri Bellini <p>Hi Glebs,<br/> I came back <img class="emoticon" src="https://support.zabbix.com/images/icons/emoticons/smile.png" height="16" width="16" align="absmiddle" alt="" border="0"/> I supposed, from what said by Marc, that the main problem is clarification of what kind of implementation is on developing.<br/> From what i read this kind of "feature" seem very good for example on API request, receive a big file with a lot of metrics (using the "Master Item"), extract what is need (i do not know how) and send to "child items". From my point of you seems to solve most of my needs but i did not know for other cases.<br/> So the best thing is to provide (please, please, please) a better details of the implementations.<br/> Thank very much</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=dimitri.bellini">Dimitri Bellini</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=234375\#worklog-234375 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=234370#comment-234370 Thu, 3 Aug 2017 11:03:24 +0300 Glebs Ivanovskis <p>I think we can improve to make everybody happy, see <a href="https://support.zabbix.com/browse/ZBXNEXT-4016" title="Extend item preprocessing with subsampling function" class="issue-link" data-issue-key="ZBXNEXT-4016"><del>ZBXNEXT-4016</del></a>.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=glebs.ivanovskis">Glebs Ivanovskis</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=234370\#worklog-234370 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=234368#comment-234368 Thu, 3 Aug 2017 10:42:21 +0300 Marc <p>As I understood the current implementation, a master item updates all dependent items at the time of the master items update.</p> <p>If we keep the terminology, then this feature request was actually about a master item that may update dependent items with individual update intervals.</p> <p>In the origin request the master item update interval would give the minimum usable update interval of dependent items. A smaller update interval of dependent items would be possible, but would of course not lead to a greater detail. But a larger update interval allows to lead to less item values and easier processing (rendering graphs, 3rd party API use cases, etc.)</p> <p>This can make a huge difference when indeed going up to 999 items for thousands of hosts.</p> <p>The Eichhoernchen project instead was even attempting to make this smart. Smart in the sense that the master data gets updated in dependency of dependent items. that's to say, update the master data only, if the the data does not exist yet, or a dependent items is about to be updated, where the item's update interval is smaller than the age of the master data.</p> <p>The current implementation is rather similar to repetitive sending data for multiple items in a bulk by Zabbix sender, than to a cache that allows individual items, incl. individual item update intervals.</p> <p>While I've to admit that the issue description didn't pointed out that individual update interval fact explicitly (to me it was an obvious fact of using a cache as described), it has been at least <a href="https://support.zabbix.com/browse/ZBXNEXT-3006?focusedCommentId=156618&amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-156618" class="external-link" rel="nofollow">mentioned in the comments</a>.</p> <p>Having been able to follow the spec from the very beginning, could have helped to clarify that this is not addressing the actual need, resp. is a yet cool but different ZBXNEXT.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=okkuv9xh">Marc</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=234368\#worklog-234368 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=234357#comment-234357 Thu, 3 Aug 2017 09:38:03 +0300 Andris Zeila <p>As I understand the Eichhoernchen project it implements workaround for:</p> <blockquote><p>And this is a pity that with current Zabbix data flow architecture only one value of only one metric can be returned at a time.</p></blockquote> <p>This feature besides moving item preprocessing to separate processes, itroduces dependent items, allowing to use an item as data source for other items, so basically returning multiple metrics from an item.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper">Andris Zeila</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=234357\#worklog-234357 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=234316#comment-234316 Thu, 3 Aug 2017 01:23:42 +0300 Marc <p>Gents, <b>please, please with sugar on top</b>, re-consider sharing specs with the community from the very beginning.</p> <p>This is just yet another example of missing the point, which could have been easily identified, if acting more open and transparent.</p> <p>While the current implementation is possibly a nice feature, it has less to do with the demand behind <a href="https://support.zabbix.com/browse/ZBXNEXT-3006" title="A cache to provide multiple metrics of a single custom function" class="issue-link" data-issue-key="ZBXNEXT-3006"><del>ZBXNEXT-3006</del></a>. Since the issue description/comments were obviously not clear enough, you can also take a look at the <a href="https://github.com/i-ky/Eichhoernchen/blob/master/Spec.md" class="external-link" target="_blank" rel="nofollow noopener">Eichhoernchen project</a> to get a better idea of it.<br/> The Eichhoernchen project does not yet provide a solution, but it properly addresses the origin demand.</p> <p>Anyway, <b>I appreciate your commitment!</b></p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=okkuv9xh">Marc</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=234316\#worklog-234316 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=232867#comment-232867 Mon, 24 Jul 2017 14:56:22 +0300 Dimitri Bellini <p>I understood the concept but as you suggest i will wait documentation, thanks very much!</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=dimitri.bellini">Dimitri Bellini</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=232867\#worklog-232867 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=232861#comment-232861 Mon, 24 Jul 2017 14:28:04 +0300 Andris Zeila <p>Shortly - it allows to create items with another item as data source and using preprocessing options to extract required value. I'd suggest to wait for documentation.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper">Andris Zeila</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=232861\#worklog-232861 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=232860#comment-232860 Mon, 24 Jul 2017 14:22:57 +0300 Dimitri Bellini <p>Hi Andris,<br/> Thanks, i have retested the feature but i did not understand how is working <img class="emoticon" src="https://support.zabbix.com/images/icons/emoticons/smile.png" height="16" width="16" align="absmiddle" alt="" border="0"/> </p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=dimitri.bellini">Dimitri Bellini</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=232860\#worklog-232860 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=232825#comment-232825 Mon, 24 Jul 2017 12:37:07 +0300 Andris Zeila <p>Dimitri, it's marked for 3.4 in Fix Version/s (you should be able to see it above). However It doesn't seem to be merged in trunk yet.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper">Andris Zeila</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=232825\#worklog-232825 RE: [ZBXNEXT-2098] Creation of loadable modules using script languages/subagent mechanism https://support.zabbix.com/browse/ZBXNEXT-2098?focusedId=232645#comment-232645 Fri, 21 Jul 2017 13:26:41 +0300 Marc <p>In the sense of <a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=richlv" class="user-hover" rel="richlv">richlv</a>'s comment, these two are possibly worth to mention as well:</p> <ul> <li><a href="https://github.com/ZenProjects/Zabbix-PHP-Module" class="external-link" target="_blank" rel="nofollow noopener">Zabbix-PHP-Module</a></li> <li><a href="https://github.com/vulogov/zlm-cython" class="external-link" target="_blank" rel="nofollow noopener">zlm-cython</a></li> </ul> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=okkuv9xh">Marc</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-2098">ZBXNEXT-2098</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-2098?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=232645\#worklog-232645 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=231641#comment-231641 Wed, 12 Jul 2017 18:53:22 +0300 Dimitri Bellini <p>Hi Andris,<br/> As i could see using SVN Trunk there is a new Item called "Dependent item", how can i test it? Is this feature planned for 3.4?<br/> Thanks so much</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=dimitri.bellini">Dimitri Bellini</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=231641\#worklog-231641 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=231121#comment-231121 Mon, 10 Jul 2017 14:53:55 +0300 Andris Zeila <p>Server side (trunk merge) tested. <br/> Frontend is under <a href="https://support.zabbix.com/browse/ZBXNEXT-3883" title="Subtask: frontend for A cache to provide multiple metrics of a single custom function" class="issue-link" data-issue-key="ZBXNEXT-3883"><del>ZBXNEXT-3883</del></a></p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper">Andris Zeila</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=palivoda">Rostislav Palivoda</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=231121\#worklog-231121 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=230936#comment-230936 Thu, 6 Jul 2017 12:26:43 +0300 Andris Zeila <p><b>(16)</b> [S] Fixed few merge issues, please review r69865</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a> Thanks! Reviewed and added some minor fixes in r69869. RESOLVED</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper" class="user-hover" rel="wiper">wiper</a> CLOSED</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper">Andris Zeila</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper">Andris Zeila</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=230936\#worklog-230936 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=230938#comment-230938 Thu, 6 Jul 2017 12:26:34 +0300 Andris Zeila <p><b>(17)</b> [S] In DCsync_items() the ids vector is used only to update dependent items in master items. My suggestion would be to use ptr vector where only new dependent items or dependent items with changed master items would be added.</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a> RESOLVED in r69868</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper" class="user-hover" rel="wiper">wiper</a> CLOSED</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper">Andris Zeila</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper">Andris Zeila</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=230938\#worklog-230938 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=230769#comment-230769 Thu, 6 Jul 2017 10:55:47 +0300 Andris Zeila <p><b>(14)</b> [S] Another 'todo' when merging trunk - new preprocessing options were added to trunk. The location of item_preproc.c file was changed - you will probably need to merge the changes manually.</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a> RESOLVED in r69852 as a part or merge</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper" class="user-hover" rel="wiper">wiper</a> CLOSED</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper">Andris Zeila</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper">Andris Zeila</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=230769\#worklog-230769 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=230544#comment-230544 Thu, 6 Jul 2017 10:55:32 +0300 Andris Zeila <p><b>(13)</b> [S] Value type is used for type hinting during string to numeric conversions in trunk. While currently value type is not used by preprocessor it will be easier to merge if it was added to the manager-&gt;worker request package.</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a> RESOLVED in r69852 as a part or merge</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper" class="user-hover" rel="wiper">wiper</a> CLOSED</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper">Andris Zeila</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper">Andris Zeila</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=230544\#worklog-230544 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=230770#comment-230770 Wed, 5 Jul 2017 10:53:14 +0300 Andris Zeila <p><b>(15)</b> [F] The dependent item graphs consists of dots without lines. I understand this is because delay period for dependent items is 0. For dependent items we will have to take the master's delay period (in worst case scenario we will need to travel dependent item chain to the 'root' item).</p> <p>Moved to frontend task <a href="https://support.zabbix.com/browse/ZBXNEXT-3883" title="Subtask: frontend for A cache to provide multiple metrics of a single custom function" class="issue-link" data-issue-key="ZBXNEXT-3883"><del>ZBXNEXT-3883</del></a> as <b>(5)</b>.</p> <p>CLOSED</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper">Andris Zeila</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs">Vjaceslavs Bogdanovs</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=230770\#worklog-230770 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=230772#comment-230772 Wed, 5 Jul 2017 10:40:03 +0300 Andris Zeila <p>Server side is tested, however due to the differences with trunk some things will have to be retested after merge.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper">Andris Zeila</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=230772\#worklog-230772 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=230542#comment-230542 Mon, 3 Jul 2017 16:27:47 +0300 Andris Zeila <p><b>(12)</b> [S] Fixed possible memory leaks/corruption when setting the calculated value/error to agent result. Also cleaned up uninitalized memory errors reported by valgrind (might have been false positive though). Please review.<br/> RESOLVED in r69755, r69757</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a> Thanks! Reviewed and CLOSED</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper">Andris Zeila</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs">Vjaceslavs Bogdanovs</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=230542\#worklog-230542 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=228540#comment-228540 Mon, 3 Jul 2017 12:58:10 +0300 Andris Zeila <p><b>(6)</b> [S] item.dependent_items vector update is done by clearing and rebuilding the dependent item vector for all items.</p> <p>This will not work with the configuration sync changes in trunk. Only the changed rows will be passed to DCsync_items(). There are few options:</p> <ol> <li>when adding/removing dependent item (or item's type changed to/from dependent) update its' master items dependent_items vector. This would probably require to generate itemid-&gt;master_itemid pair vector from configuration cache and synchronize it with itemid-&gt;master_itemid pairs selected from database (select itemid,master_itemid from items where master_itemid is not null).</li> <li>after syncing items (and before updating dependent items) iterate through config-&gt;items to reset dependent items.</li> </ol> <p>The (1) is more optimal for partial configuration cache updates, but (2) is much easier to implement.</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a> RESOLVED in r69628</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper" class="user-hover" rel="wiper">wiper</a> CLOSED</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper">Andris Zeila</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper">Andris Zeila</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=228540\#worklog-228540 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=229028#comment-229028 Tue, 20 Jun 2017 13:58:50 +0300 Andris Zeila <p><b>(11)</b> [S] Fixed dependent item copying when linking templates. Also minor code improvement, please review.<br/> RESOLVED in r69343, r69349</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a> Thanks! CLOSED</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper">Andris Zeila</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs">Vjaceslavs Bogdanovs</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=229028\#worklog-229028 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=228836#comment-228836 Mon, 19 Jun 2017 13:57:35 +0300 Andris Zeila <p><b>(10)</b> [S] More naming improvements:<br/> Preprocessor manager internal type names also must be prefixed with zbx_ (preprocessing_states, preprocessing_request_t, preprocessing_worker_t, delta_item_index_t, preprocessing_manager_t)</p> <p>A 'dep' abbreviation is used when processing trigger dependencies. Vectors/arrays storing identifiers usually have ids suffix. And commonly the number of something has suffix _num. So dep_itemids in ZBX_DC_ITEM structure and dep_itemids_num, dep_itemids in DC_ITEM structure would be better match to existing names.</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a> RESOLVED in r69310</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper" class="user-hover" rel="wiper">wiper</a> CLOSED</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper">Andris Zeila</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper">Andris Zeila</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=228836\#worklog-228836 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=228696#comment-228696 Mon, 19 Jun 2017 13:50:06 +0300 Vjaceslavs Bogdanovs <p><b>(7)</b> [S] Additional check was missing for LLD items that are not discovered anymore (items without lld_row should not be linked with parent as they will not be updated).<br/> RESOLVED in r69272, r69273</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper" class="user-hover" rel="wiper">wiper</a> CLOSED</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs">Vjaceslavs Bogdanovs</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper">Andris Zeila</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=228696\#worklog-228696 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=228214#comment-228214 Mon, 19 Jun 2017 13:48:05 +0300 Vjaceslavs Bogdanovs <p><b>(4)</b> <span class="error">&#91;S&#93;</span> <tt>preprocessor_link_delta_items</tt> can be called with unitialized item configuration if item is not "preprocessable".</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a> RESOLVED in r69198, r69241</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper" class="user-hover" rel="wiper">wiper</a> CLOSED</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs">Vjaceslavs Bogdanovs</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper">Andris Zeila</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=228214\#worklog-228214 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=228179#comment-228179 Mon, 19 Jun 2017 13:46:57 +0300 Andris Zeila <p><b>(3)</b> [I] Monitoring of the new processes must be added to the default Zabbix templates (zabbix<span class="error">&#91;process,&lt;process&gt;,avg,busy&#93;</span> items with corresponding triggers.</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a> Added monitoring to templates. RESOLVED in r69199</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper" class="user-hover" rel="wiper">wiper</a> CLOSED</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper">Andris Zeila</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper">Andris Zeila</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=228179\#worklog-228179 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=228346#comment-228346 Fri, 16 Jun 2017 09:34:33 +0300 Andris Zeila <p><b>(5)</b> [S] Naming improvements:</p> <ul> <li>using zbx_preprocessor_hold() (begin() ?), zbx_preprocessor_flush() instead of zbx_preprocessor_send_command() would easier to read.</li> <li>would better to avoid using generic file names (worker, manager) where possible. Use preproc_worker, preproc_manager or something like that</li> <li>all structures must be prefixed with zbx_, so that means using zbx_queue_t, zbx_queue_item_t, zbx_queue_iterator_t. Actually maybe it would be better to rename it to list (zbx_list_t, ...). We already have circural queue zbx_queue_ptr_t and the new queue is basically a singly linked list.</li> </ul> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a> RESOLVED in r69241</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper" class="user-hover" rel="wiper">wiper</a> CLOSED</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper">Andris Zeila</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper">Andris Zeila</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=228346\#worklog-228346 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=227801#comment-227801 Thu, 8 Jun 2017 16:56:43 +0300 Vjaceslavs Bogdanovs <p>Server side is ready for testing in development branch svn://svn.zabbix.com/branches/dev/ZBXNEXT-3006</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs">Vjaceslavs Bogdanovs</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=227801\#worklog-227801 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=227521#comment-227521 Wed, 7 Jun 2017 13:21:05 +0300 Rostislav Palivoda <p>Please take care of server side testing - <a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper" class="user-hover" rel="wiper">wiper</a></p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=palivoda">Rostislav Palivoda</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=227521\#worklog-227521 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=210075#comment-210075 Thu, 30 Mar 2017 11:26:12 +0300 Vladislavs Sokurenko <p><b>(13)</b> <span class="error">&#91;D&#93;</span> This need to be very well documented, especially in upgrade notes.</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso" class="user-hover" rel="vso">vso</a> CLOSED as it was done under <b>(15)</b></p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso">Vladislavs Sokurenko</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso">Vladislavs Sokurenko</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=210075\#worklog-210075 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=208196#comment-208196 Thu, 30 Mar 2017 11:24:00 +0300 Vladislavs Sokurenko <p><b>(2)</b> <span class="error">&#91;PSA&#93;</span> Unused variable added.<br/> <tt>output</tt> variable is allocated and freed, however it is not used.</p> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> <pre class="code-java"> <span class="code-keyword">if</span> (SUCCEED == (rc = zbx_execute_script(&amp;host, &amp;script, NULL, &amp;output, error, sizeof(error)))) { zabbix_log(LOG_LEVEL_DEBUG, <span class="code-quote">"%s output:\n%s"</span>, script.command, error); zbx_free(output); } </pre> </div></div> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a> RESOLVED in r64863</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso" class="user-hover" rel="vso">vso</a> CLOSED</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso">Vladislavs Sokurenko</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=dimir">dimir</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=208196\#worklog-208196 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=208195#comment-208195 Thu, 30 Mar 2017 11:23:48 +0300 Vladislavs Sokurenko <p><b>(1)</b> <span class="error">&#91;PSA&#93;</span> Memory leak.</p> <p>output is only freed on SUCCEED, otherwise address is lost and memory is not freed.</p> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> <pre class="code-java"> <span class="code-keyword">if</span> (SUCCEED == (rc = zbx_execute_script(&amp;host, &amp;script, NULL, &amp;output, error, sizeof(error)))) { zabbix_log(LOG_LEVEL_DEBUG, <span class="code-quote">"%s output:\n%s"</span>, script.command, error); zbx_free(output); } </pre> </div></div> <p>While it is also allocated on not SUCCEED.</p> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> <pre class="code-java"> <span class="code-keyword">if</span> (SUCCEED != ret &amp;&amp; NULL != result) *result = zbx_strdup(*result, ""); </pre> </div></div> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a> RESOLVED in r64863</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso" class="user-hover" rel="vso">vso</a> CLOSED, please review small style fixes in r64868</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso">Vladislavs Sokurenko</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=dimir">dimir</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=208195\#worklog-208195 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=219238#comment-219238 Thu, 30 Mar 2017 11:22:50 +0300 dimir <p>Sub-issues still open: <b>(13)</b></p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=dimir">dimir</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=219238\#worklog-219238 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=219173#comment-219173 Wed, 29 Mar 2017 23:41:16 +0300 richlv <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a>, that sounds really neat, thank you.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=richlv">richlv</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=richlv">richlv</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=219173\#worklog-219173 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=219072#comment-219072 Wed, 29 Mar 2017 14:33:43 +0300 Vjaceslavs Bogdanovs <p>Error output of command execution is available in frontend and in server log file (LOG_LEVEL_WARNING).</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs">Vjaceslavs Bogdanovs</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=219072\#worklog-219072 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=218835#comment-218835 Mon, 27 Mar 2017 22:30:32 +0300 richlv <p>will this also save the failure output somewhere - server logfile, for example ? if yes, that would solve <a href="https://support.zabbix.com/browse/ZBXNEXT-1284" title="alerter should output some logs to zabbix_server.log" class="issue-link" data-issue-key="ZBXNEXT-1284">ZBXNEXT-1284</a></p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=richlv">richlv</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=218835\#worklog-218835 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=216180#comment-216180 Tue, 7 Mar 2017 16:04:31 +0200 dimir <p>I would disagree. I understand that this issue is bit different but to me the idea is the same: one check results in multiple values for other items. <em>Item pre-processing</em> is the first step to that, so to me these issues are related.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=dimir">dimir</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=216180\#worklog-216180 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=216147#comment-216147 Tue, 7 Mar 2017 13:23:01 +0200 Max <p>dimir,<br/> Sorry, but no, it is not related to <a href="https://support.zabbix.com/browse/ZBXNEXT-1443" title="Ability to transform item values before they are processed and stored to DB" class="issue-link" data-issue-key="ZBXNEXT-1443"><del>ZBXNEXT-1443</del></a>. It is absolutely different issues.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=grechnev">Max</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=216147\#worklog-216147 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=216093#comment-216093 Tue, 7 Mar 2017 10:12:02 +0200 dimir <p>Related issue: <a href="https://support.zabbix.com/browse/ZBXNEXT-1443" title="Ability to transform item values before they are processed and stored to DB" class="issue-link" data-issue-key="ZBXNEXT-1443"><del>ZBXNEXT-1443</del></a></p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=dimir">dimir</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=216093\#worklog-216093 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=210635#comment-210635 Fri, 17 Feb 2017 09:33:48 +0200 Vladimir Silin <p><b>(15)</b> <span class="error">&#91;D&#93;</span> Documented in the following documentation pages for version 3.4:</p> <ul> <li><a href="https://www.zabbix.com/documentation/3.4/manual/introduction/whatsnew340" class="external-link" target="_blank" rel="nofollow noopener">What's new in Zabbix 3.4.0</a></li> <li><a href="https://www.zabbix.com/documentation/3.4/manual/installation/upgrade_notes_340" class="external-link" target="_blank" rel="nofollow noopener">Upgrade notes for 3.4.0</a></li> <li><a href="https://www.zabbix.com/documentation/3.4/manual/appendix/command_execution" class="external-link" target="_blank" rel="nofollow noopener">Command execution</a></li> </ul> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso" class="user-hover" rel="vso">vso</a> Isn't "Due to command/script exit code check introduction in Zabbix 3.4 commands and scripts can be executed multiple times if exit code is different from 0"<br/> Only for media script ?</p> <p>Also for media script it would be good to use such example with exit 0 added. And to mention that exit value other than 0 would mean error.</p> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> <pre class="code-java"> #!/bin/bash to=$1 subject=$2 body=$3 cat &lt;&lt;EOF | mail -s <span class="code-quote">"$subject"</span> <span class="code-quote">"$to"</span> $body EOF exit 0 </pre> </div></div> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=VSI" class="user-hover" rel="VSI">VSI</a> Thanks for the comment!<br/> <a href="https://www.zabbix.com/documentation/3.4/manual/installation/upgrade_notes_340" class="external-link" target="_blank" rel="nofollow noopener">Upgrade notes for 3.4.0</a> updated, script example on the <a href="https://www.zabbix.com/documentation/3.4/manual/config/notifications/media/script" class="external-link" target="_blank" rel="nofollow noopener">Custom alertscripts</a> page updated with proposed example and note about error codes.</p> <p>&lt;<a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=dimir" class="user-hover" rel="dimir">dimir</a>&gt; Wouldn't it be better to actually spout error if that occurs:</p> <p><del>exit 0</del><br/> exit $?</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso" class="user-hover" rel="vso">vso</a> yes I think you are right about $? It's better working example as exit status of last command will be returned. exit 0 just says that user must explicitly define exit code. Maybe original example should stay as no exit is same as exit $? </p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a> Thats why I was confused about changes made to existing example. If we want to show how to use exit to define exit code then we could make second example like that:</p> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> <pre class="code-java"> #!/bin/bash <span class="code-keyword">if</span> [ -f <span class="code-quote">"/<span class="code-keyword">var</span>/messages/target"</span> ]; then # some logic goes here <span class="code-keyword">else</span> exit 1 #exit with an error fi </pre> </div></div> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=VSI" class="user-hover" rel="VSI">VSI</a> Removed "exit 0" entry from the example and mentioned exit code checking basics in the note on <a href="https://www.zabbix.com/documentation/3.4/manual/config/notifications/media/script" class="external-link" target="_blank" rel="nofollow noopener">Custom alertscripts</a> page. I'd prefer not to complicate description with several examples, especially with additional logic. <br/> Do you think it worth to mention possibility for user to define an exit code within a script regardless of actual execution results? It looks like some very specific case.</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a> I agree that this is a very specific case. I gave this example just to show the idea on how exit X could be used "in real life", but I think that we can leave things simple and stay with the existing example.</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso" class="user-hover" rel="vso">vso</a> REOPENED, There are some info missing in upgrade notes and what's new, all pages from <b>(16)</b> should be mentioned.</p> <p>This below leaves question, "can be executed" it shall be well define what will happen and how many times and if it's feature or known issue.</p> <blockquote> <p> alertscripts can be executed multiple times if their exit code is different from 0</p></blockquote> <p>It should be confirmed but from code looks like max retries is 3 times, delay in between is 30 seconds, I could not find it documented anywhere.</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=VSI" class="user-hover" rel="VSI">VSI</a> The main idea is to warn users about the fact of possibility of such behavior after upgrade in case of non-0 exit code. I don't see the point to introduce users in upgrade notes with parameters of a mechanism which cannot be configured. Perhaps it should be documented, but elsewhere. Also these parameters are not actually a result or a dependency of the change introduced in this issue, but their effect is, which is mentioned.</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso" class="user-hover" rel="vso">vso</a> Yes I agree, still REOPENED, upgrade notes have been updated under <b>(16)</b> and looks OK.</p> <p>However what's new does not mention what has been added to <b>(16)</b> in documentation.</p> <p>For example here <a href="https://www.zabbix.com/documentation/3.4/manual/web_interface/frontend_sections/administration/scripts?rev=1478764129&amp;do=diff" class="external-link" target="_blank" rel="nofollow noopener">https://www.zabbix.com/documentation/3.4/manual/web_interface/frontend_sections/administration/scripts?rev=1478764129&amp;do=diff</a><br/> New info about user scripts is added but no mention in what's new.</p> <p>external check items are mentioned in upgrade notes but not it what's new, etc..</p> <p>I think all new features should be in what's new, please go through <b>(16)</b> pages and double check</p> <p>Also this below should be deleted from what's new because it's nothing for user to care about.<br/> And for some reason it's in what's new but not in upgrade notes.</p> <blockquote> <p>system.hw.devices, and system.sw.packages Zabbix agent items</p></blockquote> <p>And it's not only place where return code has been added, for example in <tt>net.tcp.listen</tt> and some other places, probably best to mention that some items that launch commands could also become unsupported. ( if needed, I can provide a list )</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=VSI" class="user-hover" rel="VSI">VSI</a> What's new updated with:</p> <ul class="alternate" type="square"> <li>generalized term 'scripts' as we don't have anything described as 'user script' in documentation</li> <li>mention of external checks</li> <li>generalized phrase 'Zabbix agent items executed without “nowait” flag' instead of naming specific items.</li> </ul> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso" class="user-hover" rel="vso">vso</a> <br/> Documentation states:</p> <blockquote> <p>remote commands on Zabbix agent are executed without timeout by the system.run<span class="error">&#91;,nowait&#93;</span> key and are not checked for execution results. </p></blockquote> <p>While what's new </p> <blockquote> <p>Now Zabbix checks exit codes for scripts, including media types, external checks, <ins>remote commands</ins>, user parameters executed by Zabbix server and for Zabbix agent items executed without “nowait” flag.</p></blockquote> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=VSI" class="user-hover" rel="VSI">VSI</a> What's new fixed and phrased as<br/> "Now Zabbix checks exit codes for user parameters, remote commands and system.run[] items without the “nowait” flag as well as Zabbix server executed scripts (alert, external and global). In case of an error in a script or a command execution process Zabbix provides error description in the Frontend as well as creates corresponding log entries."</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso" class="user-hover" rel="vso">vso</a> CLOSED</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vsi">Vladimir Silin</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso">Vladislavs Sokurenko</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=210635\#worklog-210635 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=213597#comment-213597 Thu, 16 Feb 2017 11:44:40 +0200 Vladislavs Sokurenko <p><b>(16)</b> <span class="error">&#91;D&#93;</span> No mention about return code in:</p> <ul> <li>In <tt>system.run</tt> there no mention of execution result in description<br/> <a href="https://www.zabbix.com/documentation/3.4/manual/config/items/itemtypes/zabbix_agent" class="external-link" target="_blank" rel="nofollow noopener">https://www.zabbix.com/documentation/3.4/manual/config/items/itemtypes/zabbix_agent</a><br/> It states only that: <blockquote> <p>Note: The return value of the item is standard output together with standard error produced by command.</p></blockquote></li> <li>External checks<br/> <a href="https://www.zabbix.com/documentation/3.4/manual/config/items/itemtypes/external" class="external-link" target="_blank" rel="nofollow noopener">https://www.zabbix.com/documentation/3.4/manual/config/items/itemtypes/external</a></li> </ul> <ul> <li>User scripts<br/> <a href="https://www.zabbix.com/documentation/3.4/manual/web_interface/frontend_sections/administration/scripts" class="external-link" target="_blank" rel="nofollow noopener">https://www.zabbix.com/documentation/3.4/manual/web_interface/frontend_sections/administration/scripts</a></li> </ul> <ul> <li>Actions<br/> This one just for history, looks OK because it states: <blockquote> <p>remote commands on Zabbix agent are executed without timeout by the </p> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> <pre class="code-java"> system.run[,nowait] </pre> </div></div> <p>key and are not checked for execution results.</p></blockquote> <p><a href="https://www.zabbix.com/documentation/3.4/manual/config/notifications/action/operation/remote_command" class="external-link" target="_blank" rel="nofollow noopener">https://www.zabbix.com/documentation/3.4/manual/config/notifications/action/operation/remote_command</a></p></li> </ul> <ul> <li>User parameter<br/> <a href="https://www.zabbix.com/documentation/3.4/manual/config/items/userparameters" class="external-link" target="_blank" rel="nofollow noopener">https://www.zabbix.com/documentation/3.4/manual/config/items/userparameters</a></li> </ul> <ul> <li>Custom alertscripts<br/> This one looks OK, simply for history and to see whats new.<br/> Should we also mention that it will retry on failure ?</li> </ul> <p><a href="https://www.zabbix.com/documentation/3.4/manual/config/notifications/media/script" class="external-link" target="_blank" rel="nofollow noopener">https://www.zabbix.com/documentation/3.4/manual/config/notifications/media/script</a></p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=VSI" class="user-hover" rel="VSI">VSI</a> Exit code checking and links to whole <a href="https://www.zabbix.com/documentation/3.4/manual/appendix/command_execution" class="external-link" target="_blank" rel="nofollow noopener">Command execution</a> page added in:</p> <ul class="alternate" type="square"> <li><a href="https://www.zabbix.com/documentation/3.4/manual/config/items/itemtypes/zabbix_agent" class="external-link" target="_blank" rel="nofollow noopener">Comment section</a> of <tt>system.run</tt> item key (exit code check explicitly mentioned)</li> <li><b>External checks</b> - <a href="https://www.zabbix.com/documentation/3.4/manual/config/items/itemtypes/external#overview" class="external-link" target="_blank" rel="nofollow noopener">Overview</a> (link) and <a href="https://www.zabbix.com/documentation/3.4/manual/config/items/itemtypes/external#external_check_result" class="external-link" target="_blank" rel="nofollow noopener">External check result</a> (explicit mention of exit code check) parts.</li> <li><a href="https://www.zabbix.com/documentation/3.4/manual/web_interface/frontend_sections/administration/scripts#script_execution_and_result" class="external-link" target="_blank" rel="nofollow noopener">Script execution and results</a> part of <b>Scripts</b> page in web interface description is renamed and link provided</li> <li><a href="https://www.zabbix.com/documentation/3.4/manual/config/items/userparameters#command_result" class="external-link" target="_blank" rel="nofollow noopener">Command result</a> of <b>User parameter</b> section</li> <li>Note in <a href="https://www.zabbix.com/documentation/3.4/manual/config/notifications/media/script#overview" class="external-link" target="_blank" rel="nofollow noopener">Overview</a> in <b>Custom alertscripts</b> extended with mention of retries for failed executions</li> <li><a href="https://www.zabbix.com/documentation/3.4/manual/installation/upgrade_notes_340#commandscript_execution_changes" class="external-link" target="_blank" rel="nofollow noopener">Upgrade notes</a> extended with mention of items with user parameters and external checks.</li> </ul> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso" class="user-hover" rel="vso">vso</a> CLOSED</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso">Vladislavs Sokurenko</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vsi">Vladimir Silin</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=213597\#worklog-213597 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=210089#comment-210089 Thu, 19 Jan 2017 16:26:53 +0200 Vladislavs Sokurenko <p><b>(14)</b> [S] Errors that show up in frontend must start with a capital letter and end with period.</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a> Should we change all existing errors (introduced in and before this solution) and output of the scripts to this format? If so, there are multiple ways to do it:<br/> 1. Wrap output of the script into some message string like <tt>Execution failed: "&lt;OUTPUT GOES HERE&gt;".</tt><br/> 2. Introduce check and formatting of an output in frontend so all errors are displayed in this format.<br/> 3. Fix all existing errors and transform output so first letter is capitalized and output ends with a period.</p> <p>Should error messages like <tt>zbx_waitpid() failed: X</tt> be rewritten so they explain what happen in the way users can understand or should they remain the same?</p> <p>Any combination of those is possible, so decision should be made before implementing.</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso" class="user-hover" rel="vso">vso</a> Only static messages that were introduced, everything else is out of scope of this task.<br/> User output must not be altered.<br/> I agree that there are some messages that do not obey this rule, one is example you mentioned, but they all have something in common, they will only occur on some critical error.</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a> Maybe I am missing difference on how critical some errors are and why <tt>unable to create process [X]: X</tt> is critical, but <tt>Process terminated unexpectedly.</tt> is somehow ok, but<br/> RESOLVED in <b>pre-3.3.0 (trunk)</b> r65183<br/> <a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso" class="user-hover" rel="vso">vso</a> CLOSED</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso">Vladislavs Sokurenko</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso">Vladislavs Sokurenko</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=210089\#worklog-210089 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=210076#comment-210076 Thu, 19 Jan 2017 12:13:39 +0200 Vjaceslavs Bogdanovs <p>Available in pre-3.3.0 (trunk) r65179.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs">Vjaceslavs Bogdanovs</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs">Vjaceslavs Bogdanovs</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=210076\#worklog-210076 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=210071#comment-210071 Thu, 19 Jan 2017 11:45:21 +0200 Vladislavs Sokurenko <p>Successfully tested</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso">Vladislavs Sokurenko</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=210071\#worklog-210071 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=210067#comment-210067 Thu, 19 Jan 2017 11:43:21 +0200 Vladislavs Sokurenko <p><b>(12)</b> <tt>zbx_execute</tt> release previously allocated resources only in the end, while not using those, this is not very effective.</p> <p>Before<br/> Logic in zbx_executed was to reallocate previously allocated buffer and then continue with it.</p> <p>Now:<br/> Allocate new buffer, and free previously allocated buffer in the end.</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a> RESOLVED in r65175</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso" class="user-hover" rel="vso">vso</a> CLOSED</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso">Vladislavs Sokurenko</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso">Vladislavs Sokurenko</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=210067\#worklog-210067 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=209369#comment-209369 Thu, 19 Jan 2017 10:23:56 +0200 Vjaceslavs Bogdanovs <p><b>(8)</b> Custom script (remote command in action -&gt; operation) executed on server is shown without host in Reports -&gt; Action log</p> <p>This causes output like that (command starts with ":" as host is missing):<br/> <span class="image-wrap" style=""><img src="https://support.zabbix.com/secure/attachment/47301/47301_nohost.png" style="border: 0px solid black" /></span></p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a> RESOLVED in r65091 </p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso" class="user-hover" rel="vso">vso</a> REOPENED for the same reason as <b>(7)</b> command is not executed on host so this message is not appropriate actually, that's why there was blank.</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a> Command is not executed on host, but it is executed "within host context" and all host related macros will expand to specified host. So we can't say that setting target host for execution on server doesn't change anything.<br/> And this is the reason why we need to show host in the results.</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso" class="user-hover" rel="vso">vso</a> Please correct me if I am wrong.<br/> Hostid does not affect anything when custom script is executed on server. Macros are still resolved as if current host was set.<br/> So when 2 or more different targets are set, they are actually duplicates of same command but will have different hostid and get executed more then one time.<br/> Assuming this macro expanding is by design, then I would suggest to make sure that custom script for server is only executed once.<br/> Since there can be only one target for custom script that is executed on server there is no need even to check for duplicates, or to determine host id, we simply must stop on first execute as we know that there can't be more than one, no matter how many are added they are still duplicates of the same command that will be executed on same server.</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a> Assuming macro expanding is correct there should be no option to specify targets for scripts executed on server as those values will never be used. So problem is present anyway and we should only find out the scope of the problem.</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso" class="user-hover" rel="vso">vso</a> CLOSED, Lets create separate ticket for that.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs">Vjaceslavs Bogdanovs</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso">Vladislavs Sokurenko</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=209369\#worklog-209369 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=209367#comment-209367 Thu, 19 Jan 2017 10:23:36 +0200 Vjaceslavs Bogdanovs <p><b>(7)</b> Custom script (remote command in action -&gt; operation) can be executed multiple times on server if Target list contains multiple records of current host.</p> <p>Steps to reproduce:<br/> 1. Create Action<br/> 2. Add operation<br/> 3. Set <b>Operation</b> type to "Remote command"<br/> 4. Set <b>Type</b> to custom script<br/> 5. Set <b>Execute</b> on to "Server"<br/> 6. Add host to the <b>Target list</b> multiple times (for example Current host + Host &lt;HOSTNAME&gt;)</p> <p>Action operation will be executed twice.</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a> RESOLVED in r65091 </p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso" class="user-hover" rel="vso">vso</a> REOPENED. Fix must be reverted, it's frontend bug and this fix is not the way it can be handled, I suggest to make separate bug report.<br/> Why is it not good solution ?<br/> There can only be one server, that's why there shall be no host checks.<br/> But after new changes there is additional SQL query called:</p> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> <pre class="code-java"> sql [select distinct h.hostid,h.host,h.tls_connect from functions f,items i,hosts h where f.itemid=i.itemid and i.hostid=h.hostid and h.status=0 and f.triggerid=13558] 4341:20170116:153222.315 End of get_dynamic_hostid():SUCCEED </pre> </div></div> <p>As well as bunch of other code for checking host duplicates etc..</p> <p>All this is done to fill <tt>host</tt> parameter which in the end is not used by server anyway, and it can't be used because no command is executed on any host, it's executed on server.</p> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> <pre class="code-java"> <span class="code-keyword">case</span> ZBX_SCRIPT_EXECUTE_ON_AGENT: ret = zbx_execute_script_on_agent(host, script-&gt;command, result, error, max_error_len); <span class="code-keyword">break</span>; <span class="code-keyword">case</span> ZBX_SCRIPT_EXECUTE_ON_SERVER: ret = zbx_execute(script-&gt;command, result, error, max_error_len, CONFIG_TRAPPER_TIMEOUT); <span class="code-keyword">break</span>; </pre> </div></div> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a> Documentation states that "A command on a host is executed only once, even if the host matches more than once (e.g. from several host groups; individually and from a host group)"<br/> And yes, there can be only one server, but nevertheless there can be multiple hosts (host is being set for action operations even for Execute on = Server) and current solution is causing multiple script executions if host is specified multiple times:<br/> <span class="image-wrap" style=""><img src="https://support.zabbix.com/secure/attachment/47364/47364_same_command.png" style="border: 0px solid black" /></span></p> <p>How we treat this problem as a frontend bug?</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso" class="user-hover" rel="vso">vso</a> CLOSED, Lets create separate ticket for that.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs">Vjaceslavs Bogdanovs</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso">Vladislavs Sokurenko</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=209367\#worklog-209367 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=209789#comment-209789 Thu, 19 Jan 2017 09:42:27 +0200 Vladislavs Sokurenko <p><b>(11)</b> <span class="error">&#91;F&#93;</span><span class="error">&#91;S&#93;</span> Appropriate message for scripts executed on agent shall be added.</p> <p>Currently message is "Ran":<br/> <span class="image-wrap" style=""><img src="https://support.zabbix.com/secure/attachment/47406/47406_message_for_executed_on_agent.png" style="border: 0px solid black" /></span></p> <p>Decision shall be made on how it must look.<br/> But I personally would prefer that when executed on agent then it would always say "Executed"<br/> When on server "Succeeded" or "Failed".<br/> For mail and media script "Sent" or "Failed" or "In progress"</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso" class="user-hover" rel="vso">vso</a> It was decided:<br/> "Executed" - successfully sent to agent or successfully executed on server.<br/> "Failed" - otherwise.</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a> Reverted to single status for execution with or without checks<br/> Looks like that for same script executed on agent and server:<br/> <span class="image-wrap" style=""><img src="https://support.zabbix.com/secure/attachment/47440/47440_reverted.png" style="border: 0px solid black" /></span></p> <p>RESOLVED in r65163</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso" class="user-hover" rel="vso">vso</a> CLOSED, with small style fix in r65165</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso">Vladislavs Sokurenko</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso">Vladislavs Sokurenko</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=209789\#worklog-209789 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=209730#comment-209730 Tue, 17 Jan 2017 16:25:45 +0200 Vladislavs Sokurenko <p><b>(9)</b> Error message is never displayed to the user for a custom script operation in actions.<br/> Steps:<br/> In action operation detail set:<br/> Type: Custom script<br/> Commands, path to script that does not exist.<br/> For example:<br/> /home/vso/zabbix_eclipse_dev/<a href="https://support.zabbix.com/browse/ZBXNEXT-1380" title="Zabbix server should check the return code of media scripts" class="issue-link" data-issue-key="ZBXNEXT-1380"><del>ZBXNEXT-1380</del></a>/share/zabbix/alertscripts/alert_script</p> <p>Expected:<br/> Message in frontend that is generated by shell:<br/> "/home/vso/zabbix_eclipse_dev/<a href="https://support.zabbix.com/browse/ZBXNEXT-1380" title="Zabbix server should check the return code of media scripts" class="issue-link" data-issue-key="ZBXNEXT-1380"><del>ZBXNEXT-1380</del></a>/share/zabbix/alertscripts/alert_script: not found"</p> <p>Actual:<br/> process exited with code: 127</p> <p>Furthermore this means that buffer is set to NULL so no error messages will be red from custom script.</p> <p>This means that in simple scenario where script could not be found, there will be no error message indicating exactly that.</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a> Added script output collection for all script executions so output can be present if error happens. RESOLVED in r65125</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso" class="user-hover" rel="vso">vso</a> REOPENED, Double free corruption is one of the issues introduced but only occurs at specific scenarios.<br/> The changes are to complex and buggy, please make a simpler solution so the code is clearer and there are no bugs.</p> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> <pre class="code-java"> *** Error in `./sbin/zabbix_agentd: listener #1 [processing request]': <span class="code-object">double</span> free or corruption (top): 0x00000000023122a0 *** ======= Backtrace: ========= /lib/x86_64-linux-gnu/libc.so.6(+0x77725)[0x7fd94fdc0725] /lib/x86_64-linux-gnu/libc.so.6(+0x7ff4a)[0x7fd94fdc8f4a] /lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7fd94fdccabc] ./sbin/zabbix_agentd: listener #1 [processing request](EXECUTE_STR+0x89)[0x422479] ./sbin/zabbix_agentd: listener #1 [processing request](process+0x31c)[0x4171cc] ./sbin/zabbix_agentd: listener #1 [processing request](listener_thread+0x19d)[0x413aed] ./sbin/zabbix_agentd: listener #1 [processing request](zbx_thread_start+0x45)[0x42b135] ./sbin/zabbix_agentd: listener #1 [processing request](MAIN_ZABBIX_ENTRY+0x223)[0x416373] ./sbin/zabbix_agentd: listener #1 [processing request](daemon_start+0x1c3)[0x42be53] ./sbin/zabbix_agentd: listener #1 [processing request](main+0xb0)[0x40be20] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7fd94fd69830] ./sbin/zabbix_agentd: listener #1 [processing request](_start+0x29)[0x40bf29] ======= Memory map: ======== 00400000-00456000 r-xp 00000000 08:02 13763939 /home/vso/zabbix_eclipse_dev/ZBXNEXT-1380/sbin/zabbix_agentd 00655000-00656000 r--p 00055000 08:02 13763939 /home/vso/zabbix_eclipse_dev/ZBXNEXT-1380/sbin/zabbix_agentd 00656000-00658000 rw-p 00056000 08:02 13763939 /home/vso/zabbix_eclipse_dev/ZBXNEXT-1380/sbin/zabbix_agentd 00658000-0065d000 rw-p 00000000 00:00 0 022ef000-02330000 rw-p 00000000 00:00 0 [heap] 7fd944000000-7fd944021000 rw-p 00000000 00:00 0 7fd944021000-7fd948000000 ---p 00000000 00:00 0 7fd94b4ed000-7fd94b503000 r-xp 00000000 08:02 4460969 /lib/x86_64-linux-gnu/libgcc_s.so.1 7fd94b503000-7fd94b702000 ---p 00016000 08:02 4460969 /lib/x86_64-linux-gnu/libgcc_s.so.1 7fd94b702000-7fd94b703000 rw-p 00015000 08:02 4460969 /lib/x86_64-linux-gnu/libgcc_s.so.1 7fd94b703000-7fd94b70c000 r-xp 00000000 08:02 4460941 /lib/x86_64-linux-gnu/libcrypt-2.23.so 7fd94b70c000-7fd94b90b000 ---p 00009000 08:02 4460941 /lib/x86_64-linux-gnu/libcrypt-2.23.so 7fd94b90b000-7fd94b90c000 r--p 00008000 08:02 4460941 /lib/x86_64-linux-gnu/libcrypt-2.23.so 7fd94b90c000-7fd94b90d000 rw-p 00009000 08:02 4460941 /lib/x86_64-linux-gnu/libcrypt-2.23.so 7fd94b90d000-7fd94b93b000 rw-p 00000000 00:00 0 7fd94b93b000-7fd94ba0a000 r-xp 00000000 08:02 14165018 /usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6 7fd94ba0a000-7fd94bc0a000 ---p 000cf000 08:02 14165018 /usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6 7fd94bc0a000-7fd94bc0d000 r--p 000cf000 08:02 14165018 /usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6 7fd94bc0d000-7fd94bc0f000 rw-p 000d2000 08:02 14165018 /usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6 7fd94bc0f000-7fd94bc10000 rw-p 00000000 00:00 0 7fd94bc10000-7fd94bc56000 r-xp 00000000 08:02 14164557 /usr/lib/x86_64-linux-gnu/libhx509.so.5.0.0 7fd94bc56000-7fd94be56000 ---p 00046000 08:02 14164557 /usr/lib/x86_64-linux-gnu/libhx509.so.5.0.0 7fd94be56000-7fd94be58000 r--p 00046000 08:02 14164557 /usr/lib/x86_64-linux-gnu/libhx509.so.5.0.0 7fd94be58000-7fd94be5a000 rw-p 00048000 08:02 14164557 /usr/lib/x86_64-linux-gnu/libhx509.so.5.0.0 7fd94be5a000-7fd94be5b000 rw-p 00000000 00:00 0 7fd94be5b000-7fd94be69000 r-xp 00000000 08:02 14164539 /usr/lib/x86_64-linux-gnu/libheimbase.so.1.0.0 7fd94be69000-7fd94c068000 ---p 0000e000 08:02 14164539 /usr/lib/x86_64-linux-gnu/libheimbase.so.1.0.0 7fd94c068000-7fd94c069000 r--p 0000d000 08:02 14164539 /usr/lib/x86_64-linux-gnu/libheimbase.so.1.0.0 7fd94c069000-7fd94c06a000 rw-p 0000e000 08:02 14164539 /usr/lib/x86_64-linux-gnu/libheimbase.so.1.0.0 7fd94c06a000-7fd94c091000 r-xp 00000000 08:02 14165183 /usr/lib/x86_64-linux-gnu/libwind.so.0.0.0 7fd94c091000-7fd94c291000 ---p 00027000 08:02 14165183 /usr/lib/x86_64-linux-gnu/libwind.so.0.0.0 7fd94c291000-7fd94c292000 r--p 00027000 08:02 14165183 /usr/lib/x86_64-linux-gnu/libwind.so.0.0.0 7fd94c292000-7fd94c293000 rw-p 00028000 08:02 14165183 /usr/lib/x86_64-linux-gnu/libwind.so.0.0.0 7fd94c293000-7fd94c2a8000 r-xp 00000000 08:02 14164936 /usr/lib/x86_64-linux-gnu/libroken.so.18.1.0 7fd94c2a8000-7fd94c4a7000 ---p 00015000 08:02 14164936 /usr/lib/x86_64-linux-gnu/libroken.so.18.1.0 7fd94c4a7000-7fd94c4a8000 r--p 00014000 08:02 14164936 /usr/lib/x86_64-linux-gnu/libroken.so.18.1.0 7fd94c4a8000-7fd94c4a9000 rw-p 00015000 08:02 14164936 /usr/lib/x86_64-linux-gnu/libroken.so.18.1.0 7fd94c4a9000-7fd94c4d9000 r-xp 00000000 08:02 14164537 /usr/lib/x86_64-linux-gnu/libhcrypto.so.4.1.0 7fd94c4d9000-7fd94c6d9000 ---p 00030000 08:02 14164537 /usr/lib/x86_64-linux-gnu/libhcrypto.so.4.1.0 7fd94c6d9000-7fd94c6da000 r--p 00030000 08:02 14164537 /usr/lib/x86_64-linux-gnu/libhcrypto.so.4.1.0 7fd94c6da000-7fd94c6db000 rw-p 00031000 08:02 14164537 /usr/lib/x86_64-linux-gnu/libhcrypto.so.4.1.0 7fd94c6db000-7fd94c6dc000 rw-p 00000000 00:00 0 7fd94c6dc000-7fd94c77b000 r-xp 00000000 08:02 14163981 /usr/lib/x86_64-linux-gnu/libasn1.so.8.0.0 7fd94c77b000-7fd94c97a000 ---p 0009f000 08:02 14163981 /usr/lib/x86_64-linux-gnu/libasn1.so.8.0.0 7fd94c97a000-7fd94c97b000 r--p 0009e000 08:02 14163981 /usr/lib/x86_64-linux-gnu/libasn1.so.8.0.0 7fd94c97b000-7fd94c97e000 rw-p 0009f000 08:02 14163981 /usr/lib/x86_64-linux-gnu/libasn1.so.8.0.0 7fd94c97e000-7fd94ca02000 r-xp 00000000 08:02 14164633 /usr/lib/x86_64-linux-gnu/libkrb5.so.26.0.0 7fd94ca02000-7fd94cc01000 ---p 00084000 08:02 14164633 /usr/lib/x86_64-linux-gnu/libkrb5.so.26.0.0 7fd94cc01000-7fd94cc04000 r--p 00083000 08:02 14164633 /usr/lib/x86_64-linux-gnu/libkrb5.so.26.0.0 7fd94cc04000-7fd94cc07000 rw-p 00086000 08:02 14164633 /usr/lib/x86_64-linux-gnu/libkrb5.so.26.0.0 7fd94cc07000-7fd94cc08000 rw-p 00000000 00:00 0 7fd94cc08000-7fd94cc10000 r-xp 00000000 08:02 14164541 /usr/lib/x86_64-linux-gnu/libheimntlm.so.0.1.0 7fd94cc10000-7fd94ce0f000 ---p 00008000 08:02 14164541 /usr/lib/x86_64-linux-gnu/libheimntlm.so.0.1.0 7fd94ce0f000-7fd94ce10000 r--p 00007000 08:02 14164541 /usr/lib/x86_64-linux-gnu/libheimntlm.so.0.1.0 7fd94ce10000-7fd94ce11000 rw-p 00008000 08:02 14164541 /usr/lib/x86_64-linux-gnu/libheimntlm.so.0.1.0 7fd94ce11000-7fd94ce14000 r-xp 00000000 08:02 4460992 /lib/x86_64-linux-gnu/libkeyutils.so.1.5 7fd94ce14000-7fd94d013000 ---p 00003000 08:02 4460992 /lib/x86_64-linux-gnu/libkeyutils.so.1.5 7fd94d013000-7fd94d014000 r--p 00002000 08:02 4460992 /lib/x86_64-linux-gnu/libkeyutils.so.1.5 7fd94d014000-7fd94d015000 rw-p 00003000 08:02 4460992 /lib/x86_64-linux-gnu/libkeyutils.so.1.5 7fd94d015000-7fd94d01c000 r-xp 00000000 08:02 14164274 /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4 7fd94d01c000-7fd94d21b000 ---p 00007000 08:02 14164274 /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4 7fd94d21b000-7fd94d21c000 r--p 00006000 08:02 14164274 /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4 7fd94d21c000-7fd94d21d000 rw-p 00007000 08:02 14164274 /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4 7fd94d21d000-7fd94d25a000 r-xp 00000000 08:02 14164462 /usr/lib/x86_64-linux-gnu/libgssapi.so.3.0.0 7fd94d25a000-7fd94d45a000 ---p 0003d000 08:02 14164462 /usr/lib/x86_64-linux-gnu/libgssapi.so.3.0.0 7fd94d45a000-7fd94d45b000 r--p 0003d000 08:02 14164462 /usr/lib/x86_64-linux-gnu/libgssapi.so.3.0.0 7fd94d45b000-7fd94d45d000 rw-p 0003e000 08:02 14164462 /usr/lib/x86_64-linux-gnu/libgssapi.so.3.0.0 7fd94d45d000-7fd94d45e000 rw-p 00000000 00:00 0 7fd94d45e000-7fd94d477000 r-xp 00000000 08:02 14164963 /usr/lib/x86_64-linux-gnu/libsasl2.so.2.0.25 7fd94d477000-7fd94d677000 ---p 00019000 08:02 14164963 /usr/lib/x86_64-linux-gnu/libsasl2.so.2.0.25 7fd94d677000-7fd94d678000 r--p 00019000 08:02 14164963 /usr/lib/x86_64-linux-gnu/libsasl2.so.2.0.25 7fd94d678000-7fd94d679000 rw-p 0001a000 08:02 14164963 /usr/lib/x86_64-linux-gnu/libsasl2.so.2.0.25 7fd94d679000-7fd94d683000 r-xp 00000000 08:02 14164637 /usr/lib/x86_64-linux-gnu/libkrb5support.so.0.1 7fd94d683000-7fd94d882000 ---p 0000a000 08:02 14164637 /usr/lib/x86_64-linux-gnu/libkrb5support.so.0.1 7fd94d882000-7fd94d883000 r--p 00009000 08:02 14164637 /usr/lib/x86_64-linux-gnu/libkrb5support.so.0.1 7fd94d883000-7fd94d884000 rw-p 0000a000 08:02 14164637 /usr/lib/x86_64-linux-gnu/libkrb5support.so.0.1 7fd94d884000-7fd94d887000 r-xp 00000000 08:02 4460940 /lib/x86_64-linux-gnu/libcom_err.so.2.1 7fd94d887000-7fd94da86000 ---p 00003000 08:02 4460940 /lib/x86_64-linux-gnu/libcom_err.so.2.1 7fd94da86000-7fd94da87000 r--p 00002000 08:02 4460940 /lib/x86_64-linux-gnu/libcom_err.so.2.1 7fd94da87000-7fd94da88000 rw-p 00003000 08:02 4460940 /lib/x86_64-linux-gnu/libcom_err.so.2.1 7fd94da88000-7fd94dab4000 r-xp 00000000 08:02 14164629 /usr/lib/x86_64-linux-gnu/libk5crypto.so.3.1 7fd94dab4000-7fd94dcb3000 ---p 0002c000 08:02 14164629 /usr/lib/x86_64-linux-gnu/libk5crypto.so.3.1 7fd94dcb3000-7fd94dcb5000 r--p 0002b000 08:02 14164629 /usr/lib/x86_64-linux-gnu/libk5crypto.so.3.1 7fd94dcb5000-7fd94dcb6000 rw-p 0002d000 08:02 14164629 /usr/lib/x86_64-linux-gnu/libk5crypto.so.3.1 7fd94dcb6000-7fd94dcb7000 rw-p 00000000 00:00 0 7fd94dcb7000-7fd94dd7a000 r-xp 00000000 08:02 14164635 /usr/lib/x86_64-linux-gnu/libkrb5.so.3.3 7fd94dd7a000-7fd94df7a000 ---p 000c3000 08:02 14164635 /usr/lib/x86_64-linux-gnu/libkrb5.so.3.3 7fd94df7a000-7fd94df87000 r--p 000c3000 08:02 14164635 /usr/lib/x86_64-linux-gnu/libkrb5.so.3.3 7fd94df87000-7fd94df89000 rw-p 000d0000 08:02 14164635 /usr/lib/x86_64-linux-gnu/libkrb5.so.3.3 7fd94df89000-7fd94df9a000 r-xp 00000000 08:02 14165035 /usr/lib/x86_64-linux-gnu/libtasn1.so.6.5.1 7fd94df9a000-7fd94e19a000 ---p 00011000 08:02 14165035 /usr/lib/x86_64-linux-gnu/libtasn1.so.6.5.1 7fd94e19a000-7fd94e19b000 r--p 00011000 08:02 14165035 /usr/lib/x86_64-linux-gnu/libtasn1.so.6.5.1 7fd94e19b000-7fd94e19c000 rw-p 00012000 08:02 14165035 /usr/lib/x86_64-linux-gnu/libtasn1.so.6.5.1 7fd94e19c000-7fd94e1f5000 r-xp 00000000 08:02 14155987 /usr/lib/x86_64-linux-gnu/libp11-kit.so.0.1.0 7fd94e1f5000-7fd94e3f4000 ---p 00059000 08:02 14155987 /usr/lib/x86_64-linux-gnu/libp11-kit.so.0.1.0 7fd94e3f4000-7fd94e3fe000 r--p 00058000 08:02 14155987 /usr/lib/x86_64-linux-gnu/libp11-kit.so.0.1.0 7fd94e3fe000-7fd94e400000 rw-p 00062000 08:02 14155987 /usr/lib/x86_64-linux-gnu/libp11-kit.so.0.1.0 7fd94e400000-7fd94e47f000 r-xp 00000000 08:02 14164407 /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.0 7fd94e47f000-7fd94e67e000 ---p 0007f000 08:02 14164407 /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.0 7fd94e67e000-7fd94e67f000 r--p 0007e000 08:02 14164407 /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.0 7fd94e67f000-7fd94e680000 rw-p 0007f000 08:02 14164407 /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.0 7fd94e680000-7fd94e6b2000 r-xp 00000000 08:02 14164543 /usr/lib/x86_64-linux-gnu/libhogweed.so.4.2 7fd94e6b2000-7fd94e8b1000 ---p 00032000 08:02 14164543 /usr/lib/x86_64-linux-gnu/libhogweed.so.4.2 7fd94e8b1000-7fd94e8b2000 r--p 00031000 08:02 14164543 /usr/lib/x86_64-linux-gnu/libhogweed.so.4.2 7fd94e8b2000-7fd94e8b3000 rw-p 00032000 08:02 14164543 /usr/lib/x86_64-linux-gnu/libhogweed.so.4.2 7fd94e8b3000-7fd94e8cb000 r-xp 00000000 08:02 4461077 /lib/x86_64-linux-gnu/libpthread-2.23.so 7fd94e8cb000-7fd94eaca000 ---p 00018000 08:02 4461077 /lib/x86_64-linux-gnu/libpthread-2.23.so 7fd94eaca000-7fd94eacb000 r--p 00017000 08:02 4461077 /lib/x86_64-linux-gnu/libpthread-2.23.so 7fd94eacb000-7fd94eacc000 rw-p 00018000 08:02 4461077 /lib/x86_64-linux-gnu/libpthread-2.23.so 7fd94eacc000-7fd94ead0000 rw-p 00000000 00:00 0 7fd94ead0000-7fd94eae9000 r-xp 00000000 08:02 4461122 /lib/x86_64-linux-gnu/libz.so.1.2.8 7fd94eae9000-7fd94ece8000 ---p 00019000 08:02 4461122 /lib/x86_64-linux-gnu/libz.so.1.2.8 7fd94ece8000-7fd94ece9000 r--p 00018000 08:02 4461122 /lib/x86_64-linux-gnu/libz.so.1.2.8 7fd94ece9000-7fd94ecea000 rw-p 00019000 08:02 4461122 /lib/x86_64-linux-gnu/libz.so.1.2.8 7fd94ecea000-7fd94ed37000 r-xp 00000000 08:02 14164648 /usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2.10.5 7fd94ed37000-7fd94ef36000 ---p 0004d000 08:02 14164648 /usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2.10.5 7fd94ef36000-7fd94ef38000 r--p 0004c000 08:02 14164648 /usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2.10.5 7fd94ef38000-7fd94ef39000 rw-p 0004e000 08:02 14164648 /usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2.10.5 7fd94ef39000-7fd94ef3b000 rw-p 00000000 00:00 0 7fd94ef3b000-7fd94ef48000 r-xp 00000000 08:02 14164643 /usr/lib/x86_64-linux-gnu/liblber-2.4.so.2.10.5 7fd94ef48000-7fd94f148000 ---p 0000d000 08:02 14164643 /usr/lib/x86_64-linux-gnu/liblber-2.4.so.2.10.5 7fd94f148000-7fd94f149000 r--p 0000d000 08:02 14164643 /usr/lib/x86_64-linux-gnu/liblber-2.4.so.2.10.5 7fd94f149000-7fd94f14a000 rw-p 0000e000 08:02 14164643 /usr/lib/x86_64-linux-gnu/liblber-2.4.so.2.10.5 7fd94f14a000-7fd94f191000 r-xp 00000000 08:02 14164464 /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2.2 7fd94f191000-7fd94f390000 ---p 00047000 08:02 14164464 /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2.2 7fd94f390000-7fd94f392000 r--p 00046000 08:02 14164464 /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2.2 7fd94f392000-7fd94f394000 rw-p 00048000 08:02 14164464 /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2.2 7fd94f394000-7fd94f4b7000 r-xp 00000000 08:02 14164425 /usr/lib/x86_64-linux-gnu/libgnutls.so.30.6.2 7fd94f4b7000-7fd94f6b6000 ---p 00123000 08:02 14164425 /usr/lib/x86_64-linux-gnu/libgnutls.so.30.6.2 7fd94f6b6000-7fd94f6c1000 r--p 00122000 08:02 14164425 /usr/lib/x86_64-linux-gnu/libgnutls.so.30.6.2 7fd94f6c1000-7fd94f6c3000 rw-p 0012d000 08:02 14164425 /usr/lib/x86_64-linux-gnu/libgnutls.so.30.6.2 7fd94f6c3000-7fd94f6c4000 rw-p 00000000 00:00 0 7fd94f6c4000-7fd94f6f8000 r-xp 00000000 08:02 14164753 /usr/lib/x86_64-linux-gnu/libnettle.so.6.2 7fd94f6f8000-7fd94f8f7000 ---p 00034000 08:02 14164753 /usr/lib/x86_64-linux-gnu/libnettle.so.6.2 7fd94f8f7000-7fd94f8f9000 r--p 00033000 08:02 14164753 /usr/lib/x86_64-linux-gnu/libnettle.so.6.2 7fd94f8f9000-7fd94f8fa000 rw-p 00035000 08:02 14164753 /usr/lib/x86_64-linux-gnu/libnettle.so.6.2 7fd94f8fa000-7fd94f915000 r-xp 00000000 08:02 14164944 /usr/lib/x86_64-linux-gnu/librtmp.so.1 7fd94f915000-7fd94fb14000 ---p 0001b000 08:02 14164944 /usr/lib/x86_64-linux-gnu/librtmp.so.1 7fd94fb14000-7fd94fb15000 r--p 0001a000 08:02 14164944 /usr/lib/x86_64-linux-gnu/librtmp.so.1 7fd94fb15000-7fd94fb16000 rw-p 0001b000 08:02 14164944 /usr/lib/x86_64-linux-gnu/librtmp.so.1 7fd94fb16000-7fd94fb47000 r-xp 00000000 08:02 14156253 /usr/lib/x86_64-linux-gnu/libidn.so.11.6.15 7fd94fb47000-7fd94fd47000 ---p 00031000 08:02 14156253 /usr/lib/x86_64-linux-gnu/libidn.so.11.6.15 7fd94fd47000-7fd94fd48000 r--p 00031000 08:02 14156253 /usr/lib/x86_64-linux-gnu/libidn.so.11.6.15 7fd94fd48000-7fd94fd49000 rw-p 00032000 08:02 14156253 /usr/lib/x86_64-linux-gnu/libidn.so.11.6.15 7fd94fd49000-7fd94ff09000 r-xp 00000000 08:02 4460931 /lib/x86_64-linux-gnu/libc-2.23.so 7fd94ff09000-7fd950108000 ---p 001c0000 08:02 4460931 /lib/x86_64-linux-gnu/libc-2.23.so 7fd950108000-7fd95010c000 r--p 001bf000 08:02 4460931 /lib/x86_64-linux-gnu/libc-2.23.so 7fd95010c000-7fd95010e000 rw-p 001c3000 08:02 4460931 /lib/x86_64-linux-gnu/libc-2.23.so 7fd95010e000-7fd950112000 rw-p 00000000 00:00 0 7fd950112000-7fd950129000 r-xp 00000000 08:02 4461083 /lib/x86_64-linux-gnu/libresolv-2.23.so 7fd950129000-7fd950329000 ---p 00017000 08:02 4461083 /lib/x86_64-linux-gnu/libresolv-2.23.so 7fd950329000-7fd95032a000 r--p 00017000 08:02 4461083 /lib/x86_64-linux-gnu/libresolv-2.23.so 7fd95032a000-7fd95032b000 rw-p 00018000 08:02 4461083 /lib/x86_64-linux-gnu/libresolv-2.23.so 7fd95032b000-7fd95032d000 rw-p 00000000 00:00 0 7fd95032d000-7fd950330000 r-xp 00000000 08:02 4460955 /lib/x86_64-linux-gnu/libdl-2.23.so 7fd950330000-7fd95052f000 ---p 00003000 08:02 4460955 /lib/x86_64-linux-gnu/libdl-2.23.so 7fd95052f000-7fd950530000 r--p 00002000 08:02 4460955 /lib/x86_64-linux-gnu/libdl-2.23.so 7fd950530000-7fd950531000 rw-p 00003000 08:02 4460955 /lib/x86_64-linux-gnu/libdl-2.23.so 7fd950531000-7fd95059a000 r-xp 00000000 08:02 14166919 /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.4.0 7fd95059a000-7fd95079a000 ---p 00069000 08:02 14166919 /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.4.0 7fd95079a000-7fd95079d000 r--p 00069000 08:02 14166919 /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.4.0 7fd95079d000-7fd95079e000 rw-p 0006c000 08:02 14166919 /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.4.0 7fd95079e000-7fd9507c4000 r-xp 00000000 08:02 4460903 /lib/x86_64-linux-gnu/ld-2.23.so 7fd9508f1000-7fd950992000 rw-s 00000000 00:05 35684393 /SYSV6c020209 (deleted) 7fd950992000-7fd9509a3000 rw-p 00000000 00:00 0 7fd9509c0000-7fd9509c1000 rw-p 00000000 00:00 0 7fd9509c1000-7fd9509c3000 rw-p 00000000 00:00 0 7fd9509c3000-7fd9509c4000 r--p 00025000 08:02 4460903 /lib/x86_64-linux-gnu/ld-2.23.so 7fd9509c4000-7fd9509c5000 rw-p 00026000 08:02 4460903 /lib/x86_64-linux-gnu/ld-2.23.so 7fd9509c5000-7fd9509c6000 rw-p 00000000 00:00 0 7ffdceab2000-7ffdcead3000 rw-p 00000000 00:00 0 [stack] 7ffdceb43000-7ffdceb45000 r--p 00000000 00:00 0 [vvar] 7ffdceb45000-7ffdceb47000 r-xp 00000000 00:00 0 [vdso] ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall] 23302:20170117:115534.330 One child process died (PID:23305,exitcode/signal:6). Exiting ... zabbix_agentd [23302]: Error waiting <span class="code-keyword">for</span> process with PID 23305: [10] No child processes 23302:20170117:115534.330 Zabbix Agent stopped. Zabbix 3.3.0 (revision {ZABBIX_REVISION}). </pre> </div></div> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a> Sorry, I missed the fact that zbx_free alters the value of the pointer. All bugs produced are not intended (even if it seems so), but thanks for advice to make code without bugs. As for simplicity, this solution is the simplest way to get output when errors occur. RESOLVED in r65131.</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso" class="user-hover" rel="vso">vso</a> REOPENED, there is memory leak if <tt>zbx_execute</tt> is called multiple times with same pointer.</p> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> <pre class="code-java"> ==27414== 131,072 bytes in 1 blocks are definitely lost in loss record 25 of 26 ==27414== at 0x4C2FD5F: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==27414== by 0x4317FA: zbx_realloc2 (misc.c:499) ==27414== by 0x4353FF: zbx_strncpy_alloc (str.c:312) ==27414== by 0x43ECA5: zbx_execute (execute.c:426) ==27414== by 0x41E9EE: SYSTEM_SW_PACKAGES (software.c:226) ==27414== by 0x4171CB: process (sysinfo.c:641) ==27414== by 0x413AEC: process_listener (listener.c:58) ==27414== by 0x413AEC: listener_thread (listener.c:145) ==27414== by 0x42B184: zbx_thread_start (threads.c:128) ==27414== by 0x416372: MAIN_ZABBIX_ENTRY (zabbix_agentd.c:966) ==27414== by 0x42BEA2: daemon_start (daemon.c:392) ==27414== by 0x40BE1F: main (zabbix_agentd.c:1203) </pre> </div></div> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a> Restored previous logic when free is applied to the param value. RESOLVED in r65132</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso" class="user-hover" rel="vso">vso</a> CLOSED with small style fixes in r65133</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso">Vladislavs Sokurenko</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso">Vladislavs Sokurenko</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=209730\#worklog-209730 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=209761#comment-209761 Tue, 17 Jan 2017 14:05:51 +0200 Vladislavs Sokurenko <p><b>(10)</b> IPMI will no be possible to execute on server if not current server target is specified.<br/> Check has been added not to copy communication parameters if executed on server, however if it's not custom script but for example IPMI then server must copy communication parameters.</p> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> <pre class="code-java"> <span class="code-keyword">if</span> (ZBX_SCRIPT_EXECUTE_ON_SERVER != script.execute_on) { host.tls_connect = (unsigned <span class="code-object">char</span>)atoi(row[12]); #ifdef HAVE_OPENIPMI host.ipmi_authtype = (signed <span class="code-object">char</span>)atoi(row[13]); host.ipmi_privilege = (unsigned <span class="code-object">char</span>)atoi(row[14]); strscpy(host.ipmi_username, row[15]); strscpy(host.ipmi_password, row[16]); #endif #<span class="code-keyword">if</span> defined(HAVE_POLARSSL) || defined(HAVE_GNUTLS) || defined(HAVE_OPENSSL) strscpy(host.tls_issuer, row[13 + ZBX_IPMI_FIELDS_NUM]); strscpy(host.tls_subject, row[14 + ZBX_IPMI_FIELDS_NUM]); strscpy(host.tls_psk_identity, row[15 + ZBX_IPMI_FIELDS_NUM]); strscpy(host.tls_psk, row[16 + ZBX_IPMI_FIELDS_NUM]); #endif </pre> </div></div> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a> Check is valid. script.execute_on is initialized only for custom script.</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso" class="user-hover" rel="vso">vso</a> CLOSED, yes you are right.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso">Vladislavs Sokurenko</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso">Vladislavs Sokurenko</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=209761\#worklog-209761 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=208322#comment-208322 Tue, 17 Jan 2017 10:30:21 +0200 Vladislavs Sokurenko <p><b>(6)</b> Script on zabbix_agent gets killed before it finish execution, if it executes longer than "Timeout" which is 3 by default and max 30 seconds.</p> <p>Previously:<br/> Remote commands on Zabbix agent are executed without timeout by the key </p> <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> <pre>system.run[,nowait]</pre> </div></div> <p>Meaning that users can have very long running scripts without being afraid that they will get timed out and killed.</p> <p>Now:<br/> On Zabbix agent remote commands are executed with timeout as set in the Timeout parameter of zabbix_agent.conf file.</p> <p>Expected:<br/> When user has script that executes longer than Timeout variable from config file, when he upgrades to new version, he must still be able to execute scripts as before, which is without time limit.</p> <p>Actual:<br/> All users who have script running longer than Timeout variable from config file will get their script killed and see "Timeout while executing a shell script." in the frontend.</p> <p>This is blocker.</p> <p>I suggest that such use cases need to be clearly defined in specification and solution discussed and approved.</p> <p>Why this is happening ?<br/> Output has been added to code below.</p> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> <pre class="code-java"> <span class="code-keyword">if</span> (SUCCEED == (rc = zbx_execute_script(&amp;host, &amp;script, NULL, &amp;output, error, sizeof(error)))) zabbix_log(LOG_LEVEL_DEBUG, <span class="code-quote">"%s output:\n%s"</span>, script.command, output); </pre> </div></div> <p>And in function <tt>zbx_execute_script_on_agent()</tt> it is used to change <tt>"nowait"</tt> to <tt>"wait</tt></p> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> <pre class="code-java"> item.key = zbx_dsprintf(item.key, <span class="code-quote">"system.run[%s,%s]"</span>, param, NULL == result ? <span class="code-quote">"nowait"</span> : <span class="code-quote">"wait"</span>); </pre> </div></div> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a> There are no other options if we need to get output for log. So the only options are to drop the log to allow users to execute long running scripts or to check result code, but limit execution time.</p> <p>I am not sure if we can consider that there is no need for exit code check in this case. I agree that behavior changes for multiple cases, but it is not really a blocker as user can create background scripts for cases like that (if it is an intended behavior).</p> <p><a href="https://www.zabbix.com/documentation/3.2/manual/web_interface/frontend_sections/administration/scripts" class="external-link" target="_blank" rel="nofollow noopener">Documentation for scripts</a> does not provide information about this kind of behavior (execute on agent = async without limits, execute on server = limited by a timeout) so as far as I understand, I would say that current solution unifies solutions for server and agent.</p> <p>Similar situation is with system.run item that will now start to check exit code and can become unsupported because of that.</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso" class="user-hover" rel="vso">vso</a> Here is link from documentation <a href="https://www.zabbix.com/documentation/3.4/manual/config/notifications/action/operation/remote_command" class="external-link" target="_blank" rel="nofollow noopener">Remote commands on Zabbix agent are executed without timeout</a><br/> All I mean that changes/behavior must be very well documented and decision made. Current consequences are that if user has script that needs to be running infinitely or more than 30 seconds, it suddenly will not be possible, it will get killed at max 30 seconds but by default in 3 seconds.<br/> The reason why I think that current solution for agent is not acceptable is because it will suddenly kill user scripts that previously were not killed and limit functionality of scripts to 30 seconds on agent. (killing scripts in the middle of work could also break something)<br/> Also performance must be evaluated, if agent now waits for commands to execute and server wait for agent response.</p> <p>I don't see any problems in checking result code on <a href="https://www.zabbix.com/documentation/3.4/manual/config/notifications/media/script" class="external-link" target="_blank" rel="nofollow noopener">custom alertscript</a> that is executed on server though. </p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a> I added extra description about such cases in specification. We could also implement async remote command execution to bypass this timeout limit but it is not an easy fix so it should be evaluated.</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso" class="user-hover" rel="vso">vso</a> Thanks ! Lets wait for approval.</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a> It was decided to ignore return code of commands executed on agent and to introduce new action status - "RAN" that means "Executed, but not checked". RESOLVED in r65091</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso" class="user-hover" rel="vso">vso</a> CLOSED, though exact messages that need to be displayed are to be confirmed, but it will be minor change.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso">Vladislavs Sokurenko</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso">Vladislavs Sokurenko</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=208322\#worklog-208322 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=208218#comment-208218 Tue, 17 Jan 2017 10:20:24 +0200 Vladislavs Sokurenko <p><b>(5)</b> If child did not terminate normally, still SUCCESS is returned.</p> <p>The code below means if the child terminated normally and exit status is not success then fail.<br/> else SUCCESS</p> <p>But what if child did not terminate normally ? It shall also be failure.</p> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> <pre class="code-java"> <span class="code-keyword">else</span> <span class="code-keyword">if</span> (WIFEXITED(status) &amp;&amp; EXIT_SUCCESS != WEXITSTATUS(status)) { ... } <span class="code-keyword">else</span> ret = SUCCEED; </pre> </div></div> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a> There are multiple options when this kind of "false positive" result can occur:<br/> 1. Process was terminated by a signal (no exit code to check).<br/> 2. Internal error (GetExitCodeProcess fails, etc.) where is no way to get status code.<br/> So the question is: should we consider absence of exit code as an error code != 0. If we do so, then we should consider if we need to retry execution in this case as it can cause unpredictable results.</p> <p>I suggest to add extra status code "UNKNOWN" for situations where script execution status is unknown (so we don't have "Done" in frontend).</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a> Even more, on unix-like systems, command is being executed from shell and even if signal occurs it is handled by shell and exit code is set to non-zero so this is a really specific case when shell crashes.</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a> It was decided to consider signaled state as a failure without altering the retry logic. RESOLVED in r65091 </p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso" class="user-hover" rel="vso">vso</a> CLOSED</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso">Vladislavs Sokurenko</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso">Vladislavs Sokurenko</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=208218\#worklog-208218 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=208215#comment-208215 Tue, 17 Jan 2017 10:12:28 +0200 Vladislavs Sokurenko <p><b>(4)</b> When exec function return error, frontend still display success.</p> <p>The exec() functions return only if an error has occurred, but we set success on error.<br/> Please see below, the log say "execl() failed but EXIT_SUCCESS is returned."<br/> Same is with <tt>setpgid</tt> in <tt>zbx_popen</tt> function.</p> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> <pre class="code-java"> zabbix_log(LOG_LEVEL_DEBUG, <span class="code-quote">"%s(): executing script"</span>, __function_name); execl(<span class="code-quote">"/bin/sh"</span>, <span class="code-quote">"sh"</span>, <span class="code-quote">"-c"</span>, command, NULL); <span class="code-comment">/* execl() returns only when an error occurs */</span> zabbix_log(LOG_LEVEL_WARNING, <span class="code-quote">"execl() failed <span class="code-keyword">for</span> [%s]: %s"</span>, command, zbx_strerror(errno)); exit(EXIT_SUCCESS); </pre> </div></div> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a> RESOLVED in r64870.</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso" class="user-hover" rel="vso">vso</a> CLOSED, now process exited with code: 1 is displayed.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso">Vladislavs Sokurenko</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso">Vladislavs Sokurenko</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=208215\#worklog-208215 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=208197#comment-208197 Tue, 3 Jan 2017 11:31:55 +0200 Vladislavs Sokurenko <p><b>(3)</b> Log is not formatted to zabbix style and misleading.</p> <p>It says printing output while output variable is not printed, instead it prints error variable, and furthermore log is only executed on SUCCEED so there should be no error to print.<br/> It will not be clear that command is printed when reading log, there is just command without description, also there are no apostrophe as in other places so not clear where it ends.<br/> There are new line in the middle of log, there are no such logs in zabbix and this breaks consistency.</p> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> <pre class="code-java"> zabbix_log(LOG_LEVEL_DEBUG, <span class="code-quote">"%s output:\n%s"</span>, script.command, error); </pre> </div></div> <p>Example logs:</p> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> <pre class="code-java"> zabbix_log(LOG_LEVEL_DEBUG, <span class="code-quote">"In %s() host:<span class="code-quote">'%s'</span> hostid:%d"</span>, __function_name, host, hostid); zabbix_log(LOG_LEVEL_DEBUG, <span class="code-quote">"get value from agent result: <span class="code-quote">'%s'</span>"</span>, s.buffer); </pre> </div></div> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs" class="user-hover" rel="vjaceslavs">vjaceslavs</a> There was an error in code <b>(2)</b> - should be "output" (not an "error"). And log "style" was taken from alerter.c (126) to make consistent output so can't agree with "there are no such logs in zabbix". Should I change existing log style in alerter as well?</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso" class="user-hover" rel="vso">vso</a> CLOSED, <b>(2)</b> fixes it, it's fine for long data.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso">Vladislavs Sokurenko</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vso">Vladislavs Sokurenko</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=208197\#worklog-208197 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=208131#comment-208131 Mon, 2 Jan 2017 12:07:21 +0200 Vjaceslavs Bogdanovs <p>Ready for testing in development branch svn://svn.zabbix.com/branches/dev/ZBXNEXT-1380</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=vjaceslavs">Vjaceslavs Bogdanovs</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=208131\#worklog-208131 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=205496#comment-205496 Thu, 8 Dec 2016 16:52:32 +0200 Stefan Radman <p>No, I don't think it makes sense to retry when the script returns an error code, with one possible exception being exit code 75:</p> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> <pre class="code-java"> $ grep -A3 TEMPFAIL /usr/include/sysexits.h * EX_TEMPFAIL -- temporary failure, indicating something that * is not really an error. In sendmail, <span class="code-keyword">this</span> means * that a mailer (e.g.) could not create a connection, * and the request should be reattempted later. -- #define EX_TEMPFAIL 75 <span class="code-comment">/* temp failure; user is invited to retry */</span> #define EX_PROTOCOL 76 <span class="code-comment">/* remote error in protocol */</span> #define EX_NOPERM 77 <span class="code-comment">/* permission denied */</span> #define EX_CONFIG 78 <span class="code-comment">/* configuration error */</span> </pre> </div></div> <p>See also: <a href="https://tools.ietf.org/html/rfc3463#section-2" class="external-link" target="_blank" rel="nofollow noopener">https://tools.ietf.org/html/rfc3463#section-2</a><br/> Maybe also code 11:</p> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> <pre class="code-java"> $ grep EAGAIN /usr/include/asm-<span class="code-keyword">generic</span>/errno-base.h #define EAGAIN 11 <span class="code-comment">/* Try again */</span> </pre> </div></div> <p>Configurable timeout (and possibly retries) would definitely be an asset.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=stefan.radman">Stefan Radman</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=stefan.radman">Stefan Radman</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=205496\#worklog-205496 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=205469#comment-205469 Thu, 8 Dec 2016 16:23:24 +0200 Oleksii Zagorskyi <p>Thinking about, for example, an alert script, used to sent SMSs through a sms-gateway in the Internet, where connections to the gateway randomly could be failed before timeout ...</p> <p>Just a question - Zabbix uses ALERT_MAX_RETRIES=3 to send alerts.<br/> Does it make any sense to do the same thing for custom alert scripts when it exits with error code (currently it applies only for timeout of script execution) ?</p> <p>Also, thinking about the 40 seconds hardcoded timeout to be configurable ... <img class="emoticon" src="https://support.zabbix.com/images/icons/emoticons/smile.png" height="16" width="16" align="absmiddle" alt="" border="0"/></p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=zalex_ua">Oleksii Zagorskyi</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=zalex_ua">Oleksii Zagorskyi</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=205469\#worklog-205469 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=205071#comment-205071 Mon, 5 Dec 2016 23:43:56 +0200 Volker Fröhlich <p>Can you please publish this roadmap, maybe here?</p> <p><a href="http://zabbix.org/mw/index.php?title=Docs/roadmap" class="external-link" target="_blank" rel="nofollow noopener">http://zabbix.org/mw/index.php?title=Docs/roadmap</a></p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=volter">Volker Fröhlich</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=205071\#worklog-205071 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=205022#comment-205022 Mon, 5 Dec 2016 12:40:53 +0200 Alexei Vladishev <p>I hope it will be implemented in Zabbix 3.4, it's in the roadmap.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=alexei">Alexei Vladishev</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=205022\#worklog-205022 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=202496#comment-202496 Mon, 14 Nov 2016 00:08:26 +0200 Oleksii Zagorskyi <p>Rich, for commands executed on agent side - that's correct and you are right. I don't consider such case here.<br/> In previous comment I meant "remote commands" executed <b>on zabbix server</b>, as shown in the debug log above.<br/> Doc <a href="https://www.zabbix.com/documentation/3.0/manual/config/notifications/action/operation/remote_command" class="external-link" target="_blank" rel="nofollow noopener">https://www.zabbix.com/documentation/3.0/manual/config/notifications/action/operation/remote_command</a> says:</p> <blockquote> <p>On Zabbix server remote commands are executed with timeout as set in the TrapperTimeout parameter of zabbix_server.conf file</p></blockquote> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=zalex_ua">Oleksii Zagorskyi</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=zalex_ua">Oleksii Zagorskyi</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=202496\#worklog-202496 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=202493#comment-202493 Sun, 13 Nov 2016 23:20:12 +0200 richlv <p>remote commands might be much harder - server does not wait for the command to be executed. it just sends the command to the agent and gets back '1' (see system.run[nowait,&lt;command&gt;])</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=richlv">richlv</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=202493\#worklog-202493 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=202488#comment-202488 Sun, 13 Nov 2016 16:38:26 +0200 Oleksii Zagorskyi <p>It would be also nice if SDTERR of alert script would be stored as error message (in alerts), similarly as we log errors for "Email" media type.</p> <p>I use the this dummy script as alert media (and remmote command, below):</p> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> <pre class="code-java"> # cat /etc/zabbix/alertscripts/test.pl #!/usr/bin/perl #use warnings; use strict; print <span class="code-quote">"done\n"</span>; sdfg sf </pre> </div></div> <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> <pre> # /etc/zabbix/alertscripts/test.pl done Can't locate object method "sdfg" via package "sf" (perhaps you forgot to load "sf"?) at /etc/zabbix/alertscripts/test.pl line 6. # /etc/zabbix/alertscripts/test.pl 1&gt;/dev/null Can't locate object method "sdfg" via package "sf" (perhaps you forgot to load "sf"?) at /etc/zabbix/alertscripts/test.pl line 6. # /etc/zabbix/alertscripts/test.pl 2&gt;/dev/null done </pre> </div></div> <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> <pre> 20676:20161113:162315.421 __zbx_zbx_setproctitle() title:'alerter [sending alerts]' 20676:20161113:162315.421 query [txnlev:0] [select a.alertid,a.mediatypeid,a.sendto,a.subject,a.message,a.status,mt.mediatypeid,mt.type,mt.description,mt.smtp_server,mt.smtp_helo,mt.smtp_email,mt.exec_path,mt.gsm_modem,mt.username,mt.passwd,mt.smtp_port,mt.smtp_security,mt.smtp_verify_peer,mt.smtp_verify_host,mt.smtp_authentication,mt.exec_params,a.retries from alerts a,media_type mt where a.mediatypeid=mt.mediatypeid and a.status=0 and a.alerttype=0 order by a.alertid] 20676:20161113:162315.422 In execute_action(): alertid [130] mediatype [0] 20676:20161113:162315.422 In send_email() smtp_server:'mail.zabbix.com' smtp_port:25 smtp_security:0 smtp_authentication:0 20676:20161113:162320.773 End of send_email():SUCCEED 20676:20161113:162320.773 End of execute_action():SUCCEED 20676:20161113:162320.773 alert ID [130] was sent successfully 20676:20161113:162320.773 query without transaction detected 20676:20161113:162320.773 query [txnlev:0] [update alerts set status=1,error='' where alertid=130] 20676:20161113:162320.774 In execute_action(): alertid [131] mediatype [1] 20676:20161113:162320.774 In zbx_popen() command:'/etc/zabbix/alertscripts/test.pl' 20676:20161113:162320.775 End of zbx_popen():9 20838:20161113:162320.776 zbx_popen(): executing script 20676:20161113:162320.779 In zbx_waitpid() 20676:20161113:162320.779 zbx_waitpid() exited, status:255 20676:20161113:162320.779 End of zbx_waitpid():20838 20676:20161113:162320.779 test.pl output: Can't locate object method "sdfg" via package "sf" (perhaps you forgot to load "sf"?) at /etc/zabbix/alertscripts/test.pl line 4. done 20676:20161113:162320.779 End of execute_action():SUCCEED 20676:20161113:162320.779 alert ID [131] was sent successfully 20676:20161113:162320.779 query without transaction detected 20676:20161113:162320.779 query [txnlev:0] [update alerts set status=1,error='' where alertid=131] 20676:20161113:162320.780 __zbx_zbx_setproctitle() title:'alerter [sent alerts: 2 success, 0 fail in 5.358552 sec, idle 5 sec]' </pre> </div></div> <p>And for consistency .... remote command (performed by escalator, not alerter) should be taken into account too, because they even do not log the STDERR to server log, which is not very nice.<br/> So, to be consistent, wold be good to check exit code for remote command too, print STDERR to the log and store in alerts.</p> <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> <pre> 20689:20161113:162306.866 Conditions match our event. Execute operation. 20689:20161113:162306.866 In execute_commands() 20689:20161113:162306.866 query [txnlev:1] [select distinct h.hostid,h.host,o.type,o.scriptid,o.execute_on,o.port,o.authtype,o.username,o.password,o.publickey,o.privatekey,o.command,h.tls_connect,h.ipmi_authtype,h.ipmi_privilege,h.ipmi_username,h.ipmi_password from opcommand o,opcommand_grp og,hosts_groups hg,hosts h where o.operationid=og.operationid and og.groupid=hg.groupid and hg.hostid=h.hostid and o.operationid=17 and h.status=0 union select distinct h.hostid,h.host,o.type,o.scriptid,o.execute_on,o.port,o.authtype,o.username,o.password,o.publickey,o.privatekey,o.command,h.tls_connect,h.ipmi_authtype,h.ipmi_privilege,h.ipmi_username,h.ipmi_password from opcommand o,opcommand_hst oh,hosts h where o.operationid=oh.operationid and oh.hostid=h.hostid and o.operationid=17 and h.status=0 union select distinct 0,null,o.type,o.scriptid,o.execute_on,o.port,o.authtype,o.username,o.password,o.publickey,o.privatekey,o.command,1,0,2,null,null from opcommand o,opcommand_hst oh where o.operationid=oh.operationid and o.operationid=17 and oh.hostid is null] 20689:20161113:162306.868 In substitute_simple_macros() data:'/etc/zabbix/alertscripts/test.pl' 20689:20161113:162306.868 In zbx_execute_script() 20689:20161113:162306.868 In zbx_popen() command:'/etc/zabbix/alertscripts/test.pl' 20689:20161113:162306.870 End of zbx_popen():9 20827:20161113:162306.870 zbx_popen(): executing script 20689:20161113:162306.878 In zbx_waitpid() 20689:20161113:162306.878 zbx_waitpid() exited, status:255 20689:20161113:162306.878 End of zbx_waitpid():20827 20689:20161113:162306.878 End of zbx_execute_script():SUCCEED 20689:20161113:162306.878 In add_command_alert() 20689:20161113:162306.878 End of add_command_alert() 20689:20161113:162306.878 In DCget_nextid() table:'alerts' num:1 20689:20161113:162306.878 End of DCget_nextid() table:'alerts' [128:128] 20689:20161113:162306.878 query [txnlev:1] [insert into alerts (alertid,actionid,eventid,clock,message,status,error,esc_step,alerttype) values (128,3,1498,1479046986,':/etc/zabbix/alertscripts/test.pl',1,'',1,1);] 20689:20161113:162306.879 End of execute_commands() ... 20689:20161113:162306.879 Conditions match our event. Execute operation. 20689:20161113:162306.879 In execute_commands() 20689:20161113:162306.879 query [txnlev:1] [select distinct h.hostid,h.host,o.type,o.scriptid,o.execute_on,o.port,o.authtype,o.username,o.password,o.publickey,o.privatekey,o.command,h.tls_connect,h.ipmi_authtype,h.ipmi_privilege,h.ipmi_username,h.ipmi_password from opcommand o,opcommand_grp og,hosts_groups hg,hosts h where o.operationid=og.operationid and og.groupid=hg.groupid and hg.hostid=h.hostid and o.operationid=18 and h.status=0 union select distinct h.hostid,h.host,o.type,o.scriptid,o.execute_on,o.port,o.authtype,o.username,o.password,o.publickey,o.privatekey,o.command,h.tls_connect,h.ipmi_authtype,h.ipmi_privilege,h.ipmi_username,h.ipmi_password from opcommand o,opcommand_hst oh,hosts h where o.operationid=oh.operationid and oh.hostid=h.hostid and o.operationid=18 and h.status=0 union select distinct 0,null,o.type,o.scriptid,o.execute_on,o.port,o.authtype,o.username,o.password,o.publickey,o.privatekey,o.command,1,0,2,null,null from opcommand o,opcommand_hst oh where o.operationid=oh.operationid and o.operationid=18 and oh.hostid is null] 20689:20161113:162306.881 In substitute_simple_macros() data:'someeeeee' 20689:20161113:162306.881 In zbx_execute_script() 20689:20161113:162306.882 In zbx_popen() command:'someeeeee' 20689:20161113:162306.883 End of zbx_popen():9 20829:20161113:162306.883 zbx_popen(): executing script 20689:20161113:162306.885 In zbx_waitpid() 20689:20161113:162306.885 zbx_waitpid() exited, status:127 20689:20161113:162306.885 End of zbx_waitpid():20829 20689:20161113:162306.885 End of zbx_execute_script():SUCCEED 20689:20161113:162306.885 In add_command_alert() 20689:20161113:162306.885 End of add_command_alert() 20689:20161113:162306.885 In DCget_nextid() table:'alerts' num:1 20689:20161113:162306.885 End of DCget_nextid() table:'alerts' [129:129] 20689:20161113:162306.885 query [txnlev:1] [insert into alerts (alertid,actionid,eventid,clock,message,status,error,esc_step,alerttype) values (129,3,1498,1479046986,':someeeeee',1,'',1,1);] 20689:20161113:162306.886 End of execute_commands() </pre> </div></div> <p>How does it look like currently in 3.0.5 frontend, falsely saying they were ok:<br/> <span class="image-wrap" style=""><img src="https://support.zabbix.com/secure/attachment/46107/46107_failed-command-and-alert.png" style="border: 0px solid black" /></span></p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=zalex_ua">Oleksii Zagorskyi</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=202488\#worklog-202488 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=202306#comment-202306 Thu, 10 Nov 2016 17:06:47 +0200 Stefan Radman <p>I raised an issue through support and it got assigned.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=stefan.radman">Stefan Radman</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=202306\#worklog-202306 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=202297#comment-202297 Thu, 10 Nov 2016 16:39:49 +0200 Oleksii Zagorskyi <p>The timeout for alerter is hardcoded to 40 seconds (as I recall), so sleeping alert scripts on failure could cause alerter processed to be too busy (I saw that a few times on different installations because of simply slow alert script).<br/> So that workaround is risky.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=zalex_ua">Oleksii Zagorskyi</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=202297\#worklog-202297 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=202296#comment-202296 Thu, 10 Nov 2016 16:37:41 +0200 Stefan Radman <p><img class="emoticon" src="https://support.zabbix.com/images/icons/emoticons/smile.png" height="16" width="16" align="absmiddle" alt="" border="0"/> got your point. We have a support agreement and I might raise it there. Thanks</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=stefan.radman">Stefan Radman</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=202296\#worklog-202296 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=202294#comment-202294 Thu, 10 Nov 2016 16:30:18 +0200 richlv <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=stefan.radman" class="user-hover" rel="stefan.radman">stefan.radman</a>, if you have a support agreement with the zabbix company, you might want to raise this topic through your contact person there.<br/> 14 votes puts this feature request somewhere at place 120 of the highest voted requests <img class="emoticon" src="https://support.zabbix.com/images/icons/emoticons/smile.png" height="16" width="16" align="absmiddle" alt="" border="0"/></p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=richlv">richlv</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=202294\#worklog-202294 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=202290#comment-202290 Thu, 10 Nov 2016 16:14:09 +0200 Raymond Kuiper <p>I would also argue that if a non-zero exit code is received, any stderr script output should be shown as the error message (perhaps truncated) in the frontend.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=qix">Raymond Kuiper</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=202290\#worklog-202290 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=202287#comment-202287 Thu, 10 Nov 2016 16:07:49 +0200 Stefan Radman <p>Can someone update the affected versions, update the priority and get this feature request assigned?<br/> With 14 votes and 3.2.1 out it's about time to get this issue out of the way. Thanks</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=stefan.radman">Stefan Radman</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=202287\#worklog-202287 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=202285#comment-202285 Thu, 10 Nov 2016 16:01:15 +0200 Raymond Kuiper <p>@Timofey, thanks for the 'workaround' btw. Setting 'sleep 120' before every exit at least makes Zabbix see the message as failed.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=qix">Raymond Kuiper</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=202285\#worklog-202285 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=202276#comment-202276 Thu, 10 Nov 2016 15:20:18 +0200 Raymond Kuiper <p>How is this still a problem with modern versions of Zabbix?<br/> It can't be that hard to report error on exit code != 0.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=qix">Raymond Kuiper</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=202276\#worklog-202276 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=196520#comment-196520 Tue, 20 Sep 2016 17:25:01 +0300 Max <p>Hello everybody,</p> <p>I think this issue is very important and concerns not only UserParameters, but all item types (simple checks, external checks, ssh checks, log monitoring, database monitoring etc). However, for SNMP checks it is implemented in BulkSNMP.<br/> There are a lot of workarounds: temp files, per command or value cache etc. But they are all should be done manually and kept in mind by Zabbix users with a restriction of different item update intervals.</p> <p>My suggestion is to split definitions: ITEMS and CHECKS. Items is a monitoring parameter, check is a collection method. Multiple items can be assigned to one check by string id or by order number in the check output with delimiters (depending on the check type).<br/> I think this method is suitable for backward compatibility and less painful upgrade, because in current version there is one check for one item and we can easily convert all templates.<br/> As for LLD checks it can also be done the same way. Every check can return one line (for usual checks) or several lines (for discovery rules and item prototypes). So one check for the whole LLD. For backward compatibility there can be additional check option - format: JSON or raw (with parsing rules).<br/> Check output can be parsed by agent according to check settings and transferred in the "value" JSON sub-structure - no need to change protocol. Only additional check fields (such as multiline indicator, format and parsing rules) can be added to the server request (or response for active checks).<br/> The only pitfall is item keys. They should be assigned to checks (not items), but what to do with trigger expressions... I see two ways:<br/> 1) during upgrade convert item keys to item names in trigger expressions and refuse item keys at all,<br/> 2) copy items keys to checks keys and make item keys to be in free format and used only in triggers.</p> <p>In conclusion.<br/> IMHO this architectural improvement must be done ASAP, because as later as more difficult.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=grechnev">Max</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=196520\#worklog-196520 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=192521#comment-192521 Tue, 16 Aug 2016 22:08:22 +0300 Timofey <p>Hi guys, i find workaround (bad but works)<br/> Make sleep 3600 on error, so you will see timeouts on dashboard &amp; etc</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=nefelim4ag">Timofey</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=192521\#worklog-192521 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=160215#comment-160215 Thu, 19 Nov 2015 17:42:28 +0200 Marc <p>Similar idea but makes use of memcached:<br/> <a href="https://github.com/crackmonkey/zbxcache" class="external-link" target="_blank" rel="nofollow noopener">https://github.com/crackmonkey/zbxcache</a></p> <p>Edit:<br/> Yet another example but makes use of a cache file:<br/> <a href="https://bitbucket.org/sivann/runcached/" class="external-link" target="_blank" rel="nofollow noopener">https://bitbucket.org/sivann/runcached/</a></p> <p>Special thanks to <a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=steki" class="user-hover" rel="steki">steki</a> for dropping a comment that made me find that <img class="emoticon" src="https://support.zabbix.com/images/icons/emoticons/smile.png" height="16" width="16" align="absmiddle" alt="" border="0"/></p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=okkuv9xh">Marc</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=okkuv9xh">Marc</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=160215\#worklog-160215 RE: [ZBX-9701] Special character $ doesn't pass in external check parameter https://support.zabbix.com/browse/ZBX-9701?focusedId=157334#comment-157334 Mon, 19 Oct 2015 12:53:35 +0300 Tom M. <p>The same issue is present in the 2.2 release (as seen on zabbix-server-2.2.10-1.el6.x86_64).</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=mato">Tom M.</a> (<a href="https://support.zabbix.com/browse/ZBX-9701">ZBX-9701</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-9701?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=157334\#worklog-157334 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=156618#comment-156618 Sat, 10 Oct 2015 18:43:57 +0300 Marc <p>Well, I've got several scenarios for a possible implementation in mind.</p> <p>This is the one I currently favor for <em>Bulk user parameter</em> :</p> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> <pre class="code-java"> --- SNIP zabbix_agentd.conf --- # BulkUserParameter=&lt;key&gt;,&lt;interval&gt;,&lt;command&gt; BulkUserParameter=openvz.ubc,1,sudo tac /proc/user_beancounters | awk ... --- SNAP zabbix_agentd.conf --- </pre> </div></div> <p>Configuration of <tt>BulkUserParameter</tt> is considered on Zabbix agent (re)start only. The configured <tt>&lt;key&gt;</tt> becomes a supported item key.<br/> The Zabbix agent's collector process executes the deposited <tt>&lt;command&gt;</tt> every <tt>&lt;interval&gt;</tt> minutes, parses its output and updates the corresponding cache entries.<br/> The <tt>&lt;command&gt;</tt> its output could look like this:</p> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> <pre class="code-java"> [kmemsize,failcnt] 0 [kmemsize,limit] 1217787766 [kmemsize,barrier] 1217604266 --- SNIP --- SNAP --- SNIP --- SNAP --- </pre> </div></div> <p>The corresponding cache representation could then look like this:</p> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> <pre class="code-java"> openvz.ubc[kmemsize,failcnt] 0 openvz.ubc[kmemsize,limit] 1217787766 openvz.ubc[kmemsize,barrier] 1217604266 --- SNIP --- SNAP --- SNIP --- SNAP --- </pre> </div></div> <p>When the Zabbix agent gets a request for the item key <tt>openvz.ubc[kmemsize,limit]</tt>, then it knows that <tt>openvz.ubc[*]</tt> is a <em>Bulk user parameter</em>, searches in the <em>Bulk Parameter Cache</em> for the related cache entry and returns the corresponding value. In this case 1217787766.</p> <p>By this the actual custom command (<em>Bulk User parameter</em>) gets automatically executed once per minute and keeps current values for 100 different Items in memory (in this example).</p> <p>Which item values finally get send/returned to the Zabbix server/proxy in which interval, is decided on Zabbix frontend, resp. by Zabbix server in dependency which items had been created. Another benefit is that one can decide/change on Zabbix frontend the interval for each such item.</p> <p>The latter is by the way one of the reasons why I don't like to use zabbix_sender instead. When bulk sending item values by Zabbix sender, then all metrics get send to Zabbix server/proxy, regardless if they are configured or not. Further the update intervals are not individually changeable in Zabbix frontend but are the same to all items.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=okkuv9xh">Marc</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=156618\#worklog-156618 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=156614#comment-156614 Sat, 10 Oct 2015 16:53:53 +0300 Strahinja Kustudic <p>I'm not sure I exactly understand how you suggestion works, but let me try to understand it. You would basically create an item in the UI which will call the <tt>openvz.ubc</tt> BulkUserParameter and that item will update the cache for all those items on the agent. Then you would create items in the UI which will have item keys like those which the BulkUserParameter updates in the agent cache, so if the server requests values for those items, the agent would send the data from the cache, without running any queries.</p> <p>If that is the case, you are right, nothing would need to be changed the UI, but it would still be a little complicated to answer how are those items being updated, unless you know how the script works. Also what will the <tt>openvz.ubc</tt> item return to the server, since it has to return something, it cannot only update cache by echo-ing items/values?</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=kustodian">Strahinja Kustudic</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=156614\#worklog-156614 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=156609#comment-156609 Sat, 10 Oct 2015 11:37:18 +0300 Marc <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=kustodian" class="user-hover" rel="kustodian">kustodian</a>,</p> <p>it may appear similar but it's different. This request is neither about providing additional context information alongside an item's value (status, criticity, etc.) nor is it about returning separate values or key=value for a single item. A Zabbix item is atomic and that's a very good design decision in my opinion - performance wise and in terms of processability too.</p> <p>The motivation of this request is to significant improve performance and efficiency in cases where lots of valuable information can be provided by a single custom call.</p> <p>From my experience when extending Zabbix one has rarely complete distinct custom items. In Most cases one accesses a single interface that provides plenty of valuable information one likely wants to obtain by dedicated items:</p> <p>Database metrics -&gt; pgsql, sqlite3, db_stat, sqlplus, mysql,...<br/> Hardware controller metrics -&gt; MegaCli64, ...<br/> BIND name server -&gt; rndc<br/> NTP time server -&gt; ntpq<br/> Device mapper -&gt; multipath, multipathd<br/> ...</p> <p>To name only some of them.</p> <p>All of these commands may provide lots of information for separate Zabbix items in one run. Instead of calling them again and again for each custom item, this ticket requests a way to call them only once and provide their output in a cache for potential Item calls in the future. In fact the proper formatted output gets parsed to fill the cache.<br/> These item calls based on dynamic supported item keys (keys from BulkParameterCache) do not need to issue any fork or command, access a file or do any other kind of processing.<br/> They just have to "echo" what is currently in memory for a specific key.</p> <p>Because this request does not affect any design principle of Zabbix, there is also no need to touch the Web frontend nor the way things get handled. It's a change at the very beginning of the process chain.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=okkuv9xh">Marc</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=156609\#worklog-156609 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=156608#comment-156608 Sat, 10 Oct 2015 01:55:03 +0300 Strahinja Kustudic <p>This is similar to what I suggested in <a href="https://support.zabbix.com/browse/ZBXNEXT-103?focusedCommentId=87061&amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-87061" class="external-link" rel="nofollow">this comment</a> in issue <a href="https://support.zabbix.com/browse/ZBXNEXT-103" title="Allow multiple return values from a UserParameter" class="issue-link" data-issue-key="ZBXNEXT-103"><del>ZBXNEXT-103</del></a>, but you forgot to how will these items be defined in the Web UI?</p> <p>I thought about it from the last time I replied to the issue above and here is an idea how I would implement this. I wouldn't even create a special <tt>zabbix_agent.conf</tt> parameter like <tt>BulkUserParameter</tt>, but just use the existing one <tt>UserParameter</tt> and only add a new type of item in the UI called <tt>Zabbix Agent Bulk</tt>. This item type would define the user parameter which will be called on the agent to return multiple items. This item type would have everything as regular items, but in it you would need to define item keys which will be returned. The only thing I'm not sure is if this bulk item should also return a value for itself, if it fails to execute, or something.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=kustodian">Strahinja Kustudic</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=156608\#worklog-156608 RE: [ZBXNEXT-3006] A cache to provide multiple metrics of a single custom function https://support.zabbix.com/browse/ZBXNEXT-3006?focusedId=156596#comment-156596 Fri, 9 Oct 2015 22:51:54 +0300 Marc <p>Because the item key <tt>openvz.ubc</tt> is already provided by the <tt>BulkUserParameter</tt> definition, there is of course no need to include the item key part in the <em>Bulk User parameter's</em> output:</p> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> <pre class="code-java"> # sudo tac /proc/user_beancounters | awk <span class="code-quote">'$1==<span class="code-quote">"uid"</span>{<span class="code-keyword">for</span>(i=4;i&gt;=0;i--)h[i]=$(7-i);next}$6~/./{r=$(NF-5);<span class="code-keyword">for</span>(i=0;i&lt;5;i++)printf(<span class="code-quote">"[%s,%s] %d\n"</span>,r,h[i],$(NF-i))}'</span> [kmemsize,failcnt] 0 [kmemsize,limit] 1217787766 [kmemsize,barrier] 1217604266 --- SNIP --- SNAP --- SNIP --- SNAP --- </pre> </div></div> <p>On the other hand could it be desired to provide different item keys by one <em>Bulk parameter</em>. So it could also be kept in the output but left out int the definition:</p> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> <pre class="code-java"> BulkUserParameter=1,sudo tac /proc/user_beancounters | awk ... </pre> </div></div> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=okkuv9xh">Marc</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-3006">ZBXNEXT-3006</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-3006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=156596\#worklog-156596 RE: [ZBX-9701] Special character $ doesn't pass in external check parameter https://support.zabbix.com/browse/ZBX-9701?focusedId=148510#comment-148510 Thu, 16 Jul 2015 11:36:52 +0300 Aleksandrs Saveljevs <p>Just a note that the patch above does solve the reporter's case, but will generally make things much worse: external items with parameters containing double quotes, backslashes and especially single quotes will no longer work.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=asaveljevs">Aleksandrs Saveljevs</a> (<a href="https://support.zabbix.com/browse/ZBX-9701">ZBX-9701</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-9701?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=148510\#worklog-148510 RE: [ZBX-9701] Special character $ doesn't pass in external check parameter https://support.zabbix.com/browse/ZBX-9701?focusedId=148446#comment-148446 Wed, 15 Jul 2015 15:54:06 +0300 Dmitry Gorobets <p>Bug can be fixed by editing line 88 at src/zabbix_server/poller/checks_external.c</p> <div class="code panel" style="border-style: solid;border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>checks_external.c</b></div><div class="codeContent panelContent"> <pre class="code-java"> zbx_snprintf_alloc(&amp;cmd, &amp;cmd_alloc, &amp;cmd_offset, <span class="code-quote">" \"</span>%s\"", param_esc); </pre> </div></div> <p>to</p> <div class="code panel" style="border-style: solid;border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>checks_external.c</b></div><div class="codeContent panelContent"> <pre class="code-java"> zbx_snprintf_alloc(&amp;cmd, &amp;cmd_alloc, &amp;cmd_offset, <span class="code-quote">" <span class="code-quote">'%s'</span>"</span>, param_esc); </pre> </div></div> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=dgorobets">Dmitry Gorobets</a> (<a href="https://support.zabbix.com/browse/ZBX-9701">ZBX-9701</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-9701?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=148446\#worklog-148446 RE: [ZBX-9701] Special character $ doesn't pass in external check parameter https://support.zabbix.com/browse/ZBX-9701?focusedId=148276#comment-148276 Mon, 13 Jul 2015 16:53:12 +0300 Dmitry Gorobets <p>Zabbix version 2.4.1 (revision 49643)</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=dgorobets">Dmitry Gorobets</a> (<a href="https://support.zabbix.com/browse/ZBX-9701">ZBX-9701</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-9701?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=148276\#worklog-148276 RE: [ZBX-9701] Special character $ doesn't pass in external check parameter https://support.zabbix.com/browse/ZBX-9701?focusedId=148275#comment-148275 Mon, 13 Jul 2015 16:41:57 +0300 Aleksandrs Saveljevs <p>Above I meant that the server should single-quote the arguments instead of double-quoting them at src/zabbix_server/poller/checks_external.c, function get_value_external(). In other words, you are correct that there is a bug in Zabbix.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=asaveljevs">Aleksandrs Saveljevs</a> (<a href="https://support.zabbix.com/browse/ZBX-9701">ZBX-9701</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-9701?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=148275\#worklog-148275 RE: [ZBX-9701] Special character $ doesn't pass in external check parameter https://support.zabbix.com/browse/ZBX-9701?focusedId=148273#comment-148273 Mon, 13 Jul 2015 16:38:10 +0300 Dmitry Gorobets <p>I tried to solve problem with single quotes, but it didn't help.<br/> Example: quartz_scheduler_check1.py<span class="error">&#91;&#39;-n&#39;,&#39;cluster-app1&#39;,&#39;-j&#39;,&#39;ReceiveMailTask$4&#39;,&#39;-t&#39;,&#39;c2c23f92-e4a5-4ed4-8dce-8fb1b55e198b&#39;&#93;</span><br/> Result: '-n' 'cluster-app1' '-j' 'ReceiveMailTask' '-t' 'c2c23f92-e4a5-4ed4-8dce-8fb1b55e1</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=dgorobets">Dmitry Gorobets</a> (<a href="https://support.zabbix.com/browse/ZBX-9701">ZBX-9701</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-9701?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=148273\#worklog-148273 RE: [ZBX-9701] Special character $ doesn't pass in external check parameter https://support.zabbix.com/browse/ZBX-9701?focusedId=148271#comment-148271 Mon, 13 Jul 2015 16:18:37 +0300 Aleksandrs Saveljevs <p>The "$" character is passed, but external checks are executed through the shell and so "$" is treated as the beginning of a shell variable.</p> <p>It should probably be solved in a way similar to <a href="https://support.zabbix.com/browse/ZBX-4529" title="Some shell metachars not escaped when call alert script" class="issue-link" data-issue-key="ZBX-4529"><del>ZBX-4529</del></a> by single-quoting the arguments.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=asaveljevs">Aleksandrs Saveljevs</a> (<a href="https://support.zabbix.com/browse/ZBX-9701">ZBX-9701</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-9701?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=148271\#worklog-148271 RE: [ZBX-6894] Server/Proxy behavior for stucked external checks https://support.zabbix.com/browse/ZBX-6894?focusedId=141655#comment-141655 Tue, 19 May 2015 09:04:48 +0300 Martins Valkovskis <p>Added to documentation at <a href="https://www.zabbix.com/documentation/2.0/manual/config/items/itemtypes/external" class="external-link" target="_blank" rel="nofollow noopener">https://www.zabbix.com/documentation/2.0/manual/config/items/itemtypes/external</a> (also other versions):</p> <p>"In case of a timeout, the item will be marked as unsupported, an according error message will be displayed and the forked process for the script will be killed."</p> <p>RESOLVED.</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=sasha" class="user-hover" rel="sasha">sasha</a> CLOSED</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=martins-v">Martins Valkovskis</a> (<a href="https://support.zabbix.com/browse/ZBX-6894">ZBX-6894</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=sasha">Alexander Vladishev</a></td> </tr> </table> https://support.zabbix.com/browse/ZBX-6894?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=141655\#worklog-141655 RE: [ZBX-9433] Proxy - External checks documentation clarification https://support.zabbix.com/browse/ZBX-9433?focusedId=141030#comment-141030 Thu, 23 Apr 2015 14:49:12 +0300 Martins Valkovskis <p>Explained in more detail now: <a href="https://www.zabbix.com/documentation/2.2/manual/config/items/itemtypes/external" class="external-link" target="_blank" rel="nofollow noopener">https://www.zabbix.com/documentation/2.2/manual/config/items/itemtypes/external</a></p> <p>RESOLVED.</p> <p><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=sasha" class="user-hover" rel="sasha">sasha</a> CLOSED</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=martins-v">Martins Valkovskis</a> (<a href="https://support.zabbix.com/browse/ZBX-9433">ZBX-9433</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=sasha">Alexander Vladishev</a></td> </tr> </table> https://support.zabbix.com/browse/ZBX-9433?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=141030\#worklog-141030 RE: [ZBXNEXT-540] ZBX_NOTSUPPORTED from external scripts https://support.zabbix.com/browse/ZBXNEXT-540?focusedId=138734#comment-138734 Fri, 13 Mar 2015 15:41:45 +0200 Filipp Sudanov <p>Similar for user parameters: <a href="https://support.zabbix.com/browse/ZBXNEXT-152" title="UserParameter to support a return value which indicates temporary error" class="issue-link" data-issue-key="ZBXNEXT-152">ZBXNEXT-152</a></p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=filipp.sudanov">Filipp Sudanov</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-540">ZBXNEXT-540</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-540?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=138734\#worklog-138734 RE: [ZBXNEXT-1897] Return unknown (unsupported) value by external checker using non-zero exit code https://support.zabbix.com/browse/ZBXNEXT-1897?focusedId=138733#comment-138733 Fri, 13 Mar 2015 15:35:48 +0200 richlv <p>closing as a duplicate of <a href="https://support.zabbix.com/browse/ZBXNEXT-540" title="ZBX_NOTSUPPORTED from external scripts" class="issue-link" data-issue-key="ZBXNEXT-540">ZBXNEXT-540</a></p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=richlv">richlv</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1897">ZBXNEXT-1897</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1897?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=138733\#worklog-138733 RE: [ZBXNEXT-2110] Empty string is valid return value https://support.zabbix.com/browse/ZBXNEXT-2110?focusedId=138732#comment-138732 Fri, 13 Mar 2015 15:35:42 +0200 richlv <p>closing as a duplicate of <a href="https://support.zabbix.com/browse/ZBXNEXT-540" title="ZBX_NOTSUPPORTED from external scripts" class="issue-link" data-issue-key="ZBXNEXT-540">ZBXNEXT-540</a></p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=richlv">richlv</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-2110">ZBXNEXT-2110</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-2110?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=138732\#worklog-138732 RE: [ZBXNEXT-540] ZBX_NOTSUPPORTED from external scripts https://support.zabbix.com/browse/ZBXNEXT-540?focusedId=138731#comment-138731 Fri, 13 Mar 2015 15:35:28 +0200 richlv <p>a patch suggestion at <a href="https://support.zabbix.com/browse/ZBXNEXT-2110" title="Empty string is valid return value" class="issue-link" data-issue-key="ZBXNEXT-2110"><del>ZBXNEXT-2110</del></a></p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=richlv">richlv</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-540">ZBXNEXT-540</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-540?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=138731\#worklog-138731 RE: [ZBX-9095] Ruby script sometimes fails as External check https://support.zabbix.com/browse/ZBX-9095?focusedId=131773#comment-131773 Sat, 20 Dec 2014 01:32:43 +0200 Alexander Vladishev <p>I close the issue.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=sasha">Alexander Vladishev</a> (<a href="https://support.zabbix.com/browse/ZBX-9095">ZBX-9095</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-9095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=131773\#worklog-131773 RE: [ZBX-9095] Ruby script sometimes fails as External check https://support.zabbix.com/browse/ZBX-9095?focusedId=131377#comment-131377 Tue, 16 Dec 2014 08:51:37 +0200 Igors Homjakovs <p>At startup Zabbix server closes STDIN and then redirects it to /dev/null:</p> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> <pre class="code-java"> <span class="code-keyword">const</span> <span class="code-object">char</span> default_file[] = <span class="code-quote">"/dev/<span class="code-keyword">null</span>"</span>; close(STDIN_FILENO); open(default_file, O_RDONLY); <span class="code-comment">/* stdin, normally fd==0 */</span> </pre> </div></div> <p>The file descriptor you are mentioning (FD = 0), is closed by "close(fd<span class="error">&#91;0&#93;</span>);" when external script is being executed. However, this descriptor is the read end of a pipe and it is not related to STDIN. Therefore, it this situation there is no fault with Zabbix.</p> <p>In <a href="https://redmine.ruby-lang.org/issues/5723" class="external-link" target="_blank" rel="nofollow noopener">https://redmine.ruby-lang.org/issues/5723</a> it is mentioned that this is a known Ruby issue for which the work-around has been added in the new Ruby version.<br/> The problem will disappear after upgrade.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=igorsh">Igors Homjakovs</a> (<a href="https://support.zabbix.com/browse/ZBX-9095">ZBX-9095</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-9095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=131377\#worklog-131377 RE: [ZBXNEXT-2110] Empty string is valid return value https://support.zabbix.com/browse/ZBXNEXT-2110?focusedId=129057#comment-129057 Fri, 21 Nov 2014 09:45:54 +0200 Rob Northen <p>Ok, here goes feature request.</p> <p>Please add "./configure" option or "zabbix_server.conf" configuration variable to Zabbix which will define interpretation of empty strings as return values.<br/> This feature is intended for items where "Type of information" is set to "Character".<br/> In my Zabbix setup empty strings should be treated as "invalid value" but I guess other users need opposite behaviour.<br/> I think setting it per item definition is overkill for now.</p> <p>Thank You</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=robnorthen">Rob Northen</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-2110">ZBXNEXT-2110</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-2110?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=129057\#worklog-129057 RE: [ZBXNEXT-2098] Creation of loadable modules using script languages/subagent mechanism https://support.zabbix.com/browse/ZBXNEXT-2098?focusedId=114850#comment-114850 Mon, 30 Jun 2014 11:37:38 +0300 richlv <p>not quite that, but ruby support implemented as a loadable module : <a href="https://github.com/BlueSkyDetector/mruby_module_for_zabbix_agent" class="external-link" target="_blank" rel="nofollow noopener">https://github.com/BlueSkyDetector/mruby_module_for_zabbix_agent</a></p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=richlv">richlv</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-2098">ZBXNEXT-2098</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-2098?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=114850\#worklog-114850 RE: [ZBXNEXT-1897] Return unknown (unsupported) value by external checker using non-zero exit code https://support.zabbix.com/browse/ZBXNEXT-1897?focusedId=106843#comment-106843 Sat, 12 Apr 2014 21:43:03 +0300 richlv <p><a href="https://support.zabbix.com/browse/ZBXNEXT-2203" title="Zabbix should provide detailed information why item is not supported by the agent" class="issue-link" data-issue-key="ZBXNEXT-2203"><del>ZBXNEXT-2203</del></a> might allow to provide custom error message</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=richlv">richlv</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1897">ZBXNEXT-1897</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1897?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=106843\#worklog-106843 RE: [ZBXNEXT-2178] Add the ability to use {host:key.func()} on External Checks https://support.zabbix.com/browse/ZBXNEXT-2178?focusedId=104028#comment-104028 Sun, 16 Mar 2014 08:28:46 +0200 richlv <p>closing as a duplicate of <a href="https://support.zabbix.com/browse/ZBXNEXT-1443" title="Ability to transform item values before they are processed and stored to DB" class="issue-link" data-issue-key="ZBXNEXT-1443"><del>ZBXNEXT-1443</del></a> then</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=richlv">richlv</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-2178">ZBXNEXT-2178</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-2178?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=104028\#worklog-104028 RE: [ZBXNEXT-540] ZBX_NOTSUPPORTED from external scripts https://support.zabbix.com/browse/ZBXNEXT-540?focusedId=103877#comment-103877 Thu, 13 Mar 2014 23:20:00 +0200 richlv <p>for the record, external checks and userparams now may return empty values so this workaround probably will not help anymore</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=richlv">richlv</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-540">ZBXNEXT-540</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-540?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=103877\#worklog-103877 RE: [ZBXNEXT-2178] Add the ability to use {host:key.func()} on External Checks https://support.zabbix.com/browse/ZBXNEXT-2178?focusedId=102746#comment-102746 Wed, 5 Mar 2014 15:30:51 +0200 Andres Abelardo Villarroel Acosta <p>Yes! Ultimately one can accomplish the same task with <a href="https://support.zabbix.com/browse/ZBXNEXT-1443" title="Ability to transform item values before they are processed and stored to DB" class="issue-link" data-issue-key="ZBXNEXT-1443"><del>ZBXNEXT-1443</del></a> and it seems a more robust approach, I don't have the knowledge on how macros become available on different locations, but this <b>seems</b> a simpler development for this particular case.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=andresvia">Andres Abelardo Villarroel Acosta</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-2178">ZBXNEXT-2178</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-2178?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=102746\#worklog-102746 RE: [ZBXNEXT-2178] Add the ability to use {host:key.func()} on External Checks https://support.zabbix.com/browse/ZBXNEXT-2178?focusedId=102714#comment-102714 Wed, 5 Mar 2014 11:54:49 +0200 Oleksii Zagorskyi <p>Somehow similar to <a href="https://support.zabbix.com/browse/ZBXNEXT-1443" title="Ability to transform item values before they are processed and stored to DB" class="issue-link" data-issue-key="ZBXNEXT-1443"><del>ZBXNEXT-1443</del></a> or even duplicates it.</p> <p>Do you agree ?</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=zalex_ua">Oleksii Zagorskyi</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-2178">ZBXNEXT-2178</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=zalex_ua">Oleksii Zagorskyi</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-2178?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=102714\#worklog-102714 RE: [ZBXNEXT-2110] Empty string is valid return value https://support.zabbix.com/browse/ZBXNEXT-2110?focusedId=97942#comment-97942 Thu, 16 Jan 2014 08:41:20 +0200 Rob Northen <p>Hi Oleksiy,</p> <p>Thank You for commit location.</p> <p>If anyone is interested I've made simple patch for v2.0.9.</p> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> <pre class="code-java"> --- src/zabbix_server/poller/checks_external.c 2013-10-08 13:27:46.000000000 +0200 +++ src/zabbix_server/poller/checks_external.c 2014-01-15 08:16:45.978693607 +0100 @@ -94,7 +94,7 @@ <span class="code-object">int</span> get_value_external(DC_ITEM *item, AG { zbx_rtrim(buf, ZBX_WHITESPACE); - <span class="code-keyword">if</span> (SUCCEED == set_result_type(result, item-&gt;value_type, item-&gt;data_type, buf)) + <span class="code-keyword">if</span> ((SUCCEED == set_result_type(result, item-&gt;value_type, item-&gt;data_type, buf)) &amp;&amp; (<span class="code-quote">'\0'</span> != *buf)) ret = SUCCEED; zbx_free(buf); </pre> </div></div> <p>It will bring Zabbix 1.8 behaviour back. External scripts won't accept empty strings as return value any more.<br/> It is not intended for main code inclusion.</p> <p>Regards,<br/> Rob</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=robnorthen">Rob Northen</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-2110">ZBXNEXT-2110</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=robnorthen">Rob Northen</a></td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-2110?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=97942\#worklog-97942 RE: [ZBXNEXT-2110] Empty string is valid return value https://support.zabbix.com/browse/ZBXNEXT-2110?focusedId=97776#comment-97776 Tue, 14 Jan 2014 16:41:21 +0200 Oleksii Zagorskyi <p>Hmm, it doesn't look like a feature request.<br/> See <a href="https://www.zabbix.org/wiki/Docs/bug_reporting_guidelines" class="external-link" target="_blank" rel="nofollow noopener">https://www.zabbix.org/wiki/Docs/bug_reporting_guidelines</a></p> <p>You can see changes when they were merged to trunk branch <a href="https://www.zabbix.org/websvn/wsvn/zabbix.com?op=comp&amp;compare[]=%2F@19733&amp;compare[]=%2F@19734" class="external-link" target="_blank" rel="nofollow noopener">https://www.zabbix.org/websvn/wsvn/zabbix.com?op=comp&amp;compare[]=%2F@19733&amp;compare[]=%2F@19734</a></p> <p>CLOSED.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=zalex_ua">Oleksii Zagorskyi</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-2110">ZBXNEXT-2110</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-2110?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=97776\#worklog-97776 RE: [ZBXNEXT-1897] Return unknown (unsupported) value by external checker using non-zero exit code https://support.zabbix.com/browse/ZBXNEXT-1897?focusedId=87802#comment-87802 Tue, 10 Sep 2013 08:59:05 +0300 richlv <p>similar to <a href="https://support.zabbix.com/browse/ZBXNEXT-152" title="UserParameter to support a return value which indicates temporary error" class="issue-link" data-issue-key="ZBXNEXT-152">ZBXNEXT-152</a></p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=richlv">richlv</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1897">ZBXNEXT-1897</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1897?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=87802\#worklog-87802 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=87796#comment-87796 Tue, 10 Sep 2013 07:55:21 +0300 Marc <p>similar to <a href="https://support.zabbix.com/browse/ZBX-6971" title="Exit code of alert script ignored" class="issue-link" data-issue-key="ZBX-6971"><del>ZBX-6971</del></a></p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=okkuv9xh">Marc</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=87796\#worklog-87796 RE: [ZBXNEXT-1676] increasing "busy zabbix poller processes" because it uses a lot of external check https://support.zabbix.com/browse/ZBXNEXT-1676?focusedId=77558#comment-77558 Thu, 21 Mar 2013 11:23:33 +0200 richlv <p>please use zabbix forums, irc and other channels for community support.<br/> see <a href="https://www.zabbix.org/wiki/Getting_help" class="external-link" target="_blank" rel="nofollow noopener">https://www.zabbix.org/wiki/Getting_help</a> for more information</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=richlv">richlv</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1676">ZBXNEXT-1676</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1676?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=77558\#worklog-77558 RE: [ZBX-5464] zabbix can't get 0 from external script https://support.zabbix.com/browse/ZBX-5464?focusedId=75466#comment-75466 Thu, 14 Feb 2013 09:20:21 +0200 Andris Zeila <p>Great. Then I'm closing this one.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper">Andris Zeila</a> (<a href="https://support.zabbix.com/browse/ZBX-5464">ZBX-5464</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-5464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=75466\#worklog-75466 RE: [ZBX-5464] zabbix can't get 0 from external script https://support.zabbix.com/browse/ZBX-5464?focusedId=75465#comment-75465 Thu, 14 Feb 2013 06:59:22 +0200 sles <p>Hello!</p> <p>I added tail -n 1 to script, now I can't reproduce problem.<br/> Thank you!</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=sles">sles</a> (<a href="https://support.zabbix.com/browse/ZBX-5464">ZBX-5464</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-5464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=75465\#worklog-75465 RE: [ZBX-5464] zabbix can't get 0 from external script https://support.zabbix.com/browse/ZBX-5464?focusedId=75342#comment-75342 Tue, 12 Feb 2013 10:15:04 +0200 richlv <p>should parser strip leading whitespace, too ?</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=richlv">richlv</a> (<a href="https://support.zabbix.com/browse/ZBX-5464">ZBX-5464</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-5464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=75342\#worklog-75342 RE: [ZBX-5464] zabbix can't get 0 from external script https://support.zabbix.com/browse/ZBX-5464?focusedId=75338#comment-75338 Tue, 12 Feb 2013 09:45:15 +0200 Andris Zeila <p>There is a potential problem if fping produces multiple lines of output (although I can't imagine how that could happen with this example, but maybe occasionally there could be some error or whatever message). In that case if the first line contains less than 5 fields, then the script would give output;<br/> &lt;empty line&gt;<br/> 0.0</p> <p>Parser would fail because of the first empty line, but logger would strip the empty lines from message. This would lead to failed items with visually correct values in log files.</p> <p>So the suggestion would be to ensure that your script produces only single line of output (with head or tail for example).</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper">Andris Zeila</a> (<a href="https://support.zabbix.com/browse/ZBX-5464">ZBX-5464</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper">Andris Zeila</a></td> </tr> </table> https://support.zabbix.com/browse/ZBX-5464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=75338\#worklog-75338 RE: [ZBX-5464] zabbix can't get 0 from external script https://support.zabbix.com/browse/ZBX-5464?focusedId=75337#comment-75337 Tue, 12 Feb 2013 07:38:47 +0200 sles <p>I changed script to just<br/> echo 0.0</p> <p>and there is no such problem ( at least I can't reproduce it), I guess script returns non-digit values in some situations and zabbix info about 0.0 in log is wrong, i.e. real bug is what zabbix writes to log <img class="emoticon" src="https://support.zabbix.com/images/icons/emoticons/smile.png" height="16" width="16" align="absmiddle" alt="" border="0"/></p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=sles">sles</a> (<a href="https://support.zabbix.com/browse/ZBX-5464">ZBX-5464</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-5464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=75337\#worklog-75337 RE: [ZBX-5464] zabbix can't get 0 from external script https://support.zabbix.com/browse/ZBX-5464?focusedId=75196#comment-75196 Fri, 8 Feb 2013 14:25:45 +0200 Andris Zeila <p>Yes, strange. LF/CR characters at the end should have been stripped by server. </p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper">Andris Zeila</a> (<a href="https://support.zabbix.com/browse/ZBX-5464">ZBX-5464</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-5464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=75196\#worklog-75196 RE: [ZBX-5464] zabbix can't get 0 from external script https://support.zabbix.com/browse/ZBX-5464?focusedId=75193#comment-75193 Fri, 8 Feb 2013 14:08:04 +0200 sles <p>well, you are right, there is additional symbol at the end.<br/> this is strange, I'll check what happens at Monday <img class="emoticon" src="https://support.zabbix.com/images/icons/emoticons/smile.png" height="16" width="16" align="absmiddle" alt="" border="0"/></p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=sles">sles</a> (<a href="https://support.zabbix.com/browse/ZBX-5464">ZBX-5464</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-5464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=75193\#worklog-75193 RE: [ZBX-5464] zabbix can't get 0 from external script https://support.zabbix.com/browse/ZBX-5464?focusedId=75190#comment-75190 Fri, 8 Feb 2013 13:47:41 +0200 sles <p>Really it looks like:</p> <p> Received value <span class="error">&#91;0.0&#93;</span> is not suitable</p> <p>so no line feed or carriage return here <img class="emoticon" src="https://support.zabbix.com/images/icons/emoticons/smile.png" height="16" width="16" align="absmiddle" alt="" border="0"/></p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=sles">sles</a> (<a href="https://support.zabbix.com/browse/ZBX-5464">ZBX-5464</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-5464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=75190\#worklog-75190 RE: [ZBX-5464] zabbix can't get 0 from external script https://support.zabbix.com/browse/ZBX-5464?focusedId=75006#comment-75006 Wed, 6 Feb 2013 09:24:35 +0200 Andris Zeila <p>One question - is there really line feed character in the logs, or it was just inserted during copying this line?</p> <p>And another thing - could you pleas instead of copying pingloss.sh script output redirect to file and attach it here?</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper">Andris Zeila</a> (<a href="https://support.zabbix.com/browse/ZBX-5464">ZBX-5464</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper">Andris Zeila</a></td> </tr> </table> https://support.zabbix.com/browse/ZBX-5464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=75006\#worklog-75006 RE: [ZBX-5464] zabbix can't get 0 from external script https://support.zabbix.com/browse/ZBX-5464?focusedId=74996#comment-74996 Wed, 6 Feb 2013 06:41:44 +0200 sles <p>checked logs-<br/> still have the same problem with 2.0.5rc1:</p> <p> 705:20130206:061256.677 item [Lud-cr2801-1:pingloss.sh[-c 20, -q, -B1, -r1, -b1500, </p> {HOST.CONN} <p>]] became not supported: Received value [0.0<br/> ] is not suitable for value type <span class="error">&#91;Numeric (float)&#93;</span></p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=sles">sles</a> (<a href="https://support.zabbix.com/browse/ZBX-5464">ZBX-5464</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-5464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=74996\#worklog-74996 RE: [ZBX-5464] zabbix can't get 0 from external script https://support.zabbix.com/browse/ZBX-5464?focusedId=74968#comment-74968 Tue, 5 Feb 2013 15:42:27 +0200 Andris Zeila <p>For me the following script works fine:</p> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> <pre class="code-java"> #!/bin/sh fping -c 1 -q -B1 -r1 -b1500 $@ 2&gt;&amp;1 | awk <span class="code-quote">'{ print $5 }'</span> | awk -F <span class="code-quote">"/"</span> <span class="code-quote">'{ print $3 }'</span> | awk -F <span class="code-quote">"%"</span> <span class="code-quote">'{print $1}'</span> </pre> </div></div> <p>It returns 0 which is read by server without problems. I checked the code - the decimal mark is not required for floating values.<br/> Theoretically the reported problem could be a result of the script output containing unprintable characters, but I don't see how that could happen.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper">Andris Zeila</a> (<a href="https://support.zabbix.com/browse/ZBX-5464">ZBX-5464</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=wiper">Andris Zeila</a></td> </tr> </table> https://support.zabbix.com/browse/ZBX-5464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=74968\#worklog-74968 RE: [ZBX-5697] Can not use end square bracket in external check params https://support.zabbix.com/browse/ZBX-5697?focusedId=68243#comment-68243 Fri, 19 Oct 2012 17:07:00 +0300 Alexander Vladishev <p>Fixed in version pre-1.8.16 r30986.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=sasha">Alexander Vladishev</a> (<a href="https://support.zabbix.com/browse/ZBX-5697">ZBX-5697</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-5697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=68243\#worklog-68243 RE: [ZBX-5697] Can not use end square bracket in external check params https://support.zabbix.com/browse/ZBX-5697?focusedId=68239#comment-68239 Fri, 19 Oct 2012 16:50:31 +0300 Andris Mednis <p>Successfully tested.</p> <p>Please review comment improvements in r30976.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=andris">Andris Mednis</a> (<a href="https://support.zabbix.com/browse/ZBX-5697">ZBX-5697</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-5697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=68239\#worklog-68239 RE: [ZBX-5697] Can not use end square bracket in external check params https://support.zabbix.com/browse/ZBX-5697?focusedId=68133#comment-68133 Thu, 18 Oct 2012 23:55:40 +0300 Alexander Vladishev <p>Fixed in the development branch svn://svn.zabbix.com/branches/dev/ZBX-5697</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=sasha">Alexander Vladishev</a> (<a href="https://support.zabbix.com/browse/ZBX-5697">ZBX-5697</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-5697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=68133\#worklog-68133 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=67833#comment-67833 Mon, 15 Oct 2012 18:21:47 +0300 richlv <p>seriously guys, "+1" comments are not helpful. they actually only clutter the issues, result in useless notifications and i'm considering some mass cleanup (read - deletion) of such comments :/</p> <p>issue voting feature is in the upper right corner. it's also described in bug reporting guidelines at <a href="https://zabbix.org/wiki/Docs/bug_reporting_guidelines#Reporting_an_issue" class="external-link" target="_blank" rel="nofollow noopener">https://zabbix.org/wiki/Docs/bug_reporting_guidelines#Reporting_an_issue</a></p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=richlv">richlv</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=67833\#worklog-67833 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=67831#comment-67831 Mon, 15 Oct 2012 17:58:28 +0300 Raymond Kuiper <p>Please also cast a vote!</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=qix">Raymond Kuiper</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=67831\#worklog-67831 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=67829#comment-67829 Mon, 15 Oct 2012 17:55:37 +0300 sergio cricca <p>+1</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=sergio.cricca">sergio cricca</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=67829\#worklog-67829 RE: [ZBXNEXT-1380] Zabbix server should check the return code of media scripts https://support.zabbix.com/browse/ZBXNEXT-1380?focusedId=67804#comment-67804 Mon, 15 Oct 2012 12:53:38 +0300 Raymond Kuiper <p>+1</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=qix">Raymond Kuiper</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-1380">ZBXNEXT-1380</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=67804\#worklog-67804 RE: [ZBXNEXT-540] ZBX_NOTSUPPORTED from external scripts https://support.zabbix.com/browse/ZBXNEXT-540?focusedId=67599#comment-67599 Thu, 11 Oct 2012 14:53:21 +0300 Alexei Vladishev <p>I believe it should be documented and closed.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=alexei">Alexei Vladishev</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-540">ZBXNEXT-540</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-540?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=67599\#worklog-67599 RE: [ZBX-5464] zabbix can't get 0 from external script https://support.zabbix.com/browse/ZBX-5464?focusedId=65724#comment-65724 Mon, 10 Sep 2012 06:58:24 +0300 sles <p>Here it is:</p> <p>#!/bin/sh<br/> #fping -c 1 -q -B1 -r1 -b1500 192.168.22.229 2&gt;&amp;1 | awk '</p> { print $5 }' | awk -F "/" '{ print $3 }' | awk -F "%" '{p rint $1}'<br/> fping $* 2&gt;&amp;1 | awk '{ print $5 } <p>' | awk -F "/" '</p> { print $3 } <p>' | awk -F "%" '{if ($1 == 0) </p> { print "0.0"} <p> else </p> {print $1} <p> }'</p> <p>Thank you!</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=sles">sles</a> (<a href="https://support.zabbix.com/browse/ZBX-5464">ZBX-5464</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-5464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=65724\#worklog-65724 RE: [ZBX-5464] zabbix can't get 0 from external script https://support.zabbix.com/browse/ZBX-5464?focusedId=64715#comment-64715 Wed, 29 Aug 2012 09:36:48 +0300 Alexei Vladishev <p>Please attach pingloss.sh here if possible. Thanks.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=alexei">Alexei Vladishev</a> (<a href="https://support.zabbix.com/browse/ZBX-5464">ZBX-5464</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-5464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=64715\#worklog-64715 RE: [ZBX-5464] zabbix can't get 0 from external script https://support.zabbix.com/browse/ZBX-5464?focusedId=64218#comment-64218 Tue, 21 Aug 2012 12:10:19 +0300 sles <p>not so</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=sles">sles</a> (<a href="https://support.zabbix.com/browse/ZBX-5464">ZBX-5464</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-5464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=64218\#worklog-64218 RE: [ZBX-5464] zabbix can't get 0 from external script https://support.zabbix.com/browse/ZBX-5464?focusedId=64217#comment-64217 Tue, 21 Aug 2012 12:10:07 +0300 sles <p>not so</p> <p><span class="error">&#91;root@zabbix externalscripts&#93;</span># ./pingloss.sh -c 20 -q -B1 -r1 -b1500 192.168.22.220<br/> 0.0<br/> <span class="error">&#91;root@zabbix externalscripts&#93;</span># </p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=sles">sles</a> (<a href="https://support.zabbix.com/browse/ZBX-5464">ZBX-5464</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-5464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=64217\#worklog-64217 RE: [ZBX-5464] zabbix can't get 0 from external script https://support.zabbix.com/browse/ZBX-5464?focusedId=64203#comment-64203 Tue, 21 Aug 2012 09:59:07 +0300 Alexander Vladishev <p>Zabbix doesn't log CR and LF characters in the message "Received value [....". Possibly your script returns an empty line(s) before a value. </p> <p>Please reopen the issue if it not so.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=sasha">Alexander Vladishev</a> (<a href="https://support.zabbix.com/browse/ZBX-5464">ZBX-5464</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-5464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=64203\#worklog-64203 RE: [ZBX-5464] zabbix can't get 0 from external script https://support.zabbix.com/browse/ZBX-5464?focusedId=64066#comment-64066 Fri, 17 Aug 2012 09:19:26 +0300 sles <p>Oops!<br/> 0.0 is not always suitable too<br/> 19523:20120817:101257.060 item [Lud-cr2801-1:pingloss.sh[-c 20, -q, -B1, -r1, -b1500, </p> {HOST.CONN} <p>]] became not supported: Received value [0.0<br/> ] is not suitable for value type <span class="error">&#91;Numeric (float)&#93;</span></p> <p>real situation is worse <img class="emoticon" src="https://support.zabbix.com/images/icons/emoticons/smile.png" height="16" width="16" align="absmiddle" alt="" border="0"/><br/> although usually I see last value 0 in web frontend.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=sles">sles</a> (<a href="https://support.zabbix.com/browse/ZBX-5464">ZBX-5464</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=sles">sles</a></td> </tr> </table> https://support.zabbix.com/browse/ZBX-5464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=64066\#worklog-64066 RE: [ZBX-5397] Macros {HOST.IP} doesn't work in External check https://support.zabbix.com/browse/ZBX-5397?focusedId=63456#comment-63456 Wed, 8 Aug 2012 09:12:25 +0300 Alexander Vladishev <p>Fixed in pre-2.0.3rc1 r29444 and pre-2.1.0 (trunk) r29445.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=sasha">Alexander Vladishev</a> (<a href="https://support.zabbix.com/browse/ZBX-5397">ZBX-5397</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-5397?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=63456\#worklog-63456 RE: [ZBX-5397] Macros {HOST.IP} doesn't work in External check https://support.zabbix.com/browse/ZBX-5397?focusedId=63441#comment-63441 Wed, 8 Aug 2012 09:01:04 +0300 dimir <p>Successfully tested. Please review my changes in r29435.</p> <p>&lt;Sasha&gt; Great! Thanks.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=dimir">dimir</a> (<a href="https://support.zabbix.com/browse/ZBX-5397">ZBX-5397</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=sasha">Alexander Vladishev</a></td> </tr> </table> https://support.zabbix.com/browse/ZBX-5397?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=63441\#worklog-63441 RE: [ZBX-5397] Macros {HOST.IP} doesn't work in External check https://support.zabbix.com/browse/ZBX-5397?focusedId=63394#comment-63394 Tue, 7 Aug 2012 01:08:08 +0300 richlv <p>the fix is currently only in the development branch, indicated above - it is not yet fully reviewed and merged to the main branches</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=richlv">richlv</a> (<a href="https://support.zabbix.com/browse/ZBX-5397">ZBX-5397</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-5397?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=63394\#worklog-63394 RE: [ZBX-5397] Macros {HOST.IP} doesn't work in External check https://support.zabbix.com/browse/ZBX-5397?focusedId=63393#comment-63393 Mon, 6 Aug 2012 23:24:58 +0300 Александр Новосёлов <p>Zabbix Sources Pre-2.0.3rc1 (stable) 29413 06 Aug, 2012 not fix? </p> <p>Or in the source have not got the change?</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=sanyasi.ru">Александр Новосёлов</a> (<a href="https://support.zabbix.com/browse/ZBX-5397">ZBX-5397</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-5397?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=63393\#worklog-63393 RE: [ZBX-5397] Macros {HOST.IP} doesn't work in External check https://support.zabbix.com/browse/ZBX-5397?focusedId=63284#comment-63284 Fri, 3 Aug 2012 11:57:12 +0300 Alexander Vladishev <p>Fixed in the development branch svn://svn.zabbix.com/branches/dev/ZBX-5397</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=sasha">Alexander Vladishev</a> (<a href="https://support.zabbix.com/browse/ZBX-5397">ZBX-5397</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-5397?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=63284\#worklog-63284 RE: [ZBX-5397] Macros {HOST.IP} doesn't work in External check https://support.zabbix.com/browse/ZBX-5397?focusedId=63170#comment-63170 Wed, 1 Aug 2012 16:32:20 +0300 richlv <p>indeed, external check HOST.IP macro resolution does not seem to take ip from the selected interface...</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=richlv">richlv</a> (<a href="https://support.zabbix.com/browse/ZBX-5397">ZBX-5397</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-5397?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=63170\#worklog-63170 RE: [ZBX-5397] Macros {HOST.IP} doesn't work in External check https://support.zabbix.com/browse/ZBX-5397?focusedId=63165#comment-63165 Wed, 1 Aug 2012 15:34:48 +0300 Александр Новосёлов <p>attach screenshot</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=sanyasi.ru">Александр Новосёлов</a> (<a href="https://support.zabbix.com/browse/ZBX-5397">ZBX-5397</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-5397?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=63165\#worklog-63165 RE: [ZBX-5397] Macros {HOST.IP} doesn't work in External check https://support.zabbix.com/browse/ZBX-5397?focusedId=63162#comment-63162 Wed, 1 Aug 2012 15:32:43 +0300 richlv <p>no, not adding agent interface - make sure snmp interface is selected for the external check in item properties</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=richlv">richlv</a> (<a href="https://support.zabbix.com/browse/ZBX-5397">ZBX-5397</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-5397?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=63162\#worklog-63162 RE: [ZBX-5397] Macros {HOST.IP} doesn't work in External check https://support.zabbix.com/browse/ZBX-5397?focusedId=63161#comment-63161 Wed, 1 Aug 2012 15:31:31 +0300 Александр Новосёлов <p>Yes, when you add the Agent interface, everything works. But why should manually add the interface to the host anenta - which just is not an agent, and is used only snmp?</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=sanyasi.ru">Александр Новосёлов</a> (<a href="https://support.zabbix.com/browse/ZBX-5397">ZBX-5397</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-5397?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=63161\#worklog-63161 RE: [ZBX-5397] Macros {HOST.IP} doesn't work in External check https://support.zabbix.com/browse/ZBX-5397?focusedId=63159#comment-63159 Wed, 1 Aug 2012 15:30:23 +0300 richlv <p>documented in <a href="http://www.zabbix.com/documentation/2.0/manual/appendix/macros/supported_by_location" class="external-link" target="_blank" rel="nofollow noopener">http://www.zabbix.com/documentation/2.0/manual/appendix/macros/supported_by_location</a></p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=richlv">richlv</a> (<a href="https://support.zabbix.com/browse/ZBX-5397">ZBX-5397</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-5397?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=63159\#worklog-63159 RE: [ZBX-5397] Macros {HOST.IP} doesn't work in External check https://support.zabbix.com/browse/ZBX-5397?focusedId=63156#comment-63156 Wed, 1 Aug 2012 15:19:29 +0300 richlv <p>ok, so most likely the issue is with documentation <img class="emoticon" src="https://support.zabbix.com/images/icons/emoticons/wink.png" height="16" width="16" align="absmiddle" alt="" border="0"/><br/> with eternal checks, as dug up by sasha, it should resolve to the interface that you have selected for the item - please try selecting an interface and see whether that helps</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=richlv">richlv</a> (<a href="https://support.zabbix.com/browse/ZBX-5397">ZBX-5397</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-5397?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=63156\#worklog-63156 RE: [ZBX-5397] Macros {HOST.IP} doesn't work in External check https://support.zabbix.com/browse/ZBX-5397?focusedId=63154#comment-63154 Wed, 1 Aug 2012 15:09:02 +0300 Александр Новосёлов <p>This problem - doesn't work in External check is not a global script. </p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=sanyasi.ru">Александр Новосёлов</a> (<a href="https://support.zabbix.com/browse/ZBX-5397">ZBX-5397</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-5397?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=63154\#worklog-63154 RE: [ZBX-5397] Macros {HOST.IP} doesn't work in External check https://support.zabbix.com/browse/ZBX-5397?focusedId=63153#comment-63153 Wed, 1 Aug 2012 15:08:39 +0300 Александр Новосёлов <p>Yes, in global scripts <span class="error">&#91;ZBX 4976&#93;</span> fix problem. </p> <p>This problem - doesn't work in External check is not a global script.</p> <p>I reopen </p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=sanyasi.ru">Александр Новосёлов</a> (<a href="https://support.zabbix.com/browse/ZBX-5397">ZBX-5397</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-5397?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=63153\#worklog-63153 RE: [ZBX-5397] Macros {HOST.IP} doesn't work in External check https://support.zabbix.com/browse/ZBX-5397?focusedId=63151#comment-63151 Wed, 1 Aug 2012 14:56:38 +0300 richlv <p>this should be already fixed for 2.0.2 with <a href="https://support.zabbix.com/browse/ZBX-4976" title="HOST.CONN doesn&#39;t work in global scripts" class="issue-link" data-issue-key="ZBX-4976"><del>ZBX-4976</del></a> - please reopen if not</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=richlv">richlv</a> (<a href="https://support.zabbix.com/browse/ZBX-5397">ZBX-5397</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-5397?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=63151\#worklog-63151 RE: [ZBXNEXT-952] Update of documentation 4.19.10 External checks https://support.zabbix.com/browse/ZBXNEXT-952?focusedId=56665#comment-56665 Tue, 10 Apr 2012 13:01:21 +0300 richlv <p>reopen to change label</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=richlv">richlv</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-952">ZBXNEXT-952</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=56665\#worklog-56665 RE: [ZBX-4803] Error in External Check Upgrade in 2.0rc2 Script for more than 1 parameter https://support.zabbix.com/browse/ZBX-4803?focusedId=56307#comment-56307 Tue, 3 Apr 2012 08:58:55 +0300 Martins Valkovskis <p>A note on this added here:</p> <p><a href="http://www.zabbix.com/documentation/2.0/manual/installation/upgrade_notes?&amp;#item_changes" class="external-link" target="_blank" rel="nofollow noopener">http://www.zabbix.com/documentation/2.0/manual/installation/upgrade_notes?&amp;#item_changes</a></p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=martins-v">Martins Valkovskis</a> (<a href="https://support.zabbix.com/browse/ZBX-4803">ZBX-4803</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-4803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=56307\#worklog-56307 RE: [ZBX-4803] Error in External Check Upgrade in 2.0rc2 Script for more than 1 parameter https://support.zabbix.com/browse/ZBX-4803?focusedId=56290#comment-56290 Mon, 2 Apr 2012 18:27:53 +0300 Oleksii Zagorskyi <p>Probably a note can be added to the page <a href="http://www.zabbix.com/documentation/2.0/manual/installation/upgrade_notes" class="external-link" target="_blank" rel="nofollow noopener">http://www.zabbix.com/documentation/2.0/manual/installation/upgrade_notes</a><br/> that recommended to manually review all external checks if they have more than one parameter in the key.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=zalex_ua">Oleksii Zagorskyi</a> (<a href="https://support.zabbix.com/browse/ZBX-4803">ZBX-4803</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-4803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=56290\#worklog-56290 RE: [ZBX-4803] Error in External Check Upgrade in 2.0rc2 Script for more than 1 parameter https://support.zabbix.com/browse/ZBX-4803?focusedId=56285#comment-56285 Mon, 2 Apr 2012 17:29:52 +0300 Alexander Vladishev <p>It should be fixed manually. Such action it is almost impossible to make by a SQL script.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=sasha">Alexander Vladishev</a> (<a href="https://support.zabbix.com/browse/ZBX-4803">ZBX-4803</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-4803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=56285\#worklog-56285 RE: [ZBX-3647] keys of external checks do not conform to the item key syntax https://support.zabbix.com/browse/ZBX-3647?focusedId=47302#comment-47302 Fri, 9 Sep 2011 19:58:17 +0300 Alexander Vladishev <p>Available in version pre1.9.6, r21597.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=sasha">Alexander Vladishev</a> (<a href="https://support.zabbix.com/browse/ZBX-3647">ZBX-3647</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-3647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=47302\#worklog-47302 RE: [ZBXNEXT-952] Update of documentation 4.19.10 External checks https://support.zabbix.com/browse/ZBXNEXT-952?focusedId=47285#comment-47285 Fri, 9 Sep 2011 16:48:56 +0300 richlv <p>it's not strictly the same thing, but it was done in the linked issue.<br/> docs were updated &amp; trunk now accepts multiline output</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=richlv">richlv</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-952">ZBXNEXT-952</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=47285\#worklog-47285 RE: [ZBX-3647] keys of external checks do not conform to the item key syntax https://support.zabbix.com/browse/ZBX-3647?focusedId=47263#comment-47263 Fri, 9 Sep 2011 13:17:50 +0300 richlv <p>this also solves <a href="https://support.zabbix.com/browse/ZBXNEXT-99" title="support text for externalchecks" class="issue-link" data-issue-key="ZBXNEXT-99"><del>ZBXNEXT-99</del></a> and <a href="https://support.zabbix.com/browse/ZBXNEXT-530" title="External script option" class="issue-link" data-issue-key="ZBXNEXT-530"><del>ZBXNEXT-530</del></a></p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=richlv">richlv</a> (<a href="https://support.zabbix.com/browse/ZBX-3647">ZBX-3647</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-3647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=47263\#worklog-47263 RE: [ZBXNEXT-99] support text for externalchecks https://support.zabbix.com/browse/ZBXNEXT-99?focusedId=47262#comment-47262 Fri, 9 Sep 2011 13:17:17 +0300 richlv <p>this is fixed as <a href="https://support.zabbix.com/browse/ZBX-3647" title="keys of external checks do not conform to the item key syntax" class="issue-link" data-issue-key="ZBX-3647"><del>ZBX-3647</del></a></p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=richlv">richlv</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-99">ZBXNEXT-99</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-99?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=47262\#worklog-47262 RE: [ZBXNEXT-952] Update of documentation 4.19.10 External checks https://support.zabbix.com/browse/ZBXNEXT-952?focusedId=47239#comment-47239 Thu, 8 Sep 2011 17:36:58 +0300 Marcel Hecko <p>I am not sure that tis is the same issue though. This is not about input parameters, but about output of the external script.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=marcel">Marcel Hecko</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-952">ZBXNEXT-952</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=47239\#worklog-47239 RE: [ZBXNEXT-952] Update of documentation 4.19.10 External checks https://support.zabbix.com/browse/ZBXNEXT-952?focusedId=47233#comment-47233 Thu, 8 Sep 2011 16:02:32 +0300 Rudolfs Kreicbergs <p>This will be done under <a href="https://support.zabbix.com/browse/ZBX-3647" title="keys of external checks do not conform to the item key syntax" class="issue-link" data-issue-key="ZBX-3647"><del>ZBX-3647</del></a>.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=stoney">Rudolfs Kreicbergs</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-952">ZBXNEXT-952</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=47233\#worklog-47233 RE: [ZBX-3647] keys of external checks do not conform to the item key syntax https://support.zabbix.com/browse/ZBX-3647?focusedId=47222#comment-47222 Thu, 8 Sep 2011 13:29:57 +0300 Alexander Vladishev <p>added multiple parameters for external checks in r21553.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=sasha">Alexander Vladishev</a> (<a href="https://support.zabbix.com/browse/ZBX-3647">ZBX-3647</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-3647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=47222\#worklog-47222 RE: [ZBX-3647] keys of external checks do not conform to the item key syntax https://support.zabbix.com/browse/ZBX-3647?focusedId=47217#comment-47217 Thu, 8 Sep 2011 12:50:20 +0300 Rudolfs Kreicbergs <p>Decided to use the format suggested by Rich - "key<span class="error">&#91;param1,param2,...&#93;</span>".</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=stoney">Rudolfs Kreicbergs</a> (<a href="https://support.zabbix.com/browse/ZBX-3647">ZBX-3647</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-3647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=47217\#worklog-47217 RE: [ZBX-3647] keys of external checks do not conform to the item key syntax https://support.zabbix.com/browse/ZBX-3647?focusedId=47215#comment-47215 Thu, 8 Sep 2011 12:44:50 +0300 richlv <p>does the fix change external key parameter format to the one other types have ( key<span class="error">&#91;param1,param2,param3,...&#93;</span> ) ?</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=richlv">richlv</a> (<a href="https://support.zabbix.com/browse/ZBX-3647">ZBX-3647</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-3647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=47215\#worklog-47215 RE: [ZBX-3647] keys of external checks do not conform to the item key syntax https://support.zabbix.com/browse/ZBX-3647?focusedId=47211#comment-47211 Thu, 8 Sep 2011 11:37:41 +0300 Alexander Vladishev <p>Fixed in the development branch svn://svn.zabbix.com/branches/dev/ZBX-3647</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=sasha">Alexander Vladishev</a> (<a href="https://support.zabbix.com/browse/ZBX-3647">ZBX-3647</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-3647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=47211\#worklog-47211 RE: [ZBX-4098] HOST.CONN macro in external checks loses first character https://support.zabbix.com/browse/ZBX-4098?focusedId=47187#comment-47187 Wed, 7 Sep 2011 15:19:33 +0300 Alexander Vladishev <p>test.sh<span class="error">&#91;&quot;&lt;${HOST.CONN}&gt;&quot;&#93;</span> will be converted by Zabbix server to test.sh<span class="error">&#91;&quot;&lt;$127.0.0.1&gt;&quot;&#93;</span>.<br/> Shell recognize $1 as empty variable and result will be printed as &lt;27.0.0.1&gt;</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=sasha">Alexander Vladishev</a> (<a href="https://support.zabbix.com/browse/ZBX-4098">ZBX-4098</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-4098?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=47187\#worklog-47187 RE: [ZBX-3647] keys of external checks do not conform to the item key syntax https://support.zabbix.com/browse/ZBX-3647?focusedId=46864#comment-46864 Thu, 1 Sep 2011 17:40:16 +0300 richlv <p>just to clarify, it would be preferred if external check keys fully followed syntax - as in, allowed key<span class="error">&#91;param1,param2,...&#93;</span></p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=richlv">richlv</a> (<a href="https://support.zabbix.com/browse/ZBX-3647">ZBX-3647</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-3647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=46864\#worklog-46864 RE: [ZBX-3647] keys of external checks do not conform to the item key syntax https://support.zabbix.com/browse/ZBX-3647?focusedId=40735#comment-40735 Mon, 28 Mar 2011 14:07:33 +0300 Aleksandrs Saveljevs <p>We should probably make the documentation more clear that item keys for external checks accept only one string argument. We should also modify the server so that it validates the key and passes the first argument to the script, instead of passing everything between "<span class="error">&#91;&quot; and &quot;&#93;</span>".</p> <p>PS: Note that if you wish to pass "Auto UNIX" "free" to your external script, you can use homepl.freeid<span class="error">&#91;&quot;\&quot;Auto UNIX\&quot; \&quot;free\&quot;&quot;&#93;</span> as the key.</p> <p>EDIT: Actually, disregard the PS. You should be able to write it this way, but currently you cannot, because external check keys do not follow the syntax. Thanks for reopening!</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=asaveljevs">Aleksandrs Saveljevs</a> (<a href="https://support.zabbix.com/browse/ZBX-3647">ZBX-3647</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=asaveljevs">Aleksandrs Saveljevs</a></td> </tr> </table> https://support.zabbix.com/browse/ZBX-3647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=40735\#worklog-40735 RE: [ZBX-3647] keys of external checks do not conform to the item key syntax https://support.zabbix.com/browse/ZBX-3647?focusedId=40734#comment-40734 Mon, 28 Mar 2011 13:50:23 +0300 Robert Jerzak <p>Yes, it's true but this is extermal check and passing parameters to external script should be space separated.<br/> If i use comma separated parameters then external script will not parse parameters in correct way.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=rob">Robert Jerzak</a> (<a href="https://support.zabbix.com/browse/ZBX-3647">ZBX-3647</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-3647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=40734\#worklog-40734 RE: [ZBX-3647] keys of external checks do not conform to the item key syntax https://support.zabbix.com/browse/ZBX-3647?focusedId=40713#comment-40713 Mon, 28 Mar 2011 09:17:21 +0300 Aleksandrs Saveljevs <p>Rich is right: homepl.freeid<span class="error">&#91;&quot;Auto UNIX&quot; &quot;free&quot;&#93;</span> is not a valid key. See <a href="http://www.zabbix.com/documentation/1.8/manual/config/items#item_key" class="external-link" target="_blank" rel="nofollow noopener">http://www.zabbix.com/documentation/1.8/manual/config/items#item_key</a> for item key syntax.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=asaveljevs">Aleksandrs Saveljevs</a> (<a href="https://support.zabbix.com/browse/ZBX-3647">ZBX-3647</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBX-3647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=40713\#worklog-40713 RE: [ZBX-3647] keys of external checks do not conform to the item key syntax https://support.zabbix.com/browse/ZBX-3647?focusedId=40705#comment-40705 Sun, 27 Mar 2011 06:10:48 +0300 richlv <p>could you please try with 1.8 svn head (or nightly snapshot) ?<br/> it should be fixed along with <a href="https://support.zabbix.com/browse/ZBX-2012" title="frontend error - Incorrect usage of quotes" class="issue-link" data-issue-key="ZBX-2012"><del>ZBX-2012</del></a></p> <p>edit : hmm, actually not. if you are trying to pass two parameters, they should be separated by comma, not space</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=richlv">richlv</a> (<a href="https://support.zabbix.com/browse/ZBX-3647">ZBX-3647</a>)</td> </tr> <tr> <td>Edited by:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=richlv">richlv</a></td> </tr> </table> https://support.zabbix.com/browse/ZBX-3647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=40705\#worklog-40705 RE: [ZBXNEXT-540] ZBX_NOTSUPPORTED from external scripts https://support.zabbix.com/browse/ZBXNEXT-540?focusedId=34619#comment-34619 Fri, 22 Oct 2010 11:54:27 +0300 Marcel Hecko <p>Great indeed! There is a secion in Zabbix documentation thought, that script should NEVER output nothing. This might be changed as this is a very important information <img class="emoticon" src="https://support.zabbix.com/images/icons/emoticons/smile.png" height="16" width="16" align="absmiddle" alt="" border="0"/> In my case this solves the issue, however ZBX_UNSUPPORTED output recognition would be a benefit in zabbix monitoring infrastructure consistency. Thanks for a great work!</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=marcel">Marcel Hecko</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-540">ZBXNEXT-540</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-540?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=34619\#worklog-34619 RE: [ZBXNEXT-540] ZBX_NOTSUPPORTED from external scripts https://support.zabbix.com/browse/ZBXNEXT-540?focusedId=34607#comment-34607 Fri, 22 Oct 2010 09:26:11 +0300 Aleksandrs Saveljevs <p>As a workaround, you can make the script output nothing - in that case the external check will be treated as not supported.</p> <br/> <br/> <table> <tr> <td>Author:</td> <td><a href="https://support.zabbix.com/secure/ViewProfile.jspa?name=asaveljevs">Aleksandrs Saveljevs</a> (<a href="https://support.zabbix.com/browse/ZBXNEXT-540">ZBXNEXT-540</a>)</td> </tr> </table> https://support.zabbix.com/browse/ZBXNEXT-540?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedId=34607\#worklog-34607