1 /* 2 Copyright 2020 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 26 #ifndef CFENGINE_MONITORING_READ_H 27 #define CFENGINE_MONITORING_READ_H 28 29 30 #include <cf3.defs.h> 31 32 33 extern MonitoringSlot *SLOTS[CF_OBSERVABLES - ob_spare]; 34 35 36 void Nova_FreeSlot(MonitoringSlot *slot); 37 MonitoringSlot *Nova_MakeSlot(const char *name, const char *description, 38 const char *units, 39 double expected_minimum, double expected_maximum, 40 bool consolidable); 41 void Nova_LoadSlots(void); 42 bool NovaHasSlot(int idx); 43 const char *NovaGetSlotName(int idx); 44 const char *NovaGetSlotDescription(int index); 45 const char *NovaGetSlotUnits(int index); 46 double NovaGetSlotExpectedMinimum(int index); 47 double NovaGetSlotExpectedMaximum(int index); 48 bool NovaIsSlotConsolidable(int index); 49 bool GetRecordForTime(CF_DB *db, time_t time, Averages *result); 50 51 52 /* - date-related functions - */ 53 54 void MakeTimekey(time_t time, char *result); 55 time_t WeekBegin(time_t time); 56 time_t SubtractWeeks(time_t time, int weeks); 57 time_t NextShift(time_t time); 58 59 60 #endif 61