Sondes RRD
rrdtool create cpu.rrd --step 300 \
DS:user:GAUGE:600:0:U \
DS:nice:GAUGE:600:0:U \
DS:system:GAUGE:600:0:U \
DS:iowait:GAUGE:600:0:U \
DS:irq:GAUGE:600:0:U \
DS:softirq:GAUGE:600:0:U \
RRA:AVERAGE:0.5:1:106560 \
RRA:AVERAGE:0.5:72:2960 \
RRA:AVERAGE:0.5:288:1850 \
RRA:MIN:0.5:72:2960 \
RRA:MIN:0.5:288:1850 \
RRA:MAX:0.5:72:2960 \
RRA:MAX:0.5:288:1850
Exemple d'utilisation :eval `/root/bin/rrd-cpu.pl`
rrdtool update $RRDDIR/cpu.rrd N:$USER:$NICE:$SYSTEM:$IOWAIT:$IRQ:$SOFTIRQ
rrdtool update $RRDDIR/loadavg.rrd N:$LOADAVG
Exemple de configuration pour MyRRD :"cpu" => array ( "Label" => "CPU", "Title" => "CPU", "Caption" => "", "Graph" => array ( "VLabel" => "%", "HLabel" => "", "Prefix" => "cpuP3R", "Data" => array ( array ( "DSName" => "softirq", "Stack" => true, "RRDFile" => "$dir/cpu.rrd", "Label" => "SoftIRQ ", "Color" => "#00DDCC", "Type" => "AREA" ), array ( "DSName" => "irq", "Stack" => true, "RRDFile" => "$dir/cpu.rrd", "Label" => "IRQ ", "Color" => "#FF9966", "Type" => "AREA" ), array ( "DSName" => "iowait", "Stack" => true, "RRDFile" => "$dir/cpu.rrd", "Label" => "Iowait ", "Color" => "#FFEE00", "Type" => "AREA" ), array ( "DSName" => "system", "Stack" => true, "RRDFile" => "$dir/cpu.rrd", "Label" => "System ", "Color" => "#FF3311", "Type" => "AREA" ), array ( "DSName" => "user", "Stack" => true, "RRDFile" => "$dir/cpu.rrd", "Label" => "User ", "Color" => "#22FF33", "Type" => "AREA" ), array ( "DSName" => "nice", "Stack" => true, "RRDFile" => "$dir/cpu.rrd", "Label" => "Nice ", "Color" => "#DD33FF", "Type" => "AREA" ), array ( "DSName" => "loadavg", "Compute" => "100,*", "RRDFile" => "$dir/loadavg.rrd", "Label" => "LoadAVG ", "Color" => "#220099", "Type" => "LINE1" ) ) ) ),
rrdtool create ram.rrd --step 300 \
DS:used:GAUGE:600:0:100 \
DS:buffer:GAUGE:600:0:100 \
DS:swap:GAUGE:600:0:100 \
RRA:AVERAGE:0.5:1:106560 \
RRA:AVERAGE:0.5:72:2960 \
RRA:AVERAGE:0.5:288:1850 \
RRA:MIN:0.5:72:2960 \
RRA:MIN:0.5:288:1850 \
RRA:MAX:0.5:72:2960 \
RRA:MAX:0.5:288:1850
Exemple d'utilisation :eval `/root/bin/rrd-ram.pl`
rrdtool update $RRDDIR/ram.rrd N:$RAM_USED:$BUFFER:$SWAP_USED
Exemple de configuration pour MyRRD :"ram" => array ( "Label" => "Mémoires", "Title" => "Mémoires", "Caption" => "", "Graph" => array ( "VLabel" => "%", "HLabel" => "", "Prefix" => "ram", "LowerLimit" => 0, "UpperLimit" => 100, "Data" => array ( array ( "DSName" => "used", "Stack" => true, "RRDFile" => "$dir/ram.rrd", "Label" => "Used ", "Color" => "#FFEE00", "Type" => "AREA" ), array ( "DSName" => "buffer", "Stack" => true, "RRDFile" => "$dir/ram.rrd", "Label" => "Buffered", "Color" => "#00DDCC", "Type" => "AREA" ), array ( "DSName" => "swap", "RRDFile" => "$dir/ram.rrd", "Label" => "Swap ", "Color" => "#FF3311", "Type" => "LINE2" ) ) ) ),
rrdtool create netstat-tcp.rrd --step 300 \
DS:CLOSE:GAUGE:600:0:U \
DS:CLOSE_WAIT:GAUGE:600:0:U \
DS:ESTABLISHED:GAUGE:600:0:U \
DS:FIN_WAIT:GAUGE:600:0:U \
DS:LAST_ACK:GAUGE:600:0:U \
DS:SYN_RECV:GAUGE:600:0:U \
DS:SYN_SENT:GAUGE:600:0:U \
DS:TIME_WAIT:GAUGE:600:0:U \
RRA:AVERAGE:0.5:1:106560 \
RRA:AVERAGE:0.5:72:2960 \
RRA:AVERAGE:0.5:288:1850 \
RRA:MIN:0.5:72:2960 \
RRA:MIN:0.5:288:1850 \
RRA:MAX:0.5:72:2960 \
RRA:MAX:0.5:288:1850
rrdtool create netstat-udp.rrd --step 300 \
DS:ASSURED:GAUGE:600:0:U \
DS:UNREPLIED:GAUGE:600:0:U \
RRA:AVERAGE:0.5:1:106560 \
RRA:AVERAGE:0.5:72:2960 \
RRA:AVERAGE:0.5:288:1850 \
RRA:MIN:0.5:72:2960 \
RRA:MIN:0.5:288:1850 \
RRA:MAX:0.5:72:2960 \
RRA:MAX:0.5:288:1850
Exemple d'utilisation :eval `/root/bin/rrd-netstat.pl`
rrdtool update $RRDDIR/netstat-tcp.rrd N:$CLOSE:$CLOSE_WAIT:$ESTABLISHED:$FIN_WAIT:$LAST_ACK:$SYN_RECV:$SYN_SENT:$TIME_WAIT
rrdtool update $RRDDIR/netstat-udp.rrd N:$ASSURED:$UNREPLIED
Exemple de configuration pour MyRRD :"netstat" => array ( "Label" => "Netstat", "Title" => "Netstat", "Caption" => "", "Graph" => array ( "VLabel" => "Cnx", "HLabel" => "", "Prefix" => "netstat", "Data" => array ( array ( "DSName" => "CLOSE", "RRDFile" => "$dir/netstat-tcp.rrd", "Label" => "CLOSE ", "Color" => "#EEAF00", "Type" => "LINE1" ), array ( "DSName" => "CLOSE_WAIT", "RRDFile" => "$dir/netstat-tcp.rrd", "Label" => "CLOSE_WAIT ", "Color" => "#EE0000", "Type" => "LINE1" ), array ( "DSName" => "ESTABLISHED", "RRDFile" => "$dir/netstat-tcp.rrd", "Label" => "ESTABLISHED", "Color" => "#00DD22", "Type" => "LINE1" ), array ( "DSName" => "FIN_WAIT", "RRDFile" => "$dir/netstat-tcp.rrd", "Label" => "FIN_WAIT ", "Color" => "#EE20FF", "Type" => "LINE1" ), array ( "DSName" => "LAST_ACK", "RRDFile" => "$dir/netstat-tcp.rrd", "Label" => "LAST_ACK ", "Color" => "#009977", "Type" => "LINE1" ), array ( "DSName" => "SYN_RECV", "RRDFile" => "$dir/netstat-tcp.rrd", "Label" => "SYN_RECV ", "Color" => "#FFAEB9", "Type" => "LINE1" ), array ( "DSName" => "SYN_SENT", "RRDFile" => "$dir/netstat-tcp.rrd", "Label" => "SYN_SENT ", "Color" => "#FF7F00", "Type" => "LINE1" ), array ( "DSName" => "TIME_WAIT", "RRDFile" => "$dir/netstat-tcp.rrd", "Label" => "TIME_WAIT ", "Color" => "#CDCD00", "Type" => "LINE1" ), array ( "DSName" => "ASSURED", "RRDFile" => "$dir/netstat-udp.rrd", "Label" => "ASSURED ", "Color" => "#698B22", "Type" => "LINE1" ), array ( "DSName" => "UNREPLIED", "RRDFile" => "$dir/netstat-udp.rrd", "Label" => "UNREPLIED ", "Color" => "#00E5EE", "Type" => "LINE1" ), ) ) ),
rrdtool create smart-sda.rrd --step 300 \
DS:ReallocatedSectorCt:GAUGE:600:0:U \
DS:SpinRetryCount:GAUGE:600:0:U \
DS:RawReadErrorRate:GAUGE:600:0:255 \
DS:SeekErrorRate:GAUGE:600:0:255 \
DS:TemperatureCelsius:GAUGE:600:0:100 \
RRA:AVERAGE:0.5:1:106560 \
RRA:AVERAGE:0.5:72:2960 \
RRA:AVERAGE:0.5:288:1850 \
RRA:MIN:0.5:72:2960 \
RRA:MIN:0.5:288:1850 \
RRA:MAX:0.5:72:2960 \
RRA:MAX:0.5:288:1850
Exemple d'utilisation :REALLOCATED_SECTOR_CT="U"
SPIN_RETRY_COUNT="U"
RAW_READ_ERROR_RATE="U"
SEEK_ERROR_RATE="U"
TEMPERATURE_CELSIUS="U"
eval `ssh $HOST /root/bin/rrd-smart.pl /dev/sda`
rrdtool update $RRDDIR/smart-sda.rrd N:$REALLOCATED_SECTOR_CT:$SPIN_RETRY_COUNT:$RAW_READ_ERROR_RATE:$SEEK_ERROR_RATE:$TEMPERATURE_CELSIUS
Exemple de configuration pour MyRRD :"smart-sda" => array ( "Label" => "SMART sda", "Title" => "Indicateurs SMART", "Caption" => "", "Graph" => array ( "VLabel" => "Indicateur", "HLabel" => "", "Prefix" => "ssda", "Data" => array ( array ( "DSName" => "ReallocatedSectorCt", "RRDFile" => "$dir/smart-sda.rrd", "Label" => "ReallocatedSectorCt", "Color" => "#EEAF00", "Type" => "LINE2" ), array ( "DSName" => "SpinRetryCount", "RRDFile" => "$dir/smart-sda.rrd", "Label" => "SpinRetryCount ", "Color" => "#EE0000", "Type" => "LINE2" ), array ( "DSName" => "RawReadErrorRate", "RRDFile" => "$dir/smart-sda.rrd", "Label" => "RawReadErrorRate ", "Color" => "#00DD22", "Type" => "LINE1" ), array ( "DSName" => "SeekErrorRate", "RRDFile" => "$dir/smart-sda.rrd", "Label" => "SeekErrorRate ", "Color" => "#0022DD", "Type" => "LINE1" ) ) ) ),
rrdtool create cpuxen.rrd --step 300 \
DS:Dom0:GAUGE:600:0:400 \
DS:VM1:GAUGE:600:0:400 \
DS:VM2:GAUGE:600:0:400 \
DS:VM3:GAUGE:600:0:400 \
RRA:AVERAGE:0.5:1:106560 \
RRA:AVERAGE:0.5:72:2960 \
RRA:AVERAGE:0.5:288:1850 \
RRA:MIN:0.5:72:2960 \
RRA:MIN:0.5:288:1850 \
RRA:MAX:0.5:72:2960 \
RRA:MAX:0.5:288:1850
rrdtool create ramxen.rrd --step 300 \
DS:Dom0:GAUGE:600:0:U \
DS:VM1:GAUGE:600:0:U \
DS:VM2:GAUGE:600:0:U \
DS:VM3:GAUGE:600:0:U \
RRA:AVERAGE:0.5:1:106560 \
RRA:AVERAGE:0.5:72:2960 \
RRA:AVERAGE:0.5:288:1850 \
RRA:MIN:0.5:72:2960 \
RRA:MIN:0.5:288:1850 \
RRA:MAX:0.5:72:2960 \
RRA:MAX:0.5:288:1850
Exemple d'utilisation :nohup /usr/local/sbin/xenmonitor.py >/dev/null 2>/dev/null &
eval `nc localhost 9999`
rrdtool update $RRDDIR/cpuxen.rrd N:$CPU_Domain_0:$CPU_VM1:$CPU_VM2:$CPU_VM3
rrdtool update $RRDDIR/ramxen.rrd N:$RAM_Domain_0:$RAM_VM1:$RAM_VM2:$RAM_VM3
Exemple de configuration pour MyRRD :"cpuxen" => array ( "Label" => "Utilisation CPU", "Title" => "Utilisation CPU", "Caption" => "", "Graph" => array ( "VLabel" => "%", "HLabel" => "", "Prefix" => "cpuxen", "Data" => array ( array ( "DSName" => "Dom0", "Stack" => true, "RRDFile" => "$dir/cpuxen.rrd", "Label" => "Dom0", "Color" => "#EEAF00", "Type" => "AREA" ), array ( "DSName" => "VM1", "Stack" => true, "RRDFile" => "$dir/cpuxen.rrd", "Label" => "VM 1", "Color" => "#4477EE", "Type" => "AREA" ), array ( "DSName" => "VM2", "Stack" => true, "RRDFile" => "$dir/cpuxen.rrd", "Label" => "VM 2", "Color" => "#EE0000", "Type" => "AREA" ), array ( "DSName" => "VM3", "Stack" => true, "RRDFile" => "$dir/cpuxen.rrd", "Label" => "VM 3", "Color" => "#00DD22", "Type" => "AREA" ) ) ) ), "ramxen" => array ( "Label" => "Repartition RAM", "Title" => "Repartiton RAM", "Caption" => "", "Graph" => array ( "VLabel" => "Mo", "HLabel" => "", "Prefix" => "ramxen", "LowerLimit" => 0, "Data" => array ( array ( "DSName" => "Dom0", "Stack" => true, "RRDFile" => "$dir/ramxen.rrd", "Label" => "Dom0", "Color" => "#EEAF00", "Type" => "AREA" ), array ( "DSName" => "VM1", "Stack" => true, "RRDFile" => "$dir/ramxen.rrd", "Label" => "VM 1", "Color" => "#4477EE", "Type" => "AREA" ), array ( "DSName" => "VM2", "Stack" => true, "RRDFile" => "$dir/ramxen.rrd", "Label" => "VM 2", "Color" => "#EE0000", "Type" => "AREA" ), array ( "DSName" => "VM3", "Stack" => true, "RRDFile" => "$dir/ramxen.rrd", "Label" => "VM 3", "Color" => "#00DD22", "Type" => "AREA" ) ) ) ),
rrdtool create cpufreq.rrd --step 300 \
DS:cpu0:GAUGE:600:0:U \
DS:cpu1:GAUGE:600:0:U \
DS:cpu2:GAUGE:600:0:U \
DS:cpu3:GAUGE:600:0:U \
RRA:AVERAGE:0.5:1:106560 \
RRA:AVERAGE:0.5:72:2960 \
RRA:AVERAGE:0.5:288:1850 \
RRA:MIN:0.5:72:2960 \
RRA:MIN:0.5:288:1850 \
RRA:MAX:0.5:72:2960 \
RRA:MAX:0.5:288:1850
Exemple d'utilisation :eval `ssh $HOST /root/bin/rrd-xenpm.pl`
rrdtool update $RRDDIR/cpufreq.rrd N:$CPU0:$CPU1:$CPU2:$CPU3
Exemple de configuration pour MyRRD :"cpufreq" => array ( "Label" => "Fréquences CPU", "Title" => "Fréquences CPU", "Caption" => "", "Graph" => array ( "VLabel" => "Hz", "HLabel" => "", "Prefix" => "cpufreq", "Data" => array ( array ( "DSName" => "cpu0", "RRDFile" => "$dir/cpufreq.rrd", "Label" => "CPU 0", "Color" => "#EEAF00", "Type" => "LINE1" ), array ( "DSName" => "cpu1", "RRDFile" => "$dir/cpufreq.rrd", "Label" => "CPU 1", "Color" => "#EE0000", "Type" => "LINE1" ), array ( "DSName" => "cpu2", "RRDFile" => "$dir/cpufreq.rrd", "Label" => "CPU 2", "Color" => "#00DD22", "Type" => "LINE1" ), array ( "DSName" => "cpu3", "RRDFile" => "$dir/cpufreq.rrd", "Label" => "CPU 3", "Color" => "#00E5EE", "Type" => "LINE1" ) ) ) ),