Version 6.0.5 on ubuntu 20.04.
I have an external script that returns a discovery of disk partitions on windows. It's external as it does a few other things, but I decided I wanted to filter the name returned and tried using the preprocessing with regular expression.
It fails, so I wanted to test run it. The test run (get value from host) times out. It does not time out run normally. I updated the debug level and it looks like it tries to run and times out.
Here is some output from the debug level when running the test from the LLD in the gui.
Here is a test run using the zabbix server account cut and pasted from the above:
As you can see it runs fine, and fast (under a second, and timeout is set to 30 seconds).
I'm drawing a blank as to what the context could be in the GUI call that is different and causing it to time out. Again, while my preprocessing step is not working, the script itself runs fine called from the server in the normal course of polling.
What's different about the test mode?
I'm also curious if there's something special you do to use preprocessing on external checks, is it running the regular expression only on the {#SNMPVALUE} replacement, or the whole line, or.... ? I haven't found an example from anyone using an external check.
Thanks,
Linwood
PS. I can't test it even if there are no preprocessing steps.
I have an external script that returns a discovery of disk partitions on windows. It's external as it does a few other things, but I decided I wanted to filter the name returned and tried using the preprocessing with regular expression.
It fails, so I wanted to test run it. The test run (get value from host) times out. It does not time out run normally. I updated the debug level and it looks like it tries to run and times out.
Here is some output from the debug level when running the test from the LLD in the gui.
Code:
1437726:20220604:174005.160 End of substitute_key_macros_impl():SUCCEED data:'snmpDiskDiscovery.pl["192.168.130.14","LEF","xxx"]'
1437726:20220604:174005.160 In get_value() key:'snmpDiskDiscovery.pl["{HOST.CONN}","{HOST.HOST}","{$SNMP_COMMUNITY} "]'
1437726:20220604:174005.160 In get_value_external() key:'snmpDiskDiscovery.pl["192.168.130.14","LEF","xxx"]'
1437726:20220604:174005.160 In zbx_popen() command:'/usr/local/share/zabbix/externalscripts/snmpDiskDiscovery.pl '192.168.130.14' 'LEF' 'xxx''
1437856:20220604:174032.862 Failed to execute command "/usr/local/share/zabbix/externalscripts/snmpDiskDiscovery.pl '192.168.130.14' 'LEF' 'xxx'": Timeout while executing a shell script.
Code:
root@nms:/tmp# su - zabbix
su: warning: cannot change directory to /home/zabbix: No such file or directory
$ /usr/local/share/zabbix/externalscripts/snmpDiskDiscovery.pl '192.168.130.14' 'LEF' 'xxx'
[
{"{#SNMPINDEX}":"1", "{#SNMPVALUE}":"C:\\ Label: Serial Number a8db00b"},
{"{#SNMPINDEX}":"3", "{#SNMPVALUE}":"T:\\ Label:VDisk Serial Number 22f86f4"}
]
$
I'm drawing a blank as to what the context could be in the GUI call that is different and causing it to time out. Again, while my preprocessing step is not working, the script itself runs fine called from the server in the normal course of polling.
What's different about the test mode?
I'm also curious if there's something special you do to use preprocessing on external checks, is it running the regular expression only on the {#SNMPVALUE} replacement, or the whole line, or.... ? I haven't found an example from anyone using an external check.
Thanks,
Linwood
PS. I can't test it even if there are no preprocessing steps.
Comment