Browse Source

améliore les choses

master
vince vince 3 years ago
parent
commit
81e8247296
1 changed files with 24 additions and 13 deletions
  1. +24
    -13
      Makefile

+ 24
- 13
Makefile View File

@ -20,6 +20,7 @@ INFO2 = 0DCAF0
INFO3 = 3DD5F3
IFACE ?= eth0
FS ?= /
FORMAT = SVG
EXTENSION = .$(shell echo $(FORMAT) |tr '[:upper:]' '[:lower:]')
@ -99,7 +100,7 @@ disk.rrd:
RRA:AVERAGE:0.5:21900:1440
update_disk: disk.rrd
rrdtool update $< $(NOW):$(shell LANG=C sar -F MOUNT --fs=/ 0 -1 |tail -n 1 |awk '{print $$2,$$3}' |tr ' ' ':' )
rrdtool update $< $(NOW):$(shell LANG=C sar -F MOUNT --fs=$(FS) 0 -1 |tail -n 1 |awk '{print $$2,$$3}' |tr ' ' ':' )
update: update_cpu update_load update_mem update_net update_disk
@ -132,43 +133,53 @@ $(BUILD_DIR)/cpu-daily$(EXTENSION): cpu.rrd
$(BUILD_DIR)/load-daily$(EXTENSION): load.rrd
rrdtool graph $@ --imgformat $(FORMAT) --end now --start end-$(DAY_IN_SECS) \
--title "Processeur" \
--title "Charge système" \
DEF:ldavg-1=$<:ldavg-1:AVERAGE \
DEF:ldavg-5=$<:ldavg-5:AVERAGE \
DEF:ldavg-15=$<:ldavg-15:AVERAGE \
LINE1:ldavg-1#$(INFO1):ldavg-1 \
LINE1:ldavg-5#$(INFO2):ldavg-5 \
LINE1:ldavg-15#$(INFO3):ldavg-15
LINE1:ldavg-1#$(INFO1):"sur 1 minute" \
LINE1:ldavg-5#$(INFO2):"sur 5 minutes" \
LINE1:ldavg-15#$(INFO3):"sur 15 minutes"
$(BUILD_DIR)/mem-daily$(EXTENSION): mem.rrd
rrdtool graph $@ --imgformat $(FORMAT) --end now --start end-$(DAY_IN_SECS) \
--title "Mémoire" \
DEF:kbmemfree=$<:kbmemfree:AVERAGE \
CDEF:memfree=kbmemfree,1024,* \
DEF:kbbuffers=$<:kbbuffers:AVERAGE \
CDEF:buffers=kbbuffers,1024,* \
DEF:kbcached=$<:kbcached:AVERAGE \
CDEF:cached=kbcached,1024,* \
DEF:kbslab=$<:kbslab:AVERAGE \
AREA:kbbuffers#$(DANGER1):kbbuffers:STACK \
AREA:kbcached#$(DANGER2):kbcached:STACK \
AREA:kbslab#$(DANGER3):kbslab:STACK \
AREA:kbmemfree#$(SUCCESS):kbmemfree:STACK
CDEF:slab=kbslab,1024,* \
AREA:buffers#$(DANGER1):"buffers":STACK \
AREA:cached#$(DANGER2):"cached":STACK \
AREA:slab#$(DANGER3):"slab":STACK \
AREA:memfree#$(SUCCESS):"libre":STACK
$(BUILD_DIR)/net-daily$(EXTENSION): net.rrd
rrdtool graph $@ --imgformat $(FORMAT) --end now --start end-$(DAY_IN_SECS) \
--title "Réseau" \
DEF:rbytes=$<:rbytes:AVERAGE \
VDEF:rbytesmax=rbytes,MAXIMUM \
DEF:tbytes=$<:tbytes:AVERAGE \
VDEF:tbytesmax=tbytes,MAXIMUM \
CDEF:ntbytes=tbytes,-1,* \
AREA:rbytes#$(DANGER):rbytes \
AREA:ntbytes#$(SUCCESS):tbytes
AREA:rbytes#$(DANGER):"reçu" \
GPRINT:rbytesmax:"%6.2lf %Sb" \
AREA:ntbytes#$(SUCCESS):"envoyé" \
GPRINT:tbytesmax:"%6.2lf %Sb"
$(BUILD_DIR)/disk-daily$(EXTENSION): disk.rrd
rrdtool graph $@ --imgformat $(FORMAT) --end now --start end-$(DAY_IN_SECS) \
--title "Disque" \
--lower-limit 0 \
DEF:mbfsfree=$<:mbfsfree:AVERAGE \
CDEF:bfsfree=mbfsfree,1024,*,1024,* \
DEF:mbfsused=$<:mbfsused:AVERAGE \
AREA:mbfsused#$(DANGER):mbfsused:STACK \
AREA:mbfsfree#$(SUCCESS):mbfsfree:STACK
CDEF:bfsused=mbfsused,1024,*,1024,* \
AREA:bfsused#$(DANGER):"utilisé":STACK \
AREA:bfsfree#$(SUCCESS):"libre":STACK
$(BUILD_DIR)/%.html: %.php
php $< >$@


Loading…
Cancel
Save