Browse Source

ajoute le graph des disques

master
vince vince 3 years ago
parent
commit
300a910676
1 changed files with 21 additions and 2 deletions
  1. +21
    -2
      Makefile

+ 21
- 2
Makefile View File

@ -89,7 +89,19 @@ net.rrd:
update_net: net.rrd
rrdtool update $< $(NOW):$(shell cat /proc/net/dev |grep $(IFACE) |awk '{print $$2,$$10}' |tr ' ' ':' )
update: update_cpu update_load update_mem update_net
disk.rrd:
rrdtool create $@ --start $$(( $(NOW) - 1 )) --step $(STEP) --no-overwrite \
DS:MBfsfree:COUNTER:120:0:U \
DS:MBfsused:COUNTER:120:0:U \
RRA:LAST:0.5:1:1440 \
RRA:AVERAGE:0.5:420:1440 \
RRA:AVERAGE:0.5:1860:1440 \
RRA:AVERAGE:0.5:21900:1440
update_disk: disk.rrd
rrdtool update $< $(NOW):$(shell sar -F MOUNT --fs=/ 0 -1 |tail -n 1 |awk '{print $$2,$$3}' |tr ' ' ':' )
update: update_cpu update_load update_mem update_net update_disk
run:
while true; do make update; sleep $(STEP); done
@ -146,4 +158,11 @@ $(BUILD_DIR)/net-daily$(EXTENSION): net.rrd
AREA:rbytes#$(DANGER):rbytes \
AREA:ntbytes#$(SUCCESS):tbytes
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): disk.rrd
rrdtool graph $@ --imgformat $(FORMAT) --end now --start end-$(DAY_IN_SECS) \
DEF:MBfsfree=$<:MBfsfree:AVERAGE \
DEF:MBfsused=$<:MBfsused:AVERAGE \
AREA:MBfsused#$(DANGER):MBfsused:STACK \
AREA:MBfsfree#$(SUCCESS):MBfsfree:STACK
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)

Loading…
Cancel
Save