Ports -> pkgsrc
[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 # $DragonFly: src/share/examples/isdn/contrib/mrtg-isp0.sh,v 1.2 2003/06/17 04:36:57 dillon Exp $
13 #
14 #---------------------------------------------------------------------------
15 #
16 #---------------------------------------------------------------------------
17 # this is the entry for mrtg in mrtg.cfg
18 #---------------------------------------------------------------------------
19 # Target[ernie.cstat.isp0]: `/usr/local/etc/mrtg/util/mrtg-isp0.sh`
20 # MaxBytes[ernie.cstat.isp0]: 10
21 # AbsMax[ernie.cstat.isp0]: 200
22 # Title[ernie.cstat.isp0]: isp0: callouts / callbacks
23 # PageTop[ernie.cstat.isp0]: <H1> isp0: callouts /callbacks </H1>
24 # Options[ernie.cstat.isp0]: gauge, nopercent, integer
25 # YLegend[ernie.cstat.isp0]: co / cb
26 # ShortLegend[ernie.cstat.isp0]: n
27 # Legend1[ernie.cstat.isp0]: callouts
28 # Legend2[ernie.cstat.isp0]: callbacks
29 # LegendI[ernie.cstat.isp0]: callouts:
30 # LegendO[ernie.cstat.isp0]: callbacks:
31 # WithPeak[ernie.cstat.isp0]: ymwd
32 #
33 #---------------------------------------------------------------------------
34 #       this is the shell script run by mrtg
35 #---------------------------------------------------------------------------
36 if [ -r /var/log/isdn/callouts.isp0 ]
37 then
38         cat /var/log/isdn/callouts.isp0 | awk '{print $3}'
39 else
40         echo 0
41 fi
42
43 if [ -r /var/log/isdn/callbacks.isp0 ]
44 then
45         cat /var/log/isdn/callbacks.isp0 | awk '{print $3}'
46 else
47         echo 0
48 fi
49
50 uptime | cut -c 12-18
51 uname -nsr
52
53 exit 0
54