File: checkrrdmodel.sh

package info (click to toggle)
ntop 3%3A5.0.1%2Bdfsg1-2.1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 15,720 kB
  • ctags: 11,480
  • sloc: ansic: 79,804; sh: 21,658; python: 1,948; awk: 1,504; perl: 971; makefile: 745; php: 123; xml: 71; sql: 13; sed: 11
file content (45 lines) | stat: -rwxr-xr-x 1,640 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/sh

# Check for artifacts (files) from old rrd model, warn if found

if ! test -d ${1}/ntop/rrd; then
    exit 0
fi

rc=`ls -l ${1}/ntop/rrd/interfaces/*/hosts/ |
  grep ^d |
  awk '{ print $NF}' |
  grep '[0-9]\.[0-9]' |
  wc -l`

if test ${rc} != 0; then
  echo ""
  echo "************************************************************"
  echo "************************************************************"
  echo "************************************************************"
  echo "************************************************************"
  echo "************************************************************"
  echo ""
  echo "WARNING:"
  echo ""
  echo "You may have existing RRD databases using the so-called"
  echo "'small' model, that is single level directories, such as"
  echo "...ntop/rrd/interfaces/eth0/192.168.42.1/..."
  echo ""
  echo "ntop 3.0 implements ONLY the 'large' model, (which was an"
  echo "option on the rrdPlugin parameter page in 2.2), where each"
  echo "octet is a separate directory level, e.g."
  echo "...ntop/rrd/interfaces/eth0/192/168/42/1/..."
  echo ""
  echo ""
  echo "***  If you do not fix your directories before running   ***"
  echo "***     ntop 3.0, you WILL lose your historical data     ***"
  echo ""
  echo ""
  echo "************************************************************"
  echo "************************************************************"
  echo "************************************************************"
  echo "************************************************************"
  echo "************************************************************"
  echo ""
fi