Projet

Général

Profil

Révision b8d75e80

IDb8d75e80e860d7f989b8924bd019d2d988d29d98
Parent 614b043a
Enfant 685a58d8

Ajouté par Stig Sandbeck Mathisen il y a environ 11 ans

Use UNIX line breaks

Voir les différences:

plugins/network/sockstat
1
#!/bin/sh
2
#
3

  
4
PATH=/bin:/usr/bin
5

  
6
if [ "$1" = "autoconf" ]; then
7
  echo yes
8
  exit 0
9
fi
10

  
11
DAEMONS=`sockstat | awk '{print substr($0, 1, 8)}' | sort | uniq`
12

  
13
if [ "$1" = "config" ]; then
14
  echo 'graph_title Connections'
15
  echo 'graph_vlabel Connections'
16
  echo 'graph_noscale true'
17
  echo 'graph_category network'
18
  echo 'graph_info This graph shows connections load.'
19

  
20
  for D in $DAEMONS
21
  do
22
      echo "_$D.label $D"
23
  done
24

  
25
  echo "_TOTAL.label TOTAL"
26

  
27
  exit 0
28
fi
29

  
30
VALUES=`sockstat | awk '{print substr($0, 1, 8)}' | sort | uniq -c`
31
NUM=1
32

  
33
for D in $DAEMONS
34
do
35
    echo -n "_$D.value "
36
    VAL=`echo $VALUES | cut -d ' ' -f $NUM`
37
    echo $VAL
38
NUM=$(($NUM + 2))
39
done
40

  
41
echo -n "_TOTAL.value "
42
sockstat | wc -l
1
#!/bin/sh
2
#
3

  
4
PATH=/bin:/usr/bin
5

  
6
if [ "$1" = "autoconf" ]; then
7
  echo yes
8
  exit 0
9
fi
10

  
11
DAEMONS=`sockstat | awk '{print substr($0, 1, 8)}' | sort | uniq`
12

  
13
if [ "$1" = "config" ]; then
14
  echo 'graph_title Connections'
15
  echo 'graph_vlabel Connections'
16
  echo 'graph_noscale true'
17
  echo 'graph_category network'
18
  echo 'graph_info This graph shows connections load.'
19

  
20
  for D in $DAEMONS
21
  do
22
      echo "_$D.label $D"
23
  done
24

  
25
  echo "_TOTAL.label TOTAL"
26

  
27
  exit 0
28
fi
29

  
30
VALUES=`sockstat | awk '{print substr($0, 1, 8)}' | sort | uniq -c`
31
NUM=1
32

  
33
for D in $DAEMONS
34
do
35
    echo -n "_$D.value "
36
    VAL=`echo $VALUES | cut -d ' ' -f $NUM`
37
    echo $VAL
38
NUM=$(($NUM + 2))
39
done
40

  
41
echo -n "_TOTAL.value "
42
sockstat | wc -l

Formats disponibles : Unified diff