|
|
@ -25,7 +25,9 @@ FS ?= / |
|
|
|
FORMAT = SVG |
|
|
|
EXTENSION = .$(shell echo $(FORMAT) |tr '[:upper:]' '[:lower:]') |
|
|
|
|
|
|
|
DAY_IN_SECS = 86400 |
|
|
|
DAY_IN_SECS = 86400 |
|
|
|
WEEK_IN_SECS = 604800 |
|
|
|
MONTH_IN_SECS = 2678400 |
|
|
|
|
|
|
|
BUILD_DIR = web |
|
|
|
|
|
|
@ -160,7 +162,43 @@ $(BUILD_DIR)/mem-daily$(EXTENSION): mem.rrd |
|
|
|
|
|
|
|
$(BUILD_DIR)/net-daily$(EXTENSION): net.rrd |
|
|
|
rrdtool graph $@ --imgformat $(FORMAT) --end now --start end-$(DAY_IN_SECS) \
|
|
|
|
--title "Réseau" \
|
|
|
|
--title "Réseau (jour)" \
|
|
|
|
DEF:rbytes=$<:rbytes:AVERAGE \
|
|
|
|
CDEF:rbytesps=rbytes,60,/ \
|
|
|
|
VDEF:rbytespsmax=rbytesps,MAXIMUM \
|
|
|
|
DEF:tbytes=$<:tbytes:AVERAGE \
|
|
|
|
CDEF:tbytesps=tbytes,60,/ \
|
|
|
|
VDEF:tbytespsmax=tbytesps,MAXIMUM \
|
|
|
|
CDEF:ntbytes=tbytes,-1,* \
|
|
|
|
HRULE:0#$(INFO) \
|
|
|
|
AREA:rbytes#$(DANGER):"reçu" \
|
|
|
|
COMMENT:"maximum " \
|
|
|
|
GPRINT:rbytespsmax:"%6.2lf %So/s" \
|
|
|
|
AREA:ntbytes#$(SUCCESS):"envoyé" \
|
|
|
|
COMMENT:"maximum " \
|
|
|
|
GPRINT:tbytespsmax:"%6.2lf %So/s" |
|
|
|
|
|
|
|
$(BUILD_DIR)/net-weekly$(EXTENSION): net.rrd |
|
|
|
rrdtool graph $@ --imgformat $(FORMAT) --end now --start end-$(WEEK_IN_SECS) \
|
|
|
|
--title "Réseau (semaine)" \
|
|
|
|
DEF:rbytes=$<:rbytes:AVERAGE \
|
|
|
|
CDEF:rbytesps=rbytes,60,/ \
|
|
|
|
VDEF:rbytespsmax=rbytesps,MAXIMUM \
|
|
|
|
DEF:tbytes=$<:tbytes:AVERAGE \
|
|
|
|
CDEF:tbytesps=tbytes,60,/ \
|
|
|
|
VDEF:tbytespsmax=tbytesps,MAXIMUM \
|
|
|
|
CDEF:ntbytes=tbytes,-1,* \
|
|
|
|
HRULE:0#$(INFO) \
|
|
|
|
AREA:rbytes#$(DANGER):"reçu" \
|
|
|
|
COMMENT:"maximum " \
|
|
|
|
GPRINT:rbytespsmax:"%6.2lf %So/s" \
|
|
|
|
AREA:ntbytes#$(SUCCESS):"envoyé" \
|
|
|
|
COMMENT:"maximum " \
|
|
|
|
GPRINT:tbytespsmax:"%6.2lf %So/s" |
|
|
|
|
|
|
|
$(BUILD_DIR)/net-monthly$(EXTENSION): net.rrd |
|
|
|
rrdtool graph $@ --imgformat $(FORMAT) --end now --start end-$(MONTH_IN_SECS) \
|
|
|
|
--title "Réseau (mois)" \
|
|
|
|
DEF:rbytes=$<:rbytes:AVERAGE \
|
|
|
|
CDEF:rbytesps=rbytes,60,/ \
|
|
|
|
VDEF:rbytespsmax=rbytesps,MAXIMUM \
|
|
|
@ -178,19 +216,53 @@ $(BUILD_DIR)/net-daily$(EXTENSION): net.rrd |
|
|
|
|
|
|
|
$(BUILD_DIR)/disk-daily$(EXTENSION): disk.rrd |
|
|
|
rrdtool graph $@ --imgformat $(FORMAT) --end now --start end-$(DAY_IN_SECS) \
|
|
|
|
--title "Disque" \
|
|
|
|
--title "Disque (jour)" \
|
|
|
|
--lower-limit 0 \
|
|
|
|
DEF:mbfsfree=$<:mbfsfree:AVERAGE \
|
|
|
|
CDEF:bfsfree=mbfsfree,1024,*,1024,* \
|
|
|
|
VDEF:avgbfsfree=bfsfree,AVERAGE \
|
|
|
|
DEF:mbfsused=$<:mbfsused:AVERAGE \
|
|
|
|
CDEF:bfsused=mbfsused,1024,*,1024,* \
|
|
|
|
CDEF:pfsused1=bfsused,100,*,bfsused,bfsfree,+,/ \
|
|
|
|
VDEF:pfsused2=pfsused1,AVERAGE \
|
|
|
|
AREA:bfsused#$(DANGER):"utilisé":STACK \
|
|
|
|
GPRINT:pfsused2:"%3.2lf %%" \
|
|
|
|
AREA:bfsfree#$(SUCCESS):"libre":STACK \
|
|
|
|
GPRINT:pfsused2:"%4.0lf %So" |
|
|
|
|
|
|
|
$(BUILD_DIR)/disk-weekly$(EXTENSION): disk.rrd |
|
|
|
rrdtool graph $@ --imgformat $(FORMAT) --end now --start end-$(WEEK_IN_SECS) \
|
|
|
|
--title "Disque (semaine)" \
|
|
|
|
--lower-limit 0 \
|
|
|
|
DEF:mbfsfree=$<:mbfsfree:AVERAGE \
|
|
|
|
CDEF:bfsfree=mbfsfree,1024,*,1024,* \
|
|
|
|
VDEF:avgbfsfree=bfsfree,AVERAGE \
|
|
|
|
DEF:mbfsused=$<:mbfsused:AVERAGE \
|
|
|
|
CDEF:bfsused=mbfsused,1024,*,1024,* \
|
|
|
|
CDEF:pfsused1=bfsused,100,*,bfsused,bfsfree,+,/ \
|
|
|
|
VDEF:pfsused2=pfsused1,AVERAGE \
|
|
|
|
AREA:bfsused#$(DANGER):"utilisé":STACK \
|
|
|
|
GPRINT:pfsused2:"%3.2lf %%" \
|
|
|
|
AREA:bfsfree#$(SUCCESS):"libre":STACK \
|
|
|
|
GPRINT:pfsused2:"%4.0lf %So" |
|
|
|
|
|
|
|
$(BUILD_DIR)/disk-monthly$(EXTENSION): disk.rrd |
|
|
|
rrdtool graph $@ --imgformat $(FORMAT) --end now --start end-$(MONTH_IN_SECS) \
|
|
|
|
--title "Disque (mois)" \
|
|
|
|
--lower-limit 0 \
|
|
|
|
DEF:mbfsfree=$<:mbfsfree:AVERAGE \
|
|
|
|
CDEF:bfsfree=mbfsfree,1024,*,1024,* \
|
|
|
|
VDEF:avgbfsfree=bfsfree,AVERAGE \
|
|
|
|
DEF:mbfsused=$<:mbfsused:AVERAGE \
|
|
|
|
CDEF:bfsused=mbfsused,1024,*,1024,* \
|
|
|
|
CDEF:pfsused1=bfsused,100,*,bfsused,bfsfree,+,/ \
|
|
|
|
VDEF:pfsused2=pfsused1,AVERAGE \
|
|
|
|
AREA:bfsused#$(DANGER):"utilisé":STACK \
|
|
|
|
GPRINT:pfsused2:"%3.2lf %%" \
|
|
|
|
AREA:bfsfree#$(SUCCESS):"libre":STACK |
|
|
|
AREA:bfsfree#$(SUCCESS):"libre":STACK \
|
|
|
|
GPRINT:pfsused2:"%4.0lf %So" |
|
|
|
|
|
|
|
$(BUILD_DIR)/%.html: %.php |
|
|
|
php $< >$@ |
|
|
|
|
|
|
|
graph: $(BUILD_DIR)/cpu-daily$(EXTENSION) $(BUILD_DIR)/load-daily$(EXTENSION) $(BUILD_DIR)/mem-daily$(EXTENSION) $(BUILD_DIR)/net-daily$(EXTENSION) $(BUILD_DIR)/disk-daily$(EXTENSION) $(BUILD_DIR)/index.html |
|
|
|
graph: $(BUILD_DIR)/cpu-daily$(EXTENSION) $(BUILD_DIR)/load-daily$(EXTENSION) $(BUILD_DIR)/mem-daily$(EXTENSION) $(BUILD_DIR)/net-daily$(EXTENSION) $(BUILD_DIR)/net-weekly$(EXTENSION) $(BUILD_DIR)/net-monthly$(EXTENSION) $(BUILD_DIR)/disk-daily$(EXTENSION) $(BUILD_DIR)/disk-weekly$(EXTENSION) $(BUILD_DIR)/disk-monthly$(EXTENSION) $(BUILD_DIR)/index.html |