|
|
@ -26,6 +26,8 @@ EXTENSION = .$(shell echo $(FORMAT) |tr '[:upper:]' '[:lower:]') |
|
|
|
|
|
|
|
DAY_IN_SECS = 86400 |
|
|
|
|
|
|
|
BUILD_DIR = web |
|
|
|
|
|
|
|
all: |
|
|
|
|
|
|
|
cpu.rrd: |
|
|
@ -92,7 +94,7 @@ update: update_cpu update_load update_mem update_net |
|
|
|
run: |
|
|
|
while true; do make update; sleep $(STEP); done |
|
|
|
|
|
|
|
cpu-daily$(EXTENSION): cpu.rrd |
|
|
|
$(BUILD_DIR)/cpu-daily$(EXTENSION): cpu.rrd |
|
|
|
rrdtool graph $@ --imgformat $(FORMAT) --end now --start end-$(DAY_IN_SECS) \
|
|
|
|
DEF:user=$<:user:AVERAGE \
|
|
|
|
DEF:nice=$<:nice:AVERAGE \
|
|
|
@ -115,7 +117,7 @@ cpu-daily$(EXTENSION): cpu.rrd |
|
|
|
AREA:gnice#$(DANGER9):gnice:STACK \
|
|
|
|
AREA:idle#$(SUCCESS):idle:STACK |
|
|
|
|
|
|
|
load-daily$(EXTENSION): load.rrd |
|
|
|
$(BUILD_DIR)/load-daily$(EXTENSION): load.rrd |
|
|
|
rrdtool graph $@ --imgformat $(FORMAT) --end now --start end-$(DAY_IN_SECS) \
|
|
|
|
DEF:ldavg-1=$<:ldavg-1:AVERAGE \
|
|
|
|
DEF:ldavg-5=$<:ldavg-5:AVERAGE \
|
|
|
@ -124,7 +126,7 @@ load-daily$(EXTENSION): load.rrd |
|
|
|
LINE1:ldavg-5#$(INFO2):ldavg-5 \
|
|
|
|
LINE1:ldavg-15#$(INFO3):ldavg-15 |
|
|
|
|
|
|
|
mem-daily$(EXTENSION): mem.rrd |
|
|
|
$(BUILD_DIR)/mem-daily$(EXTENSION): mem.rrd |
|
|
|
rrdtool graph $@ --imgformat $(FORMAT) --end now --start end-$(DAY_IN_SECS) \
|
|
|
|
DEF:kbmemfree=$<:kbmemfree:AVERAGE \
|
|
|
|
DEF:kbbuffers=$<:kbbuffers:AVERAGE \
|
|
|
@ -136,7 +138,7 @@ mem-daily$(EXTENSION): mem.rrd |
|
|
|
AREA:kbbuffers#$(DANGER4):kbbuffers:STACK \
|
|
|
|
AREA:kbmemfree#$(SUCCESS):kbmemfree:STACK |
|
|
|
|
|
|
|
net-daily$(EXTENSION): net.rrd |
|
|
|
$(BUILD_DIR)/net-daily$(EXTENSION): net.rrd |
|
|
|
rrdtool graph $@ --imgformat $(FORMAT) --end now --start end-$(DAY_IN_SECS) \
|
|
|
|
DEF:rbytes=$<:rbytes:AVERAGE \
|
|
|
|
DEF:tbytes=$<:tbytes:AVERAGE \
|
|
|
@ -144,4 +146,4 @@ net-daily$(EXTENSION): net.rrd |
|
|
|
AREA:rbytes#$(DANGER):rbytes \
|
|
|
|
AREA:ntbytes#$(SUCCESS):tbytes |
|
|
|
|
|
|
|
graph: cpu-daily$(EXTENSION) load-daily$(EXTENSION) mem-daily$(EXTENSION) net-daily$(EXTENSION) |
|
|
|
graph: $(BUILD_DIR)/cpu-daily$(EXTENSION) $(BUILD_DIR)/load-daily$(EXTENSION) $(BUILD_DIR)/mem-daily$(EXTENSION) $(BUILD_DIR)/net-daily$(EXTENSION) |