1 /* 2 Copyright 2021 Northern.tech AS 3 4 This file is part of CFEngine 3 - written and maintained by Northern.tech AS. 5 6 This program is free software; you can redistribute it and/or modify it 7 under the terms of the GNU General Public License as published by the 8 Free Software Foundation; version 3. 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 18 19 To the extent this program is licensed as part of the Enterprise 20 versions of CFEngine, the applicable Commercial Open Source License 21 (COSL) may apply to this file if you as a licensee so wish it. See 22 included file COSL.txt. 23 */ 24 25 #ifndef CFENGINE_PROBES_H 26 #define CFENGINE_PROBES_H 27 28 29 #include <cf3.defs.h> 30 31 32 void MonOtherInit(); 33 void MonOtherGatherData(double *cf_this); 34 35 36 /* 37 * Type of callback collecting actual probe data. 38 */ 39 typedef void (*ProbeGatherData) (double *cf_this); 40 41 /* 42 * Type of probe initialization function. 43 * 44 * Probe initialization function should either return callback and name of probe 45 * provider in "name" argument, or NULL and error description in "error" 46 * argument. 47 * 48 * Caller does not free data returned in "name" or "error". 49 */ 50 typedef ProbeGatherData(*ProbeInit) (const char **name, const char **error); 51 52 /* 53 * Existing probes and their identifiers 54 */ 55 56 #define MON_IO_READS "io_reads" 57 #define MON_IO_WRITES "io_writes" 58 #define MON_IO_READDATA "io_readdata" 59 #define MON_IO_WRITTENDATA "io_writtendata" 60 61 ProbeGatherData MonIoInit(const char **name, const char **error); 62 63 #define MON_MEM_TOTAL "mem_total" 64 #define MON_MEM_FREE "mem_free" 65 #define MON_MEM_CACHED "mem_cached" 66 #define MON_MEM_SWAP "mem_swap" 67 #define MON_MEM_FREE_SWAP "mem_freeswap" 68 69 ProbeGatherData MonMemoryInit(const char **name, const char **error); 70 71 72 #endif 73