root/trunk/src/renetcolAgg.h @ 32

Revision 29, 2.7 KB (checked in by andreu, 16 years ago)

sampling information in rrd filename - optional template first step

  • Property svn:eol-style set to native
Line 
1/*
2 * File: renetcolAgg.h
3 *
4 * Authors: ANDREU Francois-Xavier
5 *
6 * Copyright (C) 2005 2006 2007 GIP RENATER
7 */
8
9/*  This file is part of renetcol.
10 *
11 *  renetcol is free software; you can redistribute it and/or modify
12 *  it under the terms of the GNU General Public License as published by
13 *  the Free Software Foundation; either version 2 of the License, or
14 *  (at your option) any later version.
15 *
16 *  renetcol is distributed in the hope that it will be useful,
17 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
18 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 *  GNU General Public License for more details.
20 *
21 *  You should have received a copy of the GNU General Public License
22 *  along with renetcol; if not, write to the Free Software
23 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
24 */
25
26#define _GNU_SOURCE
27
28#include <unistd.h>
29#include <stdio.h>
30#include <string.h>
31#include <stdlib.h>
32#include <syslog.h>
33#include <sys/types.h>
34#include <time.h>
35#include <errno.h>
36#include <sys/ipc.h>
37#include <sys/shm.h>
38#include <sys/sem.h>
39
40#include "rrd.h"
41#include "rrdwrap.h"
42#include "dataFlowSet.h"
43
44#define RRD_LOCATION "/home/maintenance/RRD/"
45#define RRD_EXTENSION ".rrd"
46
47#define RRD_PARAM_0 "rrdcreate"
48#define RRD_PARAM_1 "--start"
49#define RRD_PARAM_2 "1106560200"
50#define RRD_PARAM_3 "--step"
51#define RRD_PARAM_4 "300"
52#define RRD_PARAM_5 "DS:inFlows:GAUGE:600:U:U"
53#define RRD_PARAM_6 "DS:outFlows:GAUGE:600:U:U"
54#define RRD_PARAM_7 "DS:inBytes:GAUGE:600:U:U"
55#define RRD_PARAM_8 "DS:outBytes:GAUGE:600:U:U"
56#define RRD_PARAM_9 "DS:inPkts:GAUGE:600:U:U"
57#define RRD_PARAM_10 "DS:outPkts:GAUGE:600:U:U"
58#define RRD_PARAM_11 "DS:inFirstCoS:GAUGE:600:U:U"
59#define RRD_PARAM_12 "DS:outFirstCoS:GAUGE:600:U:U"
60#define RRD_PARAM_13 "DS:inSecondCoS:GAUGE:600:U:U"
61#define RRD_PARAM_14 "DS:outSecondCoS:GAUGE:600:U:U"
62#define RRD_PARAM_15 "DS:inThirdCoS:GAUGE:600:U:U"
63#define RRD_PARAM_16 "DS:outThirdCoS:GAUGE:600:U:U"
64#define RRD_PARAM_17 "DS:inFourthCoS:GAUGE:600:U:U"
65#define RRD_PARAM_18 "DS:outFourthCoS:GAUGE:600:U:U"
66#define RRD_PARAM_19 "RRA:AVERAGE:0.5:1:2100"
67#define RRD_PARAM_20 "RRA:AVERAGE:0.5:24:1550"
68#define RRD_PARAM_21 "RRA:AVERAGE:0.5:288:1594"
69#define RRD_PARAM_22 "RRA:AVERAGE:0.5:2016:1040"
70#define RRD_PARAM_23 "RRA:MAX:0.5:1:2100"
71#define RRD_PARAM_24 "RRA:MAX:0.5:24:1550"
72#define RRD_PARAM_25 "RRA:MAX:0.5:288:1594"
73
74#define RRD_UPDATE_0 "rrdupdate"
75
76#define SHMSIZE 33554432 /* FIXME get from another file ? */
77
78struct SHMForAgg {
79  unsigned short currentTable;
80  unsigned short secondTable;
81  unsigned short readed;
82  unsigned short v4PrefixNb;
83  struct PrefixV4 prefixV4Tab[2][MAX_IPV4_PREFIX];
84  /*  struct PrefixV6 ; */
85};
Note: See TracBrowser for help on using the browser.