Hi all. I've found a lot of useful information, tips and tricks on this forum for some time, but this is the first time I'm posting to the forum, after not being able to find the problem with a new Zabbix installation (already using an older 3.4.3 Zabbix standard installation that works fine).
My new setup is:
- everything runs under an unpriviledged user (not zabbix for some reason)
- Zabbix 4.0.4 recompiled from sources on RHEL 7
- using Oracle 11.2 database
- using php-5.6.36 running on apache httpd-2.4.37
Everyting seems to be up and running: zabbix_server, zabbix_agentd, frontend, server configured to listen on port 10051 for data for "Zabbix trapper" items.
First thing:
- some errors in zabbix_server.log, appear from time to time - seems like some data regarding trends is producing them, anybody using Oracle database seen such errors before?
45878:20190226:120023.111 [Z3007] query failed: [-1] ORA-00001: unique constraint (ZABBIX.SYS_C0051041) violated
45875:20190226:120025.112 [Z3007] query failed: [-1] ORA-00001: unique constraint (ZABBIX.SYS_C0051034) violated
Second and more annoying problem is regarding actions that should execute remote commands. Several situations from the ones below have happened at random (didn't find a pattern):
- Fail: action doesn't fire at all
- Fail: action fires and remote command (script) that is defined in action operation failes because seemingly script is not found - exact error is: "Cannot exectue command "/srv/app/zabbix/share/zabbix/alertscripts/test.sh": [2] No such file or directory" - tried to copy script exactly in the path specified (which seems to be the default path, that I have overridden) and same error popps up
- Succes: action fires and remote command (script) is executed ok - I can see "Executed" in fronted and also checked log of test script
I experienced the above having done the following:
1. - defined a test item of type "Zabbix trapper" on the "Zabbix server" host (only host defined)
2. - defined a trigger to fire when value for test item is greater than 0 and recover when it is 0
3. - defined an action with 1 operation "Run remote commands on current host" to execute a script that is in the "AlertScriptsPath", but also in command is specified with full absolute path
4. - testing was done by sending values through socket as JSON to the Zabbix server using a simple Java client - all requests are received and processed ok, values for item change and trigger fires OK generating "PROBLEM" and "RESOLVED", respectively.
I don't understand why the server is searching for the script still in what appears the default "AlertScriptsPath" path which was set in the zabbix_server.conf file to be another directory. I also tried to copy the script exactly in the path specified as not found and same error ocurred.
Any thoughts would be appreciated.
Sorry for the long post...
J.
**********************
Update: I managed to find a solution: createad user zabbix on machine where zabbix_server is running. Still all the processes run under different user, but seems like when user zabbix is not able to connect to host, the remote execute functionality is not working as expected.
So, one needs to have user zabbix on host, even if zabbix_server runs under some other user in order for all the functionality to be present.
My new setup is:
- everything runs under an unpriviledged user (not zabbix for some reason)
- Zabbix 4.0.4 recompiled from sources on RHEL 7
- using Oracle 11.2 database
- using php-5.6.36 running on apache httpd-2.4.37
Everyting seems to be up and running: zabbix_server, zabbix_agentd, frontend, server configured to listen on port 10051 for data for "Zabbix trapper" items.
First thing:
- some errors in zabbix_server.log, appear from time to time - seems like some data regarding trends is producing them, anybody using Oracle database seen such errors before?
45878:20190226:120023.111 [Z3007] query failed: [-1] ORA-00001: unique constraint (ZABBIX.SYS_C0051041) violated
45875:20190226:120025.112 [Z3007] query failed: [-1] ORA-00001: unique constraint (ZABBIX.SYS_C0051034) violated
Second and more annoying problem is regarding actions that should execute remote commands. Several situations from the ones below have happened at random (didn't find a pattern):
- Fail: action doesn't fire at all
- Fail: action fires and remote command (script) that is defined in action operation failes because seemingly script is not found - exact error is: "Cannot exectue command "/srv/app/zabbix/share/zabbix/alertscripts/test.sh": [2] No such file or directory" - tried to copy script exactly in the path specified (which seems to be the default path, that I have overridden) and same error popps up
- Succes: action fires and remote command (script) is executed ok - I can see "Executed" in fronted and also checked log of test script
I experienced the above having done the following:
1. - defined a test item of type "Zabbix trapper" on the "Zabbix server" host (only host defined)
2. - defined a trigger to fire when value for test item is greater than 0 and recover when it is 0
3. - defined an action with 1 operation "Run remote commands on current host" to execute a script that is in the "AlertScriptsPath", but also in command is specified with full absolute path
4. - testing was done by sending values through socket as JSON to the Zabbix server using a simple Java client - all requests are received and processed ok, values for item change and trigger fires OK generating "PROBLEM" and "RESOLVED", respectively.
I don't understand why the server is searching for the script still in what appears the default "AlertScriptsPath" path which was set in the zabbix_server.conf file to be another directory. I also tried to copy the script exactly in the path specified as not found and same error ocurred.
Any thoughts would be appreciated.
Sorry for the long post...
J.
**********************
Update: I managed to find a solution: createad user zabbix on machine where zabbix_server is running. Still all the processes run under different user, but seems like when user zabbix is not able to connect to host, the remote execute functionality is not working as expected.
So, one needs to have user zabbix on host, even if zabbix_server runs under some other user in order for all the functionality to be present.