1 /*
2 ** Zabbix
3 ** Copyright (C) 2001-2021 Zabbix SIA
4 **
5 ** This program is free software; you can redistribute it and/or modify
6 ** it under the terms of the GNU General Public License as published by
7 ** the Free Software Foundation; either version 2 of the License, or
8 ** (at your option) any later version.
9 **
10 ** This program is distributed in the hope that it will be useful,
11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ** GNU General Public License for more details.
14 **
15 ** You should have received a copy of the GNU General Public License
16 ** along with this program; if not, write to the Free Software
17 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18 **/
19 
20 #include "common.h"
21 #include "dbcache.h"
22 #include "preproc.h"
23 
24 /******************************************************************************
25  *                                                                            *
26  * Function: zbx_preprocess_item_value                                        *
27  *                                                                            *
28  * Purpose: perform item value preprocessing and dependend item processing    *
29  *                                                                            *
30  * Parameters: itemid          - [IN] the itemid                              *
31  *             item_value_type - [IN] the item value type                     *
32  *             item_flags      - [IN] the item flags (e. g. lld rule)         *
33  *             result          - [IN] agent result containing the value       *
34  *                               to add                                       *
35  *             ts              - [IN] the value timestamp                     *
36  *             state           - [IN] the item state                          *
37  *             error           - [IN] the error message in case item state is *
38  *                               ITEM_STATE_NOTSUPPORTED                      *
39  *                                                                            *
40  ******************************************************************************/
zbx_preprocess_item_value(zbx_uint64_t itemid,unsigned char item_value_type,unsigned char item_flags,AGENT_RESULT * result,zbx_timespec_t * ts,unsigned char state,char * error)41 void	zbx_preprocess_item_value(zbx_uint64_t itemid, unsigned char item_value_type, unsigned char item_flags,
42 		AGENT_RESULT *result, zbx_timespec_t *ts, unsigned char state, char *error)
43 {
44 	dc_add_history(itemid, item_value_type, item_flags, result, ts, state, error);
45 }
46 
47 /******************************************************************************
48  *                                                                            *
49  * Function: zbx_preprocessor_flush                                           *
50  *                                                                            *
51  * Purpose: send flush command to preprocessing manager                       *
52  *                                                                            *
53  ******************************************************************************/
zbx_preprocessor_flush(void)54 void	zbx_preprocessor_flush(void)
55 {
56 	dc_flush_history();
57 }
58 
59 /******************************************************************************
60  *                                                                            *
61  * Function: zbx_preprocessor_get_queue_size                                  *
62  *                                                                            *
63  * Purpose: get queue size (enqueued value count) of preprocessing manager    *
64  *                                                                            *
65  * Return value: enqueued item count                                          *
66  *                                                                            *
67  ******************************************************************************/
zbx_preprocessor_get_queue_size(void)68 zbx_uint64_t	zbx_preprocessor_get_queue_size(void)
69 {
70 	return 0;
71 }
72