Initial import from FreeBSD RELENG_4:
[dragonfly.git] / share / examples / isdn / contrib / mrtg-isp0.sh
1 #!/bin/sh
2 #---------------------------------------------------------------------------
3 #
4 #       collect callout and callback statistics for the isp0 i/f
5 #
6 #       enable budget callout and callback restrictions and file
7 #       rotation in the isdnd.rc file.
8 #
9 #       last edit-date: [Fri May 25 15:22:45 2001]
10 #
11 # $FreeBSD: src/share/examples/isdn/contrib/mrtg-isp0.sh,v 1.1.2.1 2001/08/10 14:59:48 obrien Exp $
12 #
13 #---------------------------------------------------------------------------
14 #
15 #---------------------------------------------------------------------------
16 # this is the entry for mrtg in mrtg.cfg
17 #---------------------------------------------------------------------------
18 # Target[ernie.cstat.isp0]: `/usr/local/etc/mrtg/util/mrtg-isp0.sh`
19 # MaxBytes[ernie.cstat.isp0]: 10
20 # AbsMax[ernie.cstat.isp0]: 200
21 # Title[ernie.cstat.isp0]: isp0: callouts / callbacks
22 # PageTop[ernie.cstat.isp0]: <H1> isp0: callouts /callbacks </H1>
23 # Options[ernie.cstat.isp0]: gauge, nopercent, integer
24 # YLegend[ernie.cstat.isp0]: co / cb
25 # ShortLegend[ernie.cstat.isp0]: n
26 # Legend1[ernie.cstat.isp0]: callouts
27 # Legend2[ernie.cstat.isp0]: callbacks
28 # LegendI[ernie.cstat.isp0]: callouts:
29 # LegendO[ernie.cstat.isp0]: callbacks:
30 # WithPeak[ernie.cstat.isp0]: ymwd
31 #
32 #---------------------------------------------------------------------------
33 #       this is the shell script run by mrtg
34 #---------------------------------------------------------------------------
35 if [ -r /var/log/isdn/callouts.isp0 ]
36 then
37         cat /var/log/isdn/callouts.isp0 | awk '{print $3}'
38 else
39         echo 0
40 fi
41
42 if [ -r /var/log/isdn/callbacks.isp0 ]
43 then
44         cat /var/log/isdn/callbacks.isp0 | awk '{print $3}'
45 else
46         echo 0
47 fi
48
49 uptime | cut -c 12-18
50 uname -nsr
51
52 exit 0
53