Projet

Général

Profil

Révision 17f78427

ID17f784270ae966ee9a13e9f5104a5b8f925b639e
Parent ef851f0c
Enfant d4320aea, 5b2396a9

Ajouté par Lars Kruse il y a plus de 7 ans

Whitespace cleanup

  • remove trailing whitespace
  • remove empty lines at the end of files

Voir les différences:

plugins/lxc/lxc_proc
44 44
# Ubuntu 14.04: /sys/fs/cgroup/systemd/lxc/<container>/tasks
45 45
count_processes () {
46 46
    [ -z "$1" ] && return 0
47
    
47

  
48 48
    if [ -n "$cgrouppath" ]; then
49 49
        SYSFS=$cgrouppath/$1/tasks
50 50
        if [ -e $SYSFS ]; then
51 51
            return `wc -l < $SYSFS`
52 52
        fi
53 53
    fi
54
    
54

  
55 55
    for SYSFS in \
56 56
        /sys/fs/cgroup/$1/tasks \
57 57
        /sys/fs/cgroup/lxc/$1/tasks \
......
63 63
            return `wc -l < $SYSFS`
64 64
        fi
65 65
    done
66
    
66

  
67 67
    return 0
68 68
}
69 69

  
......
75 75
 fi
76 76
done
77 77
guest_names="$active"
78
                
78

  
79 79

  
80 80

  
81 81
f_comm='lxc-cgroup  '
......
97 97
 echo 'graph_vlabel Number of processes'
98 98
 echo 'graph_category processes'
99 99

  
100
 
101
 for guest_name in $guest_names;
102
 do 
100

  
101
 for guest_name in $guest_names; do
103 102
  guest="$(clean_fieldname $guest_name)"
104 103
  echo 'lxc_proc_'$guest'.label '$guest_name': processes'
105 104
  echo 'lxc_proc_'$guest'.type GAUGE'
......
108 107
 exit 0
109 108
fi
110 109

  
111
 for guest_name in $guest_names;
112
 do 
110
 for guest_name in $guest_names; do
113 111
  guest="$(clean_fieldname $guest_name)"
114
  
112

  
115 113
  count_processes $guest_name
116 114
  tmp_g=$?
117 115
  if [ $tmp_g -eq 0 ]; then
118 116
    tmp_g=`$f_comm -n $guest_name tasks | wc -l`
119 117
  fi
120 118
  echo 'lxc_proc_'$guest'.value '$tmp_g
121
  
119

  
122 120

  
123 121
 done
124 122

  

Formats disponibles : Unified diff