]> git.sven.stormbind.net Git - sven/scripts.git/commitdiff
Import Alix mrtg scripts
authorSven Hoexter <sven@stormbind.net>
Mon, 17 Jan 2011 16:45:16 +0000 (17:45 +0100)
committerSven Hoexter <sven@stormbind.net>
Mon, 17 Jan 2011 16:45:16 +0000 (17:45 +0100)
mrtg-alix/mrtg-scripts/explore_cpu [new file with mode: 0755]
mrtg-alix/mrtg-scripts/explore_load [new file with mode: 0755]
mrtg-alix/mrtg-scripts/explore_net [new file with mode: 0755]
mrtg-alix/mrtg-scripts/explore_temp [new file with mode: 0755]
mrtg-alix/mrtg-scripts/mrtg.cfg [new file with mode: 0644]

diff --git a/mrtg-alix/mrtg-scripts/explore_cpu b/mrtg-alix/mrtg-scripts/explore_cpu
new file mode 100755 (executable)
index 0000000..a4119fb
--- /dev/null
@@ -0,0 +1,7 @@
+#! /bin/sh
+
+PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
+
+head -1 /proc/stat |awk '{print $4"\n" $2+$3+$4}'
+echo ""
+hostname -s
diff --git a/mrtg-alix/mrtg-scripts/explore_load b/mrtg-alix/mrtg-scripts/explore_load
new file mode 100755 (executable)
index 0000000..fc485fa
--- /dev/null
@@ -0,0 +1,17 @@
+#!/usr/bin/perl -w
+
+$_ = <>;
+my ($l, $p) = ($_ =~ /^\s*[\d.]+\s+([\d.]+)\s+[\d.]+\s+\d+\/(\d+)/);
+$l = int($l*100);
+
+my $h = `hostname`;
+chomp $h;
+print <<EOF;
+$l
+$p
+
+$h
+EOF
+
+1;
+
diff --git a/mrtg-alix/mrtg-scripts/explore_net b/mrtg-alix/mrtg-scripts/explore_net
new file mode 100755 (executable)
index 0000000..f9f51af
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
+
+DEV="$1"
+if test -z "$DEV"; then echo No device specified; exit 1; fi
+
+INFO=`grep $DEV /proc/net/dev | tr -s ' ' ' ' | cut -d: -f2`
+RECEIVE=`echo $INFO | cut -d" " -f1`
+TRANSMIT=`echo $INFO | cut -d" " -f9`
+
+echo $RECEIVE
+echo $TRANSMIT
+echo ""
+hostname -s
diff --git a/mrtg-alix/mrtg-scripts/explore_temp b/mrtg-alix/mrtg-scripts/explore_temp
new file mode 100755 (executable)
index 0000000..9c34f63
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
+
+sensors -A|grep 'CPU Temp'|cut -c 13-16
+sensors -A|grep 'M\/B Temp'|cut -c 15-16
+echo ""
+hostname -s
diff --git a/mrtg-alix/mrtg-scripts/mrtg.cfg b/mrtg-alix/mrtg-scripts/mrtg.cfg
new file mode 100644 (file)
index 0000000..30e6329
--- /dev/null
@@ -0,0 +1,89 @@
+######################################################################
+# Multi Router Traffic Grapher -- Sample Configuration File
+######################################################################
+# This file is for use with mrtg-2.5.4c
+
+# Global configuration
+WorkDir: /var/www/mrtg
+WriteExpires: Yes
+LogFormat: rrdtool
+IconDir: /mrtg/
+
+Title[^]: Analysis for arthur&nbsp;
+
+# Nr of procs and load
+Target[load]: `/usr/local/sbin/explore_load /proc/loadavg`
+MaxBytes[load]: 1500
+Title[load]: - Load and # of processes
+PageTop[load]: <H1>Load average and # of procs</H1>
+Options[load]: nopercent,growright,gauge
+ShortLegend[load]: &nbsp;
+YLegend[load]: procs, load*100
+Legend1[load]: Five-minutes load average * 100
+Legend2[load]: Number of processes
+LegendI[load]: &nbsp;load*100
+LegendO[load]: &nbsp;procs
+#WithPeak[load]: wym
+Colours[load]: ORANGE#ffa000, RED#f00000, BLACK#000000, VIOLET#ff00ff
+
+
+# System and non-idle time
+Target[cpu]: `/usr/local/sbin/explore_cpu`
+MaxBytes[cpu]: 200
+Title[cpu]: - System and Non-Idle CPU Time
+PageTop[cpu]: <H1>System CPU time and Non-Idle CPU Time</H1>
+Options[cpu]: growright,nopercent
+ShortLegend[cpu]: &nbsp;%
+YLegend[cpu]: % of one CPU
+Legend1[cpu]: System CPU Time
+Legend2[cpu]: Non-Idle CPU Time
+LegendI[cpu]: &nbsp;system
+LegendO[cpu]: &nbsp;nonidle
+#WithPeak[cpu]: wym
+Colours[cpu]: ORANGE#ffa000, RED#f00000, BLACK#000000, VIOLET#ff00ff
+
+# CPU und MB tempreture
+Target[temp]: `/usr/local/sbin/explore_temp`
+MaxBytes[temp]: 100
+Title[temp]: - Temp CPU and MB
+PageTop[temp]: <H1>Temp CPU and MB</H1>
+Options[temp]: nopercent,growright,gauge
+ShortLegend[temp]: &nbsp;
+YLegend[temp]: CPU, MB
+#Legend1[temp]: Five-minutes temp
+#Legend2[temp]: Number of processes
+LegendI[temp]: &nbsp;CPU
+LegendO[temp]: &nbsp;MB
+#WithPeak[temp]: wym
+Colours[temp]: ORANGE#ffa000, RED#f00000, BLACK#000000, VIOLET#ff00ff
+
+
+#### Network interfaces ###
+
+Target[ppp0]: `/usr/local/sbin/explore_net ppp0`
+MaxBytes1[ppp0]: 204800
+MaxBytes2[ppp0]: 204800
+Title[ppp0]: Traffic device ppp0 [DSL]
+PageTop[ppp0]: Internet Link
+#WithPeak[ppp0]: wym
+
+Target[eth0]: `/usr/local/sbin/explore_net eth0`
+MaxBytes1[eth0]: 12500000
+MaxBytes2[eth0]: 12500000
+Title[eth0]: Traffic device eth0 [LAN]
+PageTop[eth0]: LAN
+#WithPeak[eth0]: wym
+
+Target[eth2]: `/usr/local/sbin/explore_net eth2`
+MaxBytes1[eth2]: 12500000
+MaxBytes2[eth2]: 12500000
+Title[eth2]: Traffic device eth2 [WLAN]
+PageTop[eth2]: WLAN
+#WithPeak[eth2]: wym
+
+Target[tun0]: `/usr/local/sbin/explore_net tun0`
+MaxBytes1[tun0]: 12500000
+MaxBytes2[tun0]: 12500000
+Title[tun0]: Traffic device tun0 [VPN]
+PageTop[tun0]: OpenVPN
+#WithPeak[tun0]: wym
\ No newline at end of file