Projet

Général

Profil

Paste
Télécharger au format
Statistiques
| Branche: | Révision:

root / plugins / system / debsecan @ 2e566be3

Historique | Voir | Annoter | Télécharger (1,71 ko)

1
#!/bin/sh
2
#
3
# Plugin to monitor the number of CVE vulnerabilities present on a Debian
4
# system (using debsecan). Might work on other distib, who knows...
5
#
6
# Inspiration of the moment 10/10/2007
7
#
8
# Nicolas BOUTHORS <nbouthors@nbi.fr> http://nbi.fr/
9
#
10
# Licence : Public Domain
11
#
12
#%# family=auto
13
#%# capabilities=autoconf
14

    
15
# Auto enable if we have debsecan only
16
if [ "$1" = "autoconf" ] ; then 
17
  if [ -x /usr/bin/debsecan ]; then
18
    echo yes
19
  else
20
    echo no
21
  fi
22
  exit 0
23
fi
24

    
25
# Fail if we don't have debsecan 
26
if [ ! -x /usr/bin/debsecan ]; then
27
  exit 1
28
fi
29

    
30
if [ "$1" = "config" ] ; then
31
  cat <<EOF_
32
graph_title DebSecan : vulnerabilities
33
graph_args -l 0 --base 1000
34
graph_vlabel number of CVE
35
graph_category system
36
graph_period second
37
graph_info This graph show the number of known vulnerabilities present on your system. Use debsecan to see detail.
38
high.label high
39
high.type GAUGE
40
high.max 50000
41
high.min 0
42
high.info The number CVE marked high high priority
43
medium.label medium
44
medium.type GAUGE
45
medium.max 50000
46
medium.min 0
47
medium.info The number CVE marked medium high priority
48
low.label low
49
low.type GAUGE
50
low.max 50000
51
low.min 0
52
low.info The number CVE marked low high priority
53
other.label other
54
other.type GAUGE
55
other.max 50000
56
other.min 0
57
other.info The number CVE with unspecified priority
58
EOF_
59
  exit 0
60
fi
61

    
62
debsecan 2> /dev/null > /tmp/debsecan.munin.$$
63
high=`grep -c 'high urgency' /tmp/debsecan.munin.$$`
64
medium=`grep -c 'medium urgency' /tmp/debsecan.munin.$$`
65
low=`grep -c 'low urgency)' /tmp/debsecan.munin.$$`
66
other=`grep -c -v -e 'low urgency' -e 'medium urgency' -e 'high urgency' /tmp/debsecan.munin.$$`
67
cat <<EOF_
68
high.value $high
69
medium.value $medium
70
low.value $low
71
other.value $other
72
EOF_
73

    
74
rm -f /tmp/debsecan.munin.$$