Source
zbx_alerter_deserialize_email(ipc_message->data, &alertid, &mediatypeid, &eventid, &sendto, &subject, &message,
/*
** Zabbix
** Copyright (C) 2001-2023 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
ZBX_PTR_VECTOR_IMPL(am_source_stats_ptr, zbx_am_source_stats_t *)
static zbx_es_t es_engine;
/******************************************************************************
* *
* Purpose: executes script alert type *
* *
* Parameters: command - [IN] command for execution *
* error - [OUT] error string if function fails *
* max_error_len - [IN] length of error buffer *
* *
* Return value: SUCCEED if processed successfully, TIMEOUT_ERROR if *
* timeout occurred, SIG_ERROR if interrupted by signal or FAIL *
* otherwise *
* *
******************************************************************************/
static int execute_script_alert(const char *command, char *error, size_t max_error_len)
{
char *output = NULL;
int ret = FAIL;
if (SUCCEED == (ret = zbx_execute(command, &output, error, max_error_len, ALARM_ACTION_TIMEOUT,
ZBX_EXIT_CODE_CHECKS_ENABLED, NULL)))
{
zabbix_log(LOG_LEVEL_DEBUG, "%s output:\n%s", command, output);
zbx_free(output);
}
return ret;
}
/******************************************************************************
* *
* Purpose: registers alerter with alert manager *
* *
* Parameters: socket - [IN] connection socket *
* *
******************************************************************************/
static void alerter_register(zbx_ipc_socket_t *socket)
{
pid_t ppid;
ppid = getppid();
zbx_ipc_socket_write(socket, ZBX_IPC_ALERTER_REGISTER, (unsigned char *)&ppid, sizeof(ppid));
}
/******************************************************************************
* *
* Purpose: sends alert sending result to alert manager *
* *
* Parameters: socket - [IN] connection socket *