I'm having some difficulty getting a UserParameter to work correctly. I think it's a permissions problem but can't seem to work around it.
My UserParameter is the following:
UserParameter=custom.chat.users,cd /usr/local/ejabberd-2.0.0.2/bin; ./ejabberdctl connected-users-number
When I run that command from the CLI as the zabbix user, it returns the value as expected. However, when zabbix runs that command it returns an error.
The ejabberdctl command requires a cookie file with 400 permissions and owned by the user calling the command. That file exists for both root and zabbix and works as expected via CLI. When zabbix server runs that command it looks as though ejabberdctl was called by the root user.
Output of ./zabbix_get -s chat-server -k custom.chat.users
{error_logger,{{2009,6,3},{13,22,10}},"Error when
reading /root/.erlang.cookie: eacces",[]}
That same error occurred from the CLI prior to creating the cookie file for the zabbix user. I've tried putting the userparameter arguments into a bash script and calling the script but I get the same error.
Any insight into zabbix_get calls vs. running something via CLI would be appreciated.
Thanks,
Les
My UserParameter is the following:
UserParameter=custom.chat.users,cd /usr/local/ejabberd-2.0.0.2/bin; ./ejabberdctl connected-users-number
When I run that command from the CLI as the zabbix user, it returns the value as expected. However, when zabbix runs that command it returns an error.
The ejabberdctl command requires a cookie file with 400 permissions and owned by the user calling the command. That file exists for both root and zabbix and works as expected via CLI. When zabbix server runs that command it looks as though ejabberdctl was called by the root user.
Output of ./zabbix_get -s chat-server -k custom.chat.users
{error_logger,{{2009,6,3},{13,22,10}},"Error when
reading /root/.erlang.cookie: eacces",[]}
That same error occurred from the CLI prior to creating the cookie file for the zabbix user. I've tried putting the userparameter arguments into a bash script and calling the script but I get the same error.
Any insight into zabbix_get calls vs. running something via CLI would be appreciated.
Thanks,
Les
Comment